Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply patches to a package in Buildroot?

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?

like image 994
pradeepchhetri Avatar asked Jun 17 '11 08:06

pradeepchhetri


1 Answers

some details about patch files in the buildroot project:

  1. you have to

    diff -u "old_file" "new_file" > file.patch
    

while standing exactly above extracted location of your package tar.gz defined in

PACKAGE_NAME_SOURCE

it means, your path to the file must include extracted package folder name.

  1. 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.

  2. naming convention for the patches already used/defined in buildroot (all parts are separated with '-' sign):

    • 4 digits patch priority (starting from 0001)
    • target filename
    • reason for patching
    • .patch extention

example:

0001-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch
  1. deposit patch file inside buildroot/package/"your package name"/ folder.

there is no need for configuration files to modify, all patches will be tried for application automatically.

  1. in case of the failure, the reject-patch file (named similar to the file you are trying to patch but with .rej extention) will be deposited inside package extracted folder.
like image 125
Oleg Kokorin Avatar answered Sep 17 '22 03:09

Oleg Kokorin