1 Patch the kernel
In this example, we create a patch for Linux GPIO driver. We should do the steps as below:
- Go to the gpio driver folder:
cd tmp/work/<machine>-fsl-linux/linux-s32/5.4-r0/git/drives/gpio
and edit the source file gpio-siul2-s32gen1.c
- Add source that you changed before to git
cd <builddirectory>/tmp/work/<machine>-fsl-linux/linux-s32/5.4-r0/git
git add drivers/gpio/gpio-siul2-s32gen1.c
git commit -s -m <title of your commit>
- Create the patch
git format-patch -1
Check in <builddirectory>/tmp/work/<machine>-fsl-linux/linux-s32/5.4-r0/git folder, there is a patch file created, e.g.
0001-test-gpio-repackage.patch
- Copy the patch file to meta-alb/recipes-kernel/linux/linux-s32 folder
- Edit linux-s32_5.4.bb file in /meta-alb/recipes-kernel/linux to include the patch file, e.g.
SRC_URI += "file://0001-test-gpio-repackage.patch"
- Return to the build directory and run command as below to clean the previous sstate:
source ./SOURCE_THIS
bitbake virtual/kernel -c cleansstate
- Re-build and deploy linux
bitbake virtual/kernel
网友评论