Patching the Kernel


If you have a slow modem connection to the Internet, downloading a whole 35MB kernel may be quite a chore. As previously mentioned, the kernel mirror download directory will also have smaller patch files with only the changes since the last iteration.

Note

You need to have an installed kernel-sources package from the SUSE Linux disk (or another full version of the kernel source in /usr/src/linux) to use patch files.


In doing this, you may be trading one chore for another, however. If you are using version 2.6.1, for example, and the patch containing the module you need is version 2.6.11, you can't just apply the 2.6.11 patch file and go on your merry way. You must apply all the intermediate patch files, in the order they were released (first 2.6.2, then 2.6.3, on up to 2.6.11).

For simplicity's sake, download your patches to a /patch directory in the source tree. You will need Write privileges on the directory to do this.

If you need to patch several versions at once, as in the previous example, there is help. The patch-kernel script is located in the /usr/src/linux/scripts folder. This script applies all the necessary patches to bring your kernel up to the latest version.

Tip

Before running the patch-kernel script, back up your existing kernel source files, just in case something goes wrong.


The syntax for the patch-kernel script is

patch-kernel <source-dir> <patch-dir> stopversion 

The source directory defaults to /usr/source/linux if you don't specify it here, and the patch directory defaults to the current working directory. So if you are patching version 2.6.1 to version 2.6.10, and the patches are all in /usr/src/linux-2.6.1/patch, type this:

scripts/patch-kernel /usr/src/linux-2.6.1 /usr/src/linux-2.6.1/patch 

The script applies all the patches in the /patch directory and then creates a 2.6.10 code tree. If you're working from a clean stock kernel, you should have an error-free process. If something goes wrong, the script will create files with the patch number with a .rej extension (or just a # sign), indicating which patch failed. If this happens, you need to troubleshoot it yourself, a task for the experienced C programmer familiar with the kernel source.

Whether you have assembled the kernel from the SUSE Linux disk by downloading a full version or a patch, you are now ready to compile this new code tree.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

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