\subchapter{Kernel sources}{Objective: Learn how to get the kernel
  sources and patch them.}

After this lab, you will be able to:
\begin{itemize}
\item Get the kernel sources from the official location
\item Apply kernel patches
\end{itemize}

\section{Setup}

Go to the \code{/home/<user>/felabs/sysdev/kernel} directory.

\section{Get the sources}

Go to the Linux kernel web site (\url{http://www.kernel.org/}) and
identify the latest stable version.

Just to make sure you know how to do it, check the version of the
Linux kernel running on your machine.

We will use \code{linux-3.2.x}, which this lab was tested with.

To practice the patch command later, download the full 3.1
sources. Unpack the archive, which creates a \code{linux-3.1}
directory. Remember that you can use \code{wget <URL>} on the command
line to download files.

\section{Apply patches}

Install the \code{patch} command, either through the graphical package
manager, or using the following command line:

\begin{verbatim}
sudo apt-get install patch
\end{verbatim}

Download the 2 patch files corresponding to the latest 3.2 stable
release: a first patch to move from 3.1 to 3.2 and a second patch to
move from 3.2 to 3.2.x.

Without uncompressing them (!), apply the 2 patches to the Linux
source directory.

View one of the 2 patch files with vi or gvim (if you prefer a
graphical editor), to understand the information carried by such a
file. How are described added or removed files?

Rename the \code{linux-3.1} directory to \code{linux-3.2.<x>}.
