KernelSimpleGuide

Differences between revisions 2 and 7 (spanning 5 versions)
Revision 2 as of 2009-03-27 13:56:37
Size: 3724
Editor: 210
Comment:
Revision 7 as of 2010-11-05 19:50:01
Size: 4942
Editor: 12
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from KernelSimpleGuide
Line 6: Line 7:
Install necessary packages. Install necessary packages. you can install more packages you need.
Line 18: Line 19:
Setup msmtp, we take gmail account as an example. Setup msmtp, we take gmail account as an example. You shall check with your ISP or email service provider for the details.
Line 42: Line 43:
We takes Jaunty kernel tree as an example.<<BR>>
You can check KernelGitGuide for the details.
We takes Jaunty kernel tree as an example. You can check KernelTeam/KernelGitGuide for the details.
Line 48: Line 48:
If you want to work on different ubuntu kernel tree, you can clone linux kernel mainline as reference, that will reduce the download for saving your time.
{{{
local# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
local# git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git
local# git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-intrepid.git
}}}
Line 49: Line 56:
If you have an account on zinc.ubuntu.com, you can public your commit with it.<<BR>> You can public your commit with any git server. So that the kernel maintainer could easily have your commit with your git server.<<BR>><<BR>>
''If you do not have a zinc account, please skip this section.''<<BR>><<BR>>
We use zinc.ubuntu.com as an example.<<BR>>
Line 53: Line 62:
zinc# git clone -l -n -s /srv/kernel.ubuntu.com/git/ubuntu/ubuntu-jaunty.git zinc# git clone --bare -l -n -s /srv/kernel.ubuntu.com/git/ubuntu/ubuntu-jaunty.git
Line 58: Line 67:
Setup a remote on your local tree Setup a remote on your local tree, so you can push the commit on your local laptop to zinc
Line 72: Line 81:
local# git commit -s -F debian/commit-templates/sauce-patch <files_modified> local# git commit -s -e -F debian/commit-templates/patch <files_modified>
Line 74: Line 83:
We have several commit message templates in debian/commit-templates. You shall choose them according to your modify.
Line 103: Line 113:
=== Push your change to your git tree on zinc === === Push your changes to your git tree on zinc ===
Line 107: Line 117:
So that everyone could easily have your changes. Kernel tree maintainers could easily pull changes from your public git tree to the mainline.
Line 111: Line 122:
           git://kernel.ubuntu.com/<your_id_on_zinc/my-jaunty.git \            git://kernel.ubuntu.com/<your_id_on_zinc>/my-jaunty.git \
Line 114: Line 125:
The request-pull messages tells kernel tree maintainers where they can pull your changes, and summary of the changes

Prepare your environment

Install and setup necessary packages

Install necessary packages. you can install more packages you need.

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. You shall check with your ISP or email service provider for the details.

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 KernelTeam/KernelGitGuide for the details.

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

If you want to work on different ubuntu kernel tree, you can clone linux kernel mainline as reference, that will reduce the download for saving your time.

local# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
local# git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git
local# git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-intrepid.git

Prepare your public tree

You can public your commit with any git server. So that the kernel maintainer could easily have your commit with your git server.

If you do not have a zinc account, please skip this section.

We use zinc.ubuntu.com as an example.
Prepare your git tree on zinc.ubuntu.com

      * access into zinc.ubuntu.com *
zinc# git clone --bare -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, so you can push the commit on your local laptop to zinc

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 -e -F debian/commit-templates/patch <files_modified>

We have several commit message templates in debian/commit-templates. You shall choose them according to your modify.

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 changes to your git tree on zinc

local# git push zinc new_branch_1

So that everyone could easily have your changes. Kernel tree maintainers could easily pull changes from your public git tree to the mainline.

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

The request-pull messages tells kernel tree maintainers where they can pull your changes, and summary of the changes

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

KernelTeam/KernelSimpleGuide (last edited 2010-11-05 19:50:01 by 12)