User Tools

Site Tools


doc:devel:patches

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:devel:patches [2013/04/23 22:35]
jero patch: add clarification for host packages
doc:devel:patches [2015/08/25 21:22] (current)
theoradicus [Refreshing patches] added naming section
Line 9: Line 9:
  
 <​code>​cat > ~/.quiltrc <<EOF <​code>​cat > ~/.quiltrc <<EOF
-QUILT_DIFF_ARGS="​--no-timestamps --no-index -pab --color=auto"​ +QUILT_DIFF_ARGS="​--no-timestamps --no-index -p ab --color=auto"​ 
-QUILT_REFRESH_ARGS="​--no-timestamps --no-index -pab"+QUILT_REFRESH_ARGS="​--no-timestamps --no-index -p ab"
 QUILT_PATCH_OPTS="​--unified"​ QUILT_PATCH_OPTS="​--unified"​
 QUILT_DIFF_OPTS="​-p"​ QUILT_DIFF_OPTS="​-p"​
Line 19: Line 19:
   * The other variables control the patch format property like a/, b/ directory names and no timestamps   * The other variables control the patch format property like a/, b/ directory names and no timestamps
   * FreeBSD does not support the ''​%%--color=auto%%''​ option and ''​-pab''​ must be written as ''​-p ab''​   * FreeBSD does not support the ''​%%--color=auto%%''​ option and ''​-pab''​ must be written as ''​-p ab''​
 +  * :!: "-p ab" is working with quilt 0.63 on Linux and is documented in man page.
 ===== Adding a new patch ===== ===== Adding a new patch =====
  
Line 49: Line 49:
  
   * The name should start with a number, followed by a hyphen and a very short description of what is changed   * The name should start with a number, followed by a hyphen and a very short description of what is changed
-  * The choosen ​number should be higher than any existing patch - use //quilt series// to see the list of patches+  * The chosen ​number should be higher than any existing patch - use //quilt series// to see the list of patches
   * The patch file name should be short but descriptive   * The patch file name should be short but descriptive
  
Line 83: Line 83:
 To move the new patch file over to the buildroot, run //update// on the package: To move the new patch file over to the buildroot, run //update// on the package:
  
- ''​make package///​example///​update V=s''​ |+| ''​make package///​example///​update V=s''​ |
  
  
Line 142: Line 142:
 To move the updated patch file over to the buildroot, run //update// on the package: To move the updated patch file over to the buildroot, run //update// on the package:
  
- ''​make package///​example///​update V=s''​ |+| ''​make package///​example///​update V=s''​ |
  
  
Line 154: Line 154:
  
 The process for modifying kernel patches is the same as for packages, only the make targets and directories differ.\\ The process for modifying kernel patches is the same as for packages, only the make targets and directories differ.\\
-:!: For the kernel, an additional subdirectory for patches is used, ''​generic/''​ contains patches common to all architectures and ''​target/''​ contains patches specific to the current target.+:!: For the kernel, an additional subdirectory for patches is used, ''​generic/''​ contains patches common to all architectures and ''​platform/''​ contains patches specific to the current target.
  
 To prepare the kernel tree, use: To prepare the kernel tree, use:
Line 165: Line 165:
 | ''​cd build_dir/​target-*/​linux-*/​linux-3.*''​ | | ''​cd build_dir/​target-*/​linux-*/​linux-3.*''​ |
  
-Moving the changes back over to the buildroot tree from the build tree is done with:+Moving the changes back over to the buildroot tree from the build tree is done with ( you need to go back to trunk to do this):
 | ''​make target/​linux/​update package/​index V=s''​ | | ''​make target/​linux/​update package/​index V=s''​ |
  
-The last command for moving the changes back over the buildroot tree seems not to work with Attitude Adjustment 12.09-rc1; since if we typed such a command our patch will be deleted because it had remained in the temporary folder ​//​build_dir//​ where it was created.So a workaround in order to have our patch applied is moving the patch to the proper folder manually. That is to say, if we have followed the previous sections in which we modified ​or created a new patch, after issuing''​ quilt refresh'',​ our patch will appear under the next directory +(:!: Patches should be named with the correct prefix, platform/000-abc.patch or generic/000-abc.patchIf not the update may not work correctly.)
- +
-''​~/​attitude_adjustment/​build_dir/​linux-*/​linux-*/​patches/''​ +
- +
-Therefore, depending on the changes we want to add to the kernel, we should copy that patch to one of these directories +
- +
-  * ''​~/​attidude_adjustment/​target/​linux/​generic/patches-3.3''​ -> it will in theory get applied to all platforms +
-  * ''​~/​attidude_adjustment/​target/​linux/<​platform>/​patches-3.<​3>''​ -> it gets only applied to the specific platform you place it +
- +
-Thus, we have to move our patch to one of those directories,​ for example the first one +
-| ''​cp whateverNameYouSet.patch ~/​attitude_adjustment/​target/​linux/​generic/​patches-3.3/''​ |+
  
 Afterwards, if we want to verify whether our patch is applied or not, we can go to the top level directory with Afterwards, if we want to verify whether our patch is applied or not, we can go to the top level directory with
Line 186: Line 176:
 | ''​make target/​linux/​{clean,​prepare} V=s QUILT=1''​ | | ''​make target/​linux/​{clean,​prepare} V=s QUILT=1''​ |
  
-During this process all the applied patched will be shown, being our among them, preceede ​by //​generic///​ or // platform/// depending on what directory we placed the patch. Another way of retreiving ​the applied patches is through ​+During this process all the applied patched will be shown, ​ours being among them, preceeded ​by //​generic///​ or // platform/// depending on what directory we placed the patch. Another way of retrieving ​the applied patches is through
  
 | ''​quilt series''​ | | ''​quilt series''​ |
Line 205: Line 195:
 | ''​make toolchain/​gcc/​update V=99''​ | | ''​make toolchain/​gcc/​update V=99''​ |
  
 +
 +===== Naming patches =====
 +
 +valid for **target/​linux/​generic** and <​arch>:​
 +<​code>​
 +The patches-* subdirectories contain the kernel patches applied for every
 +OpenWrt target. All patches should be named '​NNN-lowercase_shortname.patch'​
 +and sorted into the following categories:
 +
 +0xx - upstream backports
 +1xx - code awaiting upstream merge
 +2xx - kernel build / config / header patches
 +3xx - architecture specific patches
 +4xx - mtd related patches (subsystem and drivers)
 +5xx - filesystem related patches
 +6xx - generic network patches
 +7xx - network / phy driver patches
 +8xx - other drivers
 +9xx - uncategorized other patches
 +
 +ALL patches must be in a way that they are potentially upstreamable,​ meaning:
 +
 +- they must contain a proper subject
 +- they must contain a proper commit message explaining what they change
 +- they must contain a valid Signed-off-by line
 +</​code>​
 +from: [[https://​dev.openwrt.org/​browser/​trunk/​target/​linux/​generic/​PATCHES|PATCHES]]
  
 ===== Refreshing patches ===== ===== Refreshing patches =====
doc/devel/patches.1366749355.txt.bz2 · Last modified: 2013/04/23 22:35 by jero