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.
- Get the latest kernel patches from
- Save or move them to the directory where the source of your kernel is located.
#mv /tmp/patch*.gz /root/kernel_2.4.x
- 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)
- First, decompress the patch using either bzip2 or gzip -depending on the type of compression used.
# bzip2 -d patch-2.4.20.bz2
or for gzip:
# gunzip patch-2.4.20.gz
- Second, apply the patch to the kernel source. (at same directory level as linux/)
# patch --directory=linux/ -p1 < patch-2.4.20
- The third and final step is to recompile the kernel.