I am working on an embedded system that uses buildroot as a tool for building the kernel and the root filesystem. I want to apply some patches to this kernel source tree, Can somebody tell me how buildroot apply patches?
相关问题
- Kernel oops Oops: 80000005 on arm embedded system
- Linux kernel behaviour on heap overrun or stack ov
- Where is the standard kernel libraries to let kern
- Disabling interrupt in interrupt handler STM32F407
- What is the difference between /dev/mem, /dev/kmem
相关文章
- Enable dynamic debug for multiple files at boot
- Difference in ABI between x86_64 Linux functions a
- infinite abort() in a backrace of a c++ program co
- Why are there no debug symbols in my vmlinux when
- Difference between arm-none-eabi and arm-linux-gnu
- Decode Base64 string to byte array
- Problem with time() function in embedded applicati
- ccflag option in Makefile
To expand on @pradeepchhentri's answer. Quilt will look for a file located in the same folder as the *.mk file. To construct the appropriate file:
diff your source package from the original into a file called
packagename-number-description.patch
where
packagename - has to be identical to the package name
number - is the order in which the patches should be applied if you have more than one patch to apply (otherwise it will be applied alphabetically)
description - can be any free text
Place this file into the package at the same level as the [packagename].mk file and the package/Config.in file.
Don't forget to blow away your build files or do a [package]-rebuild if you do this. You should see a "Patching..." message if this is done correctly.
After studying the buildroot architecture, I came to know that buildroot uses quilt tool for applying the patches. quilt keeps track of all the patches in the a file named "series" which is present in the "patches" directory. You have to keep your patches in this directory. And add your entry of patches in the series file in the order in which you want the patches to be applied keeping the patch to be applied first at the top.
This way when you will run the buildroot makefile, it will automatically apply the patches listed in the series file.
some details about patch files in the buildroot project:
you have to
while standing exactly above extracted location of your package tar.gz defined in
it means, your path to the file must include extracted package folder name.
in case you wonder if the "old_file" path would be different from the original one - don't worry, the important one is the "new_file" path and name - it should match your package extracted one.
naming convention for the patches already used/defined in buildroot (all parts are separated with '-' sign):
example:
there is no need for configuration files to modify, all patches will be tried for application automatically.
BR2_GLOBAL_PATCH_DIR
out-of-tree patchesDirectory structure:
.git/
buildroot/
Buildroot submodule as mentioned at: https://stackoverflow.com/a/23635403/895245global_patch_dir/packagename/0001-my-test.patch
Add to config:
Then build with:
The patch should be applied to
output/build/packagename-1.0.0/
before build.Generate the patches with
*_OVERRIDE_SRCDIR
If you just hack the packages directly under
output/build/
, you won't have anything to diff to.Instead use the
*_OVERRIDE_SRCDIR
mechanism, which allows you to point to a git repo of your choice: How to modify the source of Buildroot packages for package development? , which you should then track as a git submodule.