1.install git git-email
yum install git
yum install git-email
2.download the source code of kernel
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git clone git://libvirt.org/libvirt.git
git clone git://git.qemu-project.org/qemu.git
3.configure git
git-config --global user.name "xxx "
git-config --global user.email "xxx@yy.com"
git config --list
4.configure git-sendmail
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpserver mail.messagingengine.com
git config --global sendemail.smtpuser xxx@yy.fm
git config --global sendemail.smtpserverport 587
git config --global sendemail.smtppass hackme
執行如下命令,驗證發送郵件是否成功。填寫自己的郵箱地址。
echo -e "Subject: Test Mail\r\n\r\nThis is a test mail" |msmtp --debug -t xxx@163.com
如果成功,繼續後續步驟。
5.開發自己的補丁
git checkout -b dev //建立自己的開發分支
vi kernel/sched/core.c //修改代碼
make -j2
make modules_install
make install //編譯核心,驗證修改是否滿足預期
git commit -a -s -m 'sched: fix BUG in preempt_notifier' -e //提交修改
git format-patch -1 //產生補丁
./scripts/checkpatch.pl 0001-sched-fix-BUG-in-preempt_notifier.patch //檢查補丁是否符合規範
./scripts/get_maintainer.pl kernel/sched/ -f //查看對應模組的維護者
git send-email --smtp-server /usr/bin/msmtp --to xxx --to xxx --cc linux-kernel@vger.kernel.org 0001-sched-fix-BUG-in-preempt_notifier.patch //發送郵件給對應的維護者和maillist