Applying kernel patches

Support knowledgebase (kernelpatch)
Applies to

SuSE Linux: All versions

Question:

How do I patch the kernel?

Answer:

In the following example we want to patch the kernel 2.0.28 to 2.0.29. A necessary precondition is of course the availability of both the 2.0.28 source tree and the 2.0.29 patch. Change into the directory /usr/src/linux-2.0.28. For a compressed patch, enter the following command :
        cd /usr/src/linux-2.0.28
        zcat /tmp/patch-2.0.29.gz | patch -p1 2> out
The same procedure can be used when applying SuSE patches from ftp.suse.com. E.g.
        cd /usr/src/linux-2.0.33
        zcat /tmp/suse-2.0.33.gz | patch -p1 2> out

In both cases you should check the file "out" for error messages.

Accordingly the command for an uncompressed patch is

        patch -p1 < /tmp/patch-2.0.29 2> out
The parameter -p is very important! It specifies how many elements of the path, from which the patch was made, should be removed. If you are e.g. in the directory /usr/src, then you could simply use -p0 as parameter. However usually several kernel versions are available at the same time. Therefore it is highly recommended to change into the desired directory and to apply the patch with the switch -p1. This ensures, that the right source tree is being patched. Please read the man page for patch for further information.

If you would like to patch a kernel 2.0.0 to 2.0.29, then you must apply all patches from patch-2.0.1.gz until patch-2.0.29.gz one after the other!

After having applied the patches, you must configure, compile and install the kernel. This is described in the kernel chapter of the handbook. Don't forget the modules !


Keywords: KERNEL, PATCH

Categories: Kernel

SDB-kernelpatch, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 25. Mär 1997
SuSE Linux AG - Last generated: 07. Mai 2002 by sdb (sdb_gen 1.40.0)