Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp02.tex V2 - 09/04/2008 6:09pm Page 1165

Appendix B: Working with the Source Code


Patches are applied with the help of thepatchtool, which is not especially difficult to handle. The fol-
lowing statement updates the kernel sources in/home/wolfgang/linux-2.6.23from version 2.6.23 to
version 2.6.24:

wolfgang@meitner>cd /home/wolfgang
wolfgang@meitner>bzcat patch-2.6.24.bz2 | patch -p0

patchcan not only apply patches but alsoremovethem. This is an extremely useful feature when trou-
bleshooting because modifications can be selectively removed from the sources until a particular error
no longer occurs. This at least isolates the modification that gave rise to the error.^8 The-Roption must
be specified to ‘‘reverse‘‘ the patch. The following example reverses the kernel sources of version 2.6.24
back to version 2.6.23 by removing the preceding patch:

wolfgang@meitner>bzcat patch-2.6.24.bz2 | patch -R -p0

patchprovides many other options, which are documented in detail on thepatch(1)man page.

B.4.3 Git


Git is a relatively novel version control system on which the Linux kernel development model is based. A
large group of developers spread throughout the world are cooperating on a software product although
they are not in direct personal contact. They are working not with a central repository, on which classical
systems such as CVS build, but with a large number of subtrees that are synchronized with each other at
intervals in order to swap changes.

The first proper version control system employed by the kernel community was BitKeeper. However,
Linus Torvalds himself launched the development of an alternative tool because it was no longer possi-
ble to continue using BitKeeper due to various conflicts between BitMover (the company responsible for
BitKeeper), and sections of the kernel community. The conflicts revolve around the fact that BitKeeper is
not an open-source product (and is in no way free software in the GPL sense) but is sold under propri-
etary license. BitKeeper could be used free of charge for noncommercial purposes, but this right has been
revoked by BitMover, so the kernel community had to come up with a different solution — and indeed
it did.

The solution is a completely new version control system which goes by the namegit. Git is designed as
a content tracker — it makes a kind of database layer available to enable changes to files to be archived.
Great importance is attached to the fact that necessary operations can be performed directly in the filesys-
tem with the help of regular files — no direct database back end is needed.

Git used to have a front end by the name of cogito. It was required for early versions of git to provide the
standard features of a version control system, and was easier to use than pure git. However, the former
deficiencies of git have by now been resolved, so cogito is not actively being developed anymore, and it’s
no longer required because git provides everything directly.

qgitandgitkare graphical front ends to handle git repositories. It greatly simplifies work for those
who do not use git regularly and are therefore not familiar with the numerous commands. The following
sections describe the shell commands and the graphical user interface.

(^8) Notice that git also offers possibilities to automatize the search for erroneous patches via thegit-bisecttool.

Free download pdf