Patching the Kernel

 < Day Day Up > 

Another common kernel-related task is patching the kernel. You may need to patch the kernel for a variety of reasons. With patches, you can load a device driver, install and upgrade the kernel, fix a bug, add new features, improve performance, and so on. You take your existing kernel to the next minor release with patches as well. www.kernel.org/pub/linux/kernel has directories under it containing patches for most kernel releases. The v2.5 directory has patches for version 2.5.

You normally work in the /usr/src/linux directory when performing any kernel work. After moving to this directory, you would apply a patch with the following command:

 # patch -pnum < patch_file 

In this example, the num has to do with the number of slashes in the path of the name found in the patch file. A 0 will strip away no slashes, a 1 will strip away the first slash, and so on. I normally us a 0 for a patch downloaded from www.kernel.org.

After you run patch, a large number of messages will stream by. If you have no errors, you can perform your make dep; make clean; make bzImage; make module and any other configuration and clean up work. When you're done, your patch is installed.

     < Day Day Up > 


    Linux on HP Integrity Servers. A System Administrator's Guide
    Linux on HP Integrity Servers: A System Administrators Guide
    ISBN: 0131400002
    EAN: 2147483647
    Year: 2004
    Pages: 100

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