BACK

Patching a Kernel 2

This page is an update to the original kernel patching page.  This update is necessary as the procedures outlined on the original page were inaccurate for applying patches after version 2.4.18.

  1. Get the latest kernel patches from ftp.kernel.org/pub/linux/kernel/v2.4/.
  2. Save or move them to the directory where the source of your kernel is located.
       #mv /tmp/patch*.gz /root/kernel_2.4.x
  3. The steps in applying a patch are: decompress the patch, apply the patch, and recompile the kernel source.  In this example, the kernel is version 2.4.16 and has been patched up to version 2.4.19; the 2.4.20 patch will be applied in the following steps. (This patching procedure must also be used for applying version 2.4.19 patches)
    1. First, decompress the patch using either bzip2 or gzip -depending on the type of compression used.
    2. for bzip2:
         # bzip2 -d patch-2.4.20.bz2
      or for gzip:
         # gunzip patch-2.4.20.gz
    3. Second, apply the patch to the kernel source.  (at same directory level as linux/)
    4.     # patch --directory=linux/ -p1 < patch-2.4.20
    5. The third and final step is to recompile the kernel.
BACK