Linux upstream
upstream 是指軟件開發者向原作者或維護者發布補丁的行為
所有的 Linux patches, 可以透過
https://lore.kernel.org/patchwork/project/lkml/list/
查詢得到.
1. 安裝相關套件
sudo apt-get install git git-core git-email
2. 設定姓名和 email
git config --global user.name
git config --global user.email
3. 下載 Linux source code
4. 看相關 git log
git log
git log --oneline .
git log .
這邊同時也可以看看 patch 的 git commit 怎麼寫
https://blog.louie.lu/2017/03/21/%E5%A6%82%E4%BD%95%E5%AF%AB%E4%B8%80%E5%80%8B-git-commit-message/
5. 提交修改
5.1 git commit
git add .
git commit -s
5.2 產生 patch 檔.
./scripts/checkpatch.pl 0001.patch
total: 0 errors, 0 warnings, 0 checks, 8 lines checked
0001.patch has no obvious style problems and is ready for submission.
5.4 看誰是相關維護者
e.g.
./scripts/get_maintainer.pl -f drivers/net/wireless/broadcom/brcm80211
5.5 Google 安全度調降
upstream 時, 如果用 google gmail, 先將帳號調整為低安全度
帳號: 低安全性
https://support.google.com/accounts/answer/6010255?hl=en
5.6 網路連線
可以先看是否系統網路能連線
telnet smtp.gmail.com 587
5.7 MSMTP
5.7.1 MSMTP 軟件包
sudo apt-get install msmtp msmtp-mta ca-certificates
5.7.2 文件配置
/etc/msmtprc
5.7.4 測試
echo -e "Subject: Test Mail \r\n\r\nThis is a test mail" | msmtp --debug --from=default -t <gmail account>
5.8 用 git 發送patch
5.9 debug
--smtp-debug=1
所有的 Linux patches, 可以透過
https://lore.kernel.org/patchwork/project/lkml/list/
查詢得到.
1. 安裝相關套件
sudo apt-get install git git-core git-email
2. 設定姓名和 email
git config --global user.name
git config --global user.email
3. 下載 Linux source code
$ git clone git@github.com:torvalds/linux.git
4. 看相關 git log
git log
git log --oneline .
git log .
這邊同時也可以看看 patch 的 git commit 怎麼寫
https://blog.louie.lu/2017/03/21/%E5%A6%82%E4%BD%95%E5%AF%AB%E4%B8%80%E5%80%8B-git-commit-message/
5. 提交修改
5.1 git commit
git add .
git commit -s
5.2 產生 patch 檔.
$ git format-patch origin --stdout > 0001.patch
或 git format-patch -N , 這邊 N 指的是最近幾筆的提交, 如 N=1, 就是最後一筆
git format-patch -1
5.3 檢查 patch
./scripts/checkpatch.pl 0001.patch
total: 0 errors, 0 warnings, 0 checks, 8 lines checked
0001.patch has no obvious style problems and is ready for submission.
5.4 看誰是相關維護者
e.g.
./scripts/get_maintainer.pl -f drivers/net/wireless/broadcom/brcm80211
5.5 Google 安全度調降
upstream 時, 如果用 google gmail, 先將帳號調整為低安全度
帳號: 低安全性
https://support.google.com/accounts/answer/6010255?hl=en
5.6 網路連線
可以先看是否系統網路能連線
telnet smtp.gmail.com 587
不行的話換一個上網方式
5.7 MSMTP
5.7.1 MSMTP 軟件包
sudo apt-get install msmtp msmtp-mta ca-certificates
5.7.2 文件配置
/etc/msmtprc
# Example for a user configuration file
# Set default values for all follwing accounts.
defaults
.logfile /var/log/msmtp/msmtp.log
# Setup account
account gmail
protocol smtp
host smtp.gmail.com
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth login
user my@gmail.com
from my@gmail.com
account default : gmail
5.7.3 .gitconfig
[user]
emal = email account
name = user name
email = email account
[color]
ui = auto
[sendemail]
from = email account
smtpserver = /usr/bin/msmtp
smtpserverport = 587
smtpencryption = tls
smtpuser = email account
suppresscc = self
chainreplyto = false
[user]
emal = email account
name = user name
email = email account
[color]
ui = auto
[sendemail]
from = email account
smtpserver = /usr/bin/msmtp
smtpserverport = 587
smtpencryption = tls
smtpuser = email account
suppresscc = self
chainreplyto = false
5.7.4 測試
echo -e "Subject: Test Mail \r\n\r\nThis is a test mail" | msmtp --debug --from=default -t <gmail account>
命令如下:
git send-email \
--smtp-server /usr/bin/msmtp \
--from my@gmail.com \
--to gregkh@suse.de \
--to devel@linuxdriverproject.org \
--to linux-kernel@vger.kernel.org \
--cc ....
./my.patch
5.9 debug
--smtp-debug=1
留言
張貼留言