KernelSimpleGuide

Revision 2 as of 2009-03-27 13:56:37

Clear message

Prepare your environment

Install and setup necessary packages

Install necessary packages.

local# sudo apt-get install build-essential
local# sudo apt-get install fakeroot
local# sudo apt-get install kernel-wedge
local# sudo apt-get install libncurses5-dev
local# sudo apt-get install msmtp
local# sudo apt-get install git-core
local# sudo apt-get install git-email
local# sudo apt-get install debhelper

Setup msmtp, we take gmail account as an example.

local# vi ~/.msmtprc
# Set default values for all following accounts.
defaults
logfile ~/.msmtp.log

# gmail
account gmail
protocol smtp
host smtp.gmail.com
user <your_id_in_gmail>@gmail.com
password <your_passwd_in_gmail>
port 587
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog LOG_MAIL 

# Set a default account
account default : gmail

Get the lastest source code from ubuntu server

We takes Jaunty kernel tree as an example.
You can check KernelGitGuide for the details.

local# git clone git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git

Prepare your public tree

If you have an account on zinc.ubuntu.com, you can public your commit with it.
Prepare your git tree on zinc.ubuntu.com

      * access into zinc.ubuntu.com *
zinc# git clone -l -n -s /srv/kernel.ubuntu.com/git/ubuntu/ubuntu-jaunty.git
zinc# vi ubuntu-jaunty/.git/description # Give a short description of your tree
zinc# mv ubuntu-jaunty/.git /srv/kernel.ubuntu.com/git/<your_id_on_zinc>/my-jaunty.git
zinc# rmdir ubuntu-jaunty

Setup a remote on your local tree

local# git remote add zinc \
git+ssh://zinc.ubuntu.com/srv/kernel.ubuntu.com/git/<your_id_on_zinc>/my-jaunty.git

Working with your local tree

local# git checkout -b new_branch_1
       * Working with codes *

Commit changes

local# git commit -s -F debian/commit-templates/sauce-patch <files_modified>

Sending your patch to mail list

Prepare your patch file

local# git format-patch -1 --cover-letter
local# vi 0000-cover-letter.patch # Modify the summary and subject and From
local# vi 0001-xxxxxx.patch .... # Modify anything here

Send to mail list

local# git send-email \
           --no-chain-reply-to \
           --thread
           --suppress-cc all
           --smtp-server /usr/bin/msmtp
           --from <your_email_address>
           --to kernel-team@lists.ubuntu.com
           ./0000-cover-letter.patch
local# git send-email \
           --no-chain-reply-to \
           --thread
           --suppress-cc all
           --smtp-server /usr/bin/msmtp
           --from <your_email_address>
           --to kernel-team@lists.ubuntu.com
           ./0001-xxxxxx.patch

Send the request-pull to mailing list

Push your change to your git tree on zinc

local# git push zinc new_branch_1

Generate your request-pull summary

local# git request-pull \
           <lastest SHA before your commit> \
           git://kernel.ubuntu.com/<your_id_on_zinc/my-jaunty.git \
           > new_branch_1-request-pull.txt

Send the summary to mail list

local# git send-email \
           --no-chain-reply-to \
           --thread
           --suppress-cc all
           --smtp-server /usr/bin/msmtp
           --from <your_email_address>
           --to kernel-team@lists.ubuntu.com
           ./new_branch_1-request_pull.txt