Run devtool modify linux-raspberrypi
from the same shell you run bitbake my-image
from.
The kernel source tree will be copied to build/workspace/sources/linux-raspberrypi
.
Make edits to the device tree at build/workspace/sources/linux-raspberrypi/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
and then run git diff > 0001-my-patch-description.patch
.
To know the name of the kernel source recipe to override, we can ask bitbake.
# In bitbake, view the selected kernel recipe name
oe-pkgdata-util lookup-recipe kernel
For the RPI4 this should show linux-raspberrypi
.
- meta-mylayer
- recipes-mylayer
- recipes-kernel
- linux
- files
- 0001-my-patch-description.patch (this is the diff from the kernel source tree we sourced)
- files
- linux-raspberrypi_%.bbappend
- linux
The content of linux-raspberrypi_%.bbappend
is the following:
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://0001-my-patch-description.patch"