1.1 获取内核源码
克隆Linus的主线树
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
添加linux-next树(包含下一版本的特性)
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch linux-next
添加稳定版树
git remote add stable https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
git fetch stable
1.2 配置Git
设置用户信息
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
设置编辑器
git config --global core.editor vim
配置发送邮件
git config --global sendemail.smtpserver smtp.gmail.com
git config --global sendemail.smtpserverport 587
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpuser your.email@example.com
设置补丁格式
git config --global format.numbered auto
git config --global format.signoff true
1.3 安装必要工具
代码检查工具
sudo apt install sparse coccinelle
邮件工具
sudo apt install git-email mutt
文档工具
sudo apt install python3-sphinx python3-sphinx-rtd-theme