LPIC2 -- Patching a Kernel
Applying a Kernel Patch
Instead of downloading an entirely new kernel a patch can be applied to an older kernels source files. These patch files can be downloaded from kernel.org. Lets say that you are using the 2.6.17 kernel and version 2.6.17.1 is released. You should have version 2.6.17 extracted to the /usr/src directory. Now you can download 2.6.17.1 patch to /usr/src/linux and extract the file if compressed.bzip2 and bzip2
There are two major compression programs in Linux, gzip and bzip2. Of the two bzip2 is the newest and generally used more often than gzip. The gz extension is used for gzip files and bz2 is used for bzip2. For example for the file patch-2.6.17.1.bz2 use the command:
bzip2 -d patch-2.6.17.1.bz2
or
gzip -d patch-2.6.17.1.gz
For files compressed with gzip.
The Patch Command
Once you have decompressed the patch file it is a simple matter to apply it. Just change to the /usr/src/linux directory and run the following command.
patch -p1 < patch-2.6.17.1
An important point to know about patching is that they must be applied in order. For example, you need to upgrade from 2.6.17 to 2.6.17.3. To do this apply patch 2.6.17.1 then 2.6.17.2 and finally 2.6.17.3. If you go out of order you will get errors and the process will fail.
»
- Login to post comments
