Linux Submitting Patch
Table of Contents
For a long time, I've been wondering what it would be like to submit patches to the linux kernel. Now I find a chance to do that.
This post records the necessary steps for preparing and submitting patches to the kernel mail list.
1 Get the latest kernel source code from git. It is recommeded to use Torvalds's branch.
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git |
2 Create a new branch within git, in which the modification takes place.
git branch wujing(any branch name) |
git checkout wujing |
After this step, the working branch is switched to wujing. You can check the status with :
git branch |
The branch name with a star sign in front is the currently active branch.
3 Commit the changes.
git commit -m "modification summary" ./* |
In the above command, it is assumed that the modified files is located in the current working directory. Normally, this directory can be the top level source directory.
4 Make patch with git.
git format-patch master -s |
This command creates a patch against the master branch. With all the necessary information of a standard patch.
5 Configure the msmtp service and send the patch to the matainers.
apt install msmtp |
The configuration file of msmtp(~/.msmtprc) using hotmail is as follows:
1: defaults 2: logfile ~/.msmtp.log 3: #hotmail 4: account hotmail 5: protocol smtp 6: host smtp.live.com 7: from xxx@hotmail.com 8: user xxx@hotmail.com 9: password xxxx 10: port 25 11: auth login 12: tls on 13: tls_trust_file /etc/ssl/certs/ca-certificates.crt 14: syslog LOG_MAIL 15: 16: # Set a default account 17: account default : hotmail
To find the matainers, use the following command:
./scripts/get_maintainer.pl -f xx |
Finally, to send the patch to the target users:
git send-email –smtp-server /usr/bin/msmtp –to xxx@qq.com –cc xxx@cqu.edu.cn xxx.patch |