Tarballs and Patches

One drawback to using Red Hat kernel RPMs is that they may not incorporate the very latest features into the latest kernel. If you need the absolute latest kernel, you re probably going to have to download and process a tarball package. More information on the tar command is available in Chapter 14 ; we ll go through the process step by step here.

Download Sources

The Linux kernel is under constant development. As new features emerge, a loose team of volunteers headed informally by Linus Torvalds decides when new kernels are ready for test and production release. You can download their work from the kernel.org Internet sites. If you can t get to www.kernel.org or ftp.kernel.org , you can select from mirror websites all over the world, as listed in www.kernel.org/mirrors .

I ve demonstrated a download of Linux kernel 2.4.20 from zeus-pub.kernel.org in Figure 12.4. This particular package is large; at around 33MB, it might take a few hours to download on a regular telephone modem.

click to expand
Figure 12.4: Downloading a kernel tarball

Setup

Now that you ve downloaded the kernel tarball package, the setup process is easy. The package that you ve downloaded should have a name similar to linux- x .tar.gz . With that in mind, follow these steps:

  1. Copy the kernel tarball package to the /usr/src directory. For example, if the package is in the current directory, run the following command:

     # cp linux-  x  .tar.gz /usr/src 
  2. Navigate to /usr/src and unpack the tarball. The following commands should open up a large number of files in the /usr/src/linux- x directory:

     # cd /usr/src # tar xzvf linux-  x  .tar.gz 
  3. Navigate to the /usr/src/linux- x directory. Later in this chapter, you ll learn how to open and use a Linux kernel configuration menu. You ll then compile and install your new kernel.

The Patch Alternative

Installing and compiling a new kernel may seem like a lot of trouble, just to upgrade for the latest changes. Let s assume your computer has Linux kernel 2.4.20 installed. If you just want to incorporate the new security features available in Linux kernel 2.4.21, there is an alternative: you can install a kernel patch.

Note  

We assume that you ve already installed the source code for the current kernel via the kernel-source-* RPM. The other required RPM packages are described later in this chapter, in Table 12.3 .

You can download kernel patches from the kernel.org Internet or mirror sites described earlier. As of this writing, they re available from the same directories as regular kernels, with a simple name: patch- x .gz .

Once you ve downloaded the patch, copy it to the /usr/src directory. Then you can upgrade your kernel with the following command:

 # zcat patch-  x  .gz  patch -p0 

This command reads from the compressed patch file, identifies the differences with the current Linux kernel s source code, and updates files as needed. If there are problems, they re documented in *.rej files in your kernel source directory, /usr/src/linux- x .

Note  

Patches don t always work well with Linux kernels built by Red Hat; Red Hat may have already incorporated some of the contents of the patch, leading to errors during the upgrade process.

You can then customize, compile, and install your patched kernel as described later in this chapter.

 


Mastering Red Hat Linux 9
Building Tablet PC Applications (Pro-Developer)
ISBN: 078214179X
EAN: 2147483647
Year: 2005
Pages: 220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net