Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit 4175b274224dd73a153bd7d6edd082bf7af0bbaf Author: Sven Eckelmann sven@narfation.org Date: Tue Jun 21 13:11:42 2011 +0000
doc: batman-adv/SubmittingLinux
4175b274224dd73a153bd7d6edd082bf7af0bbaf batman-adv/SubmittingLinux.textile | 389 +++++++++++++++++++++++++++++++++++++ 1 file changed, 389 insertions(+)
diff --git a/batman-adv/SubmittingLinux.textile b/batman-adv/SubmittingLinux.textile index a18b32f0..0b1001e0 100644 --- a/batman-adv/SubmittingLinux.textile +++ b/batman-adv/SubmittingLinux.textile @@ -1,3 +1,392 @@ +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 + + + +h2. get the linux-integration repository + + +<pre> +'-(%25)-> git clone git+ssh://git@open-mesh.org/srv/git/marek/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 + + +<pre> +'-(%25)-(merge/master)> git remote update +Fetching origin +remote: Counting objects: 1387, done. +remote: Compressing objects: 100%25 (211/211), done. +remote: Total 823 (delta 651), reused 762 (delta 602) +Receiving objects: 100%25 (823/823), 136.90 KiB | 254 KiB/s, done. +Resolving deltas: 100%25 (651/651), completed with 228 local objects. +From git+ssh://open-mesh.org/srv/git/marek/linux-merge + bfa88ea..151b6a5 master -> origin/master + c9f7cbe..078eb6a next -> origin/next +</pre> + + +h2. merge next into linux + + +<pre> +'-(%25)-(xyz)> git checkout merge/master +Checking out files: 100%25 (32337/32337), done. +Switched to branch 'linux' +'-(%25)-(merge/master)> git merge -s subtree origin/standalone/next +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 HEAD and modified in next. Version next of net/batman-adv/Makefile.kbuild left in tree. +CONFLICT (delete/modify): net/batman-adv/compat.h deleted in HEAD and modified in next. Version next of net/batman-adv/compat.h left in tree. +Auto-merging net/batman-adv/main.c +Auto-merging net/batman-adv/originator.c +Auto-merging net/batman-adv/routing.c +Auto-merging net/batman-adv/send.c +Auto-merging net/batman-adv/soft-interface.c +Auto-merging net/batman-adv/translation-table.c +Auto-merging net/batman-adv/vis.c +Automatic merge failed; fix conflicts and then commit the result. +'-(%25)-(merge/master)> git rm net/batman-adv/Makefile.kbuild net/batman-adv/compat.h +net/batman-adv/Makefile: needs merge +net/batman-adv/Makefile.kbuild: needs merge +net/batman-adv/compat.h: needs merge +rm 'net/batman-adv/Makefile.kbuild' +rm 'net/batman-adv/compat.h' +'-(%25)-(merge/master)> vim net/batman-adv/Makefile +'-(%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> + + +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 + + +<pre> +git diff origin/standalone/next: origin/merge/master:net/batman-adv/ +</pre> + +Here you should see the +* Removed CHANGELOG +* new added Kconfig +* A special Makefile which only contains obj-m and a batman-adv-objs line +* removed Makefile.kbuild, README, compat.c, compat.h +* removed references to compat.h from main.h +* (Re)Moved sysfs-class-net-batman-adv and sysfs-class-net-mesh + + + +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... +Auto-merging net/batman-adv/main.c +Auto-merging net/batman-adv/routing.c +Auto-merging net/batman-adv/send.c +Auto-merging net/batman-adv/soft-interface.c +Auto-merging net/batman-adv/vis.c +[detached HEAD 166b2ca] batman-adv: Convert names from Java to C style + Author: Antonio Quartulli ordex@ritirata.org + 7 files changed, 18 insertions(+), 18 deletions(-) +Committed: 0001 batman-adv: Convert names from Java to C style +Auto-merging net/batman-adv/translation-table.c +[detached HEAD 5cd6523] batman-adv: Avoid rounding issues for local hna timeout + Author: Linus Lüssing linus.luessing@web.de + 1 files changed, 1 insertions(+), 1 deletions(-) +Committed: 0002 batman-adv: Avoid rounding issues for local hna timeout +Auto-merging net/batman-adv/originator.c +Auto-merging net/batman-adv/translation-table.c +Auto-merging net/batman-adv/vis.c +[detached HEAD 83d1bc8] batman-adv: Lower resolution for timeouts + Author: Simon Wunderlich siwu@hrz.tu-chemnitz.de + 5 files changed, 7 insertions(+), 10 deletions(-) +Committed: 0003 batman-adv: Lower resolution for timeouts +Auto-merging net/batman-adv/send.c +[detached HEAD 9e9605f] batman-adv: replace manual calculation by msecs_to_jiffies() for better readability + Author: Marek Lindner lindner_marek@yahoo.de + 1 files changed, 4 insertions(+), 4 deletions(-) +Committed: 0004 batman-adv: replace manual calculation by msecs_to_jiffies() for better readability +[detached HEAD 043aa9a] batman-adv: Add sysfs abi documentation about bonding + Author: Marek Lindner lindner_marek@yahoo.de + 1 files changed, 8 insertions(+), 0 deletions(-) +Committed: 0005 batman-adv: Add sysfs abi documentation about bonding +[detached HEAD f6d8bab] batman-adv: adapting source version to revised versioning scheme + Author: Marek Lindner lindner_marek@yahoo.de + 1 files changed, 1 insertions(+), 1 deletions(-) +Committed: 0006 batman-adv: adapting source version to revised versioning scheme +Auto-merging net/batman-adv/Makefile +CONFLICT (content): Merge conflict in net/batman-adv/Makefile + +When you have resolved this problem run "git rebase --continue". +If you would prefer to skip this patch, instead run "git rebase --skip". +To restore the original branch and stop rebasing run "git rebase --abort". +'-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> vim net/batman-adv/Makefile +'-(%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. + +When you have resolved this problem run "git rebase --continue". +If you would prefer to skip this patch, instead run "git rebase --skip". +To restore the original branch and stop rebasing run "git rebase --abort". +'-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> git rm net/batman-adv/compat.h +net/batman-adv/compat.h: needs merge +rm 'net/batman-adv/compat.h' +'-(%25)-(f6d8baba5fce6161bc2cee9c97e0afbc139942c0)> git rebase -s subtree --continue +[detached HEAD a85d1b4] batman-adv: Add include guards to all header files + 17 files changed, 78 insertions(+), 12 deletions(-) +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. + +When you have resolved this problem run "git rebase --continue". +If you would prefer to skip this patch, instead run "git rebase --skip". +To restore the original branch and stop rebasing run "git rebase --abort". +'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> git rm net/batman-adv/Makefile.kbuild +net/batman-adv/Makefile: needs merge +net/batman-adv/Makefile.kbuild: needs merge +rm 'net/batman-adv/Makefile.kbuild' +'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> vim net/batman-adv/Makefile +'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> git add net/batman-adv/Makefile +'-(%25)-(a85d1b45e4cde0c882a41baaefeec0cd5502416f)> git rebase -s subtree --continue +Already applied: 0009 batman-adv: Add support for git revision string +All done. +'-(%25)-(patches)> git diff merge/master +</pre> + +The last diff must be empty or we did something wrong. + + +h2. squash/cleanup patches + + +<pre> +'-(%25)-(patches)> git rebase -i origin/merge/master +Successfully rebased and updated refs/heads/patches +</pre> + + +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 +83d1bc8bb328bcfa42be492fe0e2648b77c18af2 +9e9605f0fe000f1097cb43271540ab2b76b2a782 +043aa9a54a5296c6027a5bcd808b8d29cea8a474 +f6d8baba5fce6161bc2cee9c97e0afbc139942c0 +a85d1b45e4cde0c882a41baaefeec0cd5502416f +'-(%25)-(patches)> cd net/batman-adv/ +'-(%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)> 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)> 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)> 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)> 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)> 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)> git checkout patches +Switched to branch 'patches' +'-(%25)-(patches)> cd ../../../ +</pre> + + +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 +0003-batman-adv-Lower-resolution-for-timeouts.patch +0004-batman-adv-replace-manual-calculation-by-msecs_to_ji.patch +0005-batman-adv-Add-sysfs-abi-documentation-about.patch +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. + + +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 +HEAD is now at c3116ae Add linux-next specific files for 20100625 +'-(%25)-(master)> git checkout -b davem +Switched to a new branch 'davem' +'-(%25)-(davem)> git am -3 ../linux-merge/00*.patch +Applying: batman-adv: Convert names from Java to C style +Applying: batman-adv: Avoid rounding issues for local hna timeout +Applying: batman-adv: Lower resolution for timeouts +Applying: batman-adv: replace manual calculation by msecs_to_jiffies() for better readability +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> + + +h2. check if all patches build again with linux next + + +<pre> +'-(%25)-(davem)> make +.... +</pre> + + +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 +0003-batman-adv-Lower-resolution-for-timeouts.patch +0004-batman-adv-replace-manual-calculation-by-mse.patch +0005-batman-adv-Add-sysfs-abi-documentation-about.patch +0006-batman-adv-adapting-source-version-to-revise.patch +0007-batman-adv-Add-include-guards-to-all-header-.patch +'-(%25)-(davem)> ./scripts/checkpatch.pl --strict 00*.patch +total: 0 errors, 0 warnings, 0 checks, 135 lines checked + +0001-batman-adv-Convert-names-from-Java-to-C-styl.patch has no obvious style problems and is ready for submission. +total: 0 errors, 0 warnings, 0 checks, 8 lines checked + +0002-batman-adv-Avoid-rounding-issues-for-local-h.patch has no obvious style problems and is ready for submission. +total: 0 errors, 0 warnings, 0 checks, 55 lines checked + +0003-batman-adv-Lower-resolution-for-timeouts.patch has no obvious style problems and is ready for submission. +total: 0 errors, 0 warnings, 0 checks, 19 lines checked + +0004-batman-adv-replace-manual-calculation-by-mse.patch has no obvious style problems and is ready for submission. +total: 0 errors, 0 warnings, 0 checks, 14 lines checked + +0005-batman-adv-Add-sysfs-abi-documentation-about.patch has no obvious style problems and is ready for submission. +total: 0 errors, 0 warnings, 0 checks, 8 lines checked + +0006-batman-adv-adapting-source-version-to-revise.patch has no obvious style problems and is ready for submission. +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 + + +<pre> +'-(%25)-(davem)> ../linux-merge/ +'-(%25)-(patches)> git checkout batman-adv/next +'-(%25)-(batman-adv/next)> git rev-parse batman-adv/next +12513b76a021e5b41a9d5d5981da75dfd6480890 +'-(%25)-(batman-adv/next)> git am -3 00*.patch +Applying: batman-adv: Convert names from Java to C style +Applying: batman-adv: Avoid rounding issues for local hna timeout +Applying: batman-adv: Lower resolution for timeouts +Applying: batman-adv: replace manual calculation by msecs_to_jiffies() for better readability +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 +'-(%25)-(batman-adv/next)> git diff merge/master -- net/batman-adv/ +'-(%25)-(batman-adv/next)> git push +'-(%25)-(batman-adv/next)> git request-pull 12513b76a021e5b41a9d5d5981da75dfd6480890 git://git.open-mesh.org/marek/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 +GIT: for the patch you are writing. +GIT: +GIT: Clear the body content if you don't wish to send a summary. +From: Sven Eckelmann sven@narfation.org +Subject: pull request: batman-adv 2010-06-26 +In-Reply-To: + +Hi, + +I would like tp propose following corrections for net-next-2.6. + +The following changes since commit 12513b76a021e5b41a9d5d5981da75dfd6480890: + + Staging: dt3155: remove unused 32-bit and 8-bit global registers (2010-06-25 11:18:34 -0700) + +are available in the git repository at: + git://git.open-mesh.org/marek/linux-merge.git batman-adv/next + Antonio Quartulli (1): batman-adv: Convert names from Java to C style