Linux kernel development shell scripts
Published
A part of getting active in kernel development is finding a good workflow. These are the scripts I've used to avoid errors and increase productivity.
While upstreaming kernel patches scripts/checkpatch.pl and scripts/get_maintainer.pl often come in handy. But to me the interface they provide is slightly bulky and rely on using patch files instead of git commits, which to me is a bit inconvenient.
These scripts are all meant to be included in .bashrc or .zshrc
scripts/checkpatch.pl helper
1 2 3 4 5 6 7 8 9 10 11 |
|
The checkpatch script simply wraps the patch creation process and allows you to right away specify which
Example
~/work/linux $ checkpatch 15
WARNING: ENOSYS means 'invalid syscall nr' and nothing else
#349: FILE: drivers/tty/serial/sh-sci.c:3026:
+ if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS)
total: 0 errors, 1 warnings, 385 lines checked
In this example the 15 last commits are checked against scripts/checkpatch.pl for correctness.
scripts/get_maintainer.pl helper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Example
~/work/linux $ get_maintainer 1
--to=gregkh@linuxfoundation.org --to=jslaby@suse.com --to=linux-serial@vger.kernel.org --to=linux-kernel@vger.kernel.org
~/work/linux $ git send-email -1 $(get_maintainer 1)