Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit b26cb1a3c1982f453067655c9dc224d394485e64 Author: Sven Eckelmann sven@narfation.org Date: Sat Jan 22 22:44:27 2011 +0000
doc: batman-adv/SubmittingLinux
b26cb1a3c1982f453067655c9dc224d394485e64 batman-adv/SubmittingLinux.textile | 176 +++++++++++++++++++++---------------- 1 file changed, 102 insertions(+), 74 deletions(-)
diff --git a/batman-adv/SubmittingLinux.textile b/batman-adv/SubmittingLinux.textile index d3862dc8..0ed4024f 100644 --- a/batman-adv/SubmittingLinux.textile +++ b/batman-adv/SubmittingLinux.textile @@ -1,41 +1,47 @@ -= Submitting Patches to Linux = + +h1. Submitting Patches to Linux +
We currently submit patches for Linux from our next branch. I try to give a short overview about it using some patches submitted to DaveM.
Following steps must always be done: - * get the linux-integration repository (we assume that the linux branch is up to date) - * get the newest patches from next - * merge next into linux - * check for compat code - * check difference with next - * rebase on top of previous version - * squash/cleanup patches - * check if all versions compile cleanly against a current version of linux-next and sparse (cgcc) - * format patches - * check commit messages author/signed-off-by of patches - * Add "batman-adv: " before each commit subject - * get current version of linux-next - * create working branch on linux-next - * apply all patches on linux next - * check if all patches build again with linux next - * check if all patches are checkpatch.pl clean - * submit patches - - -== get the linux-integration repository == - -{{{ +* get the linux-integration repository (we assume that the linux branch is up to date) +* get the newest patches from next +* merge next into linux +* check for compat code +* check difference with next +* rebase on top of previous version +* squash/cleanup patches +* check if all versions compile cleanly against a current version of linux-next and sparse (cgcc) +* format patches +* check commit messages author/signed-off-by of patches +* Add "batman-adv: " before each commit subject +* get current version of linux-next +* create working branch on linux-next +* apply all patches on linux next +* check if all patches build again with linux next +* check if all patches are checkpatch.pl clean +* submit patches + + + +h2. get the linux-integration repository + + +<pre> '-(%25)-> git clone git+ssh://git@open-mesh.org/srv/git/ecsv/linux-merge.git Initialized empty Git repository in /home/sven/tmp/linux-merge/.git/ remote: Counting objects: 1544059, done. remote: Compressing objects: 100%25 (252781/252781), done. .... '-(%25)-> cd linux-merge -}}} +</pre> + + +h2. get the newest patches from next
-== get the newest patches from next ==
-{{{ +<pre> '-(%25)-(merge/master)> git remote update Fetching origin remote: Counting objects: 1387, done. @@ -46,11 +52,13 @@ Resolving deltas: 100%25 (651/651), completed with 228 local objects. From git+ssh://open-mesh.org/srv/git/ecsv/linux-merge bfa88ea..151b6a5 master -> origin/master c9f7cbe..078eb6a next -> origin/next -}}} +</pre>
-== merge next into linux ==
-{{{ +h2. merge next into linux + + +<pre> '-(%25)-(xyz)> git checkout merge/master Checking out files: 100%25 (32337/32337), done. Switched to branch 'linux' @@ -77,31 +85,37 @@ rm 'net/batman-adv/compat.h' '-(%25)-(merge/master)> git add net/batman-adv/Makefile '-(%25)-(merge/master)> git commit [linux f2204f0] Merge remote branch 'origin/standalone/next' into merge/master -}}} +</pre> +
-== check for compat code == +h2. check for compat code
-{{{ + +<pre> git grep compat.h net/batman-adv/ net/batman-adv/CHANGELOG:* all kernel version compatibility functions has been moved to compat.h -}}} +</pre> + + +h2. check difference with next
-== check difference with next ==
-{{{ +<pre> git diff origin/standalone/next: merge/master:net/batman-adv/ -}}} +</pre>
Here you should see the - * new added Kconfig - * A special Makefile which only contains obj-m and a batman-adv-objs line - * removed CHANGELOG, Makefile.kbuild, bat_printk.c, README, sysfs-class-net-batman-adv, sysfs-class-net-mesh and compat.h - * removed references to compat.h from main.h +* new added Kconfig +* A special Makefile which only contains obj-m and a batman-adv-objs line +* removed CHANGELOG, Makefile.kbuild, bat_printk.c, README, sysfs-class-net-batman-adv, sysfs-class-net-mesh and compat.h +* removed references to compat.h from main.h
-== rebase on top of previous tag ==
-{{{ +h2. rebase on top of previous tag + + +<pre> '-(%25)-(merge/master)> git checkout -b patches '-(%25)-(patches)> git rebase -s subtree origin/merge/master First, rewinding head to replay your work on top of it... @@ -149,7 +163,7 @@ To restore the original branch and stop rebasing run "git rebase --abort". '-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> git add net/batman-adv/Makefile '-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> git rebase -s subtree --continue Already applied: 0007 batman-adv: Use nproc to get number of available processors -CONFLICT (delete/modify): net/batman-adv/compat.h deleted in GregKH-20100618 and modified in HEAD~1. Version HEAD~1 of net/batman-adv/compat.h left in tree. +CONFLICT (delete/modify): net/batman-adv/compat.h deleted in [[GregKH]]-20100618 and modified in HEAD~1. Version HEAD~1 of net/batman-adv/compat.h left in tree.
When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". @@ -163,7 +177,7 @@ rm 'net/batman-adv/compat.h' Committed: 0008 batman-adv: Add include guards to all header files Auto-merging net/batman-adv/Makefile CONFLICT (content): Merge conflict in net/batman-adv/Makefile -CONFLICT (delete/modify): net/batman-adv/Makefile.kbuild deleted in GregKH-20100618 and modified in HEAD~0. Version HEAD~0 of net/batman-adv/Makefile.kbuild left in tree. +CONFLICT (delete/modify): net/batman-adv/Makefile.kbuild deleted in [[GregKH]]-20100618 and modified in HEAD~0. Version HEAD~0 of net/batman-adv/Makefile.kbuild left in tree.
When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". @@ -178,20 +192,24 @@ rm 'net/batman-adv/Makefile.kbuild' Already applied: 0009 batman-adv: Add support for git revision string All done. '-(%25)-(patches)> git diff origin/merge/master -}}} +</pre>
The last diff must be empty or we did something wrong.
-== squash/cleanup patches ==
-{{{ +h2. squash/cleanup patches + + +<pre> '-(%25)-(patches)> git rebase -i origin/merge/master Successfully rebased and updated refs/heads/patches -}}} +</pre> +
-== check if all versions compile cleanly against a current version of linux-next and sparse (cgcc) == +h2. check if all versions compile cleanly against a current version of linux-next and sparse (cgcc)
-{{{ + +<pre> '-(%25)-(patches)> git rev-list --reverse origin/merge/master.. 166b2caa61fce5260aed4e119671764331fdc62a 5cd65234b12021fe1f28e28e455a6b6a06712ec2 @@ -204,41 +222,43 @@ a85d1b45e4cde0c882a41baaefeec0cd5502416f '-(%25)-(patches)> git checkout 166b2caa61fce5260aed4e119671764331fdc62a Previous HEAD position was a85d1b4... batman-adv: Avoid rounding issues for local hna timeout HEAD is now at 166b2ca... batman-adv: Convert names from Java to C style -'-(%25)-(166b2caa61fce5260aed4e119671764331fdc62a)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(166b2caa61fce5260aed4e119671764331fdc62a)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ ... '-(%25)-(166b2caa61fce5260aed4e119671764331fdc62a)> git checkout 5cd65234b12021fe1f28e28e455a6b6a06712ec2 Previous HEAD position was 166b2ca... batman-adv: Convert names from Java to C style HEAD is now at 5cd6523... batman-adv: Avoid rounding issues for local hna timeout -'-(%25)-(83d1bc8bb328bcfa42be492fe0e2648b77c18af2)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(83d1bc8bb328bcfa42be492fe0e2648b77c18af2)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ .... '-(%25)-(83d1bc8bb328bcfa42be492fe0e2648b77c18af2)> git checkout 9e9605f0fe000f1097cb43271540ab2b76b2a782 Previous HEAD position was 83d1bc8... batman-adv: Lower resolution for timeouts HEAD is now at 9e9605f... batman-adv: replace manual calculation by msecs_to_jiffies() for better readability -'-(%25)-(9e9605f0fe000f1097cb43271540ab2b76b2a782)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(9e9605f0fe000f1097cb43271540ab2b76b2a782)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ .... '-(%25)-(9e9605f0fe000f1097cb43271540ab2b76b2a782)> git checkout 043aa9a54a5296c6027a5bcd808b8d29cea8a474 Previous HEAD position was 9e9605f... batman-adv: replace manual calculation by msecs_to_jiffies() for better readability HEAD is now at 043aa9a... batman-adv: Add sysfs abi documentation about bonding -'-(%25)-(043aa9a54a5296c6027a5bcd808b8d29cea8a474)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(043aa9a54a5296c6027a5bcd808b8d29cea8a474)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ ... '-(%25)-(043aa9a54a5296c6027a5bcd808b8d29cea8a474)> git checkout f6d8baba5fce6161bc2cee9c97e0afbc139942c0 Previous HEAD position was 043aa9a... batman-adv: Add sysfs abi documentation about bonding HEAD is now at f6d8bab... batman-adv: adapting source version to revised versioning scheme -'-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ ... '-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> git checkout a85d1b45e4cde0c882a41baaefeec0cd5502416f Previous HEAD position was f6d8bab... batman-adv: adapting source version to revised versioning scheme HEAD is now at a85d1b4... batman-adv: Add include guards to all header files -'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=`pwd` +'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> make CONFIG_BATMAN_ADV=m CC=cgcc -C /home/sven/tmp/linux-next M=@pwd@ ... '-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> git checkout patches Switched to branch 'patches' '-(%25)-(patches)> cd ../../../ -}}} +</pre> +
-== format patches == +h2. format patches
-{{{ + +<pre> '-(%25)-(patches)> git format-patch --patience -s -M origin/merge/master 0001-batman-adv-Convert-names-from-Java-to-C-style.patch 0002-batman-adv-Avoid-rounding-issues-for-local-hna-timeo.patch @@ -248,13 +268,15 @@ Switched to branch 'patches' 0006-batman-adv-adapting-source-version-to-revised-versio.patch 0007-batman-adv-Add-include-guards-to-all-header-files.patch '-(%25)-(patches)> vim 00*.patch -}}} +</pre>
Usually I add "batman-adv: " right when checking the signed-off-by and author (from) line.
-== apply all patches on linux next ==
-{{{ +h2. apply all patches on linux next + + +<pre> '-(%25)-(patches)> cd ../linux-next '-(%25)-(master)> git remote update '-(%25)-(master)> git reset --hard origin/master @@ -269,18 +291,22 @@ Applying: batman-adv: replace manual calculation by msecs_to_jiffies() for bette Applying: batman-adv: Add sysfs abi documentation about bonding Applying: batman-adv: adapting source version to revised versioning scheme Applying: batman-adv: Add include guards to all header files -}}} +</pre>
-== check if all patches build again with linux next ==
-{{{ +h2. check if all patches build again with linux next + + +<pre> '-(%25)-(davem)> make .... -}}} +</pre> +
-== format patches on top of linux-next master == +h2. format patches on top of linux-next master
-{{{ + +<pre> '-(%25)-(davem)> git format-patch -s --patience -M master 0001-batman-adv-Convert-names-from-Java-to-C-styl.patch 0002-batman-adv-Avoid-rounding-issues-for-local-h.patch @@ -311,11 +337,13 @@ total: 0 errors, 0 warnings, 0 checks, 8 lines checked total: 0 errors, 0 warnings, 0 checks, 239 lines checked
0007-batman-adv-Add-include-guards-to-all-header-.patch has no obvious style problems and is ready for submission. -}}} +</pre> + + +h2. submit patches
-== submit patches ==
-{{{ +<pre> '-(%25)-(davem)> ../linux-merge/ '-(%25)-(patches)> git checkout batman-adv/next '-(%25)-(batman-adv/next)> git rev-parse batman-adv/next @@ -332,11 +360,11 @@ Applying: batman-adv: Add include guards to all header files '-(%25)-(batman-adv/next)> git push '-(%25)-(batman-adv/next)> git request-pull 12513b76a021e5b41a9d5d5981da75dfd6480890 git://git.open-mesh.org/ecsv/linux-merge.git > shortlog '-(%25)-(batman-adv/next)> git send-email --compose --to=davem@davemloft.net --cc=netdev@vger.kernel.org --cc=b.a.t.m.a.n@lists.open-mesh.org 00*.patch -}}} +</pre>
Now I will write something like
-{{{ +<pre> From Sven Eckelmann sven@narfation.org # This line is ignored. GIT: Lines beginning in "GIT:" will be removed. GIT: Consider including an overall diffstat or table of contents @@ -401,4 +429,4 @@ Sven Eckelmann (1): net/batman-adv/vis.c | 14 +++++++------- net/batman-adv/vis.h | 7 ++++++- 25 files changed, 116 insertions(+), 45 deletions(-) -}}} \ No newline at end of file +</pre> \ No newline at end of file