Using Nigel's Git Tree

Now that Nigel has a git tree at kernel.org, integrating his patches into a current kernel is easier than it used to be. In this quick howto we'll set up a git tree, add Nigel's patches, and then revert back to the upstream tree in order to minimize down-the-road harmonization issues.

Setting up a git tree

We'll use git-core and cogito to set up a git repository. First, install these packages. On debian-based distros, this is just:

 apt-get install git-core cogito 

Now create the repository:

mkdir src
cd src
cg-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git kernel-source 
cd kernel-source

Adding Nigel's Tree as a Branch

Now we create a new distal branch and a new local branch, and sync the local branch to linus's tree first, and to nigel's second:

cg-branch-add suspend2 git://git.kernel.org/pub/scm/linux/kernel/git/nigelc/suspend2-head.git
cat > .git/remotes/suspend2
URL: git://git.kernel.org/pub/scm/linux/kernel/git/nigelc/suspend2-head.git
Pull: refs/heads/suspend2:refs/heads/suspend2
^D
cg-switch -l -r origin linus-suspend2
cg-update origin
cg-update suspend2

cg-branch add creates a remote branch "suspend2"; the" cat > " command tells git how to pull Nigel's sources; cg-switch creates and switches us into a new local branch based on linus's tree; cg-update fetches and merges the two upstream sources.

We can clean up and make things a bit tighter by adding the following commands:

git fsck-objects
git prune
git count-objects
git repack -a -l -d
git prune-packed

Anyway I think that's what they do; those are the instructions Nigel gave me anyway.

Compiling the Kernel

Now it's time to build the new kernel; follow the HOWTO. On debian just do:

make menuconfig
make-kpkg --initrd --append-to-version=-suspend2  --rootcmd fakeroot kernel-image kernel-headers

Preparing for your next update

Because Nigel uses "Stacked Git" his source tree is incomplete and it's inadvisable to keep the modified branch just lying around. The following commands ought to revert your tree to tracking just Linus'. You shouldn't do this in between every kernel build, as it will essentially "make clean" you kernel tree and thus increase the length of the next build. So do this only when you want to updateto a newer kernel:

cg-clean -D -x
cg-reset # should this be cg-reset --adds-removes?  I don't know  

Hopefully you are now ready to pull from both Linus' and Nigel's trees again as per the above.

None: GitTreeInstructions (last edited 2007-03-27 03:01:06 by BernardBlackham)