Custom kernel build using radxa-repo/bsp

Hi,

I made a custom board using CM3 so I’m trying to build kernel with my own device tree configuration that fits to my board and connected peripherals.
I followed instructions in https://radxa-doc.github.io/software/build.html and successfully built image using rbuild and kernel separately using bsp.
Then now I’m trying to add my own device tree and overlays to kernel source but wondering where I can get started.
How can I make bsp script to use my kernel source in my local machine?

please change BSP_GIT and BSP_BRANCH in fork.conf.

you may add/modify files in your kernel/bsp source tree. (example 1 2)

or, you may add a file as a patch in bsp source tree. (example 1)

1 Like

I tried using local path (e.g., /home/bluera1n/kernel) in BSP_GIT but no luck. Maybe only git URL is acceptable?
And I just found “–no-prepare-source” option in bsp script, which tells allow building against locally modified repo. Does it mean that any modification to “.src/linux” will take effect?

ah, sorry, bsp was changed to use docker a while ago, local path (outside of bsp) cannot be accessed from container.

yes.

you may prepare .src/linux yourself e.g.

$ cd path/to/bsp
$ mkdir -p .src
$ git clone -b BRANCH /home/bluera1n/kernel .src/linux
$ (cd .src/linux && git pull) # just for FETCH_HEAD
$ ./bsp --no-prepare-source linux rk356x

Tested with your guide and confirmed working without any problem.
Thanks Naoki.