Building new kernel 2.4.20 in Debian

An Article

in Oreilly Network writes that there is a kernel problem in Linux that expose
denial-of-service attack. That recalled me to upgrade Linux kernel on my
Debian box. But first, it seemed to me that the kernel-source package may
not be available very soon. I took some steps in order to find the source package
and install it.

First, I go to Debian Packages

page to search for "kernel-source" for all distribution and there are
many source package there. There is a 2.4.20-7 revision for 2.4.20 kernel.
I check the diff attached in the page and find if the "ioperm" problem was
fixed. I could locate one, but I am not sure. Anyway I was going to download it.

But since this package is in unstable distribution, I will need extra steps in order
to get it through apt-get. I modified /etc/apt/source.list and have a line added:

  • deb http://ftp.hk.debian.org/debian unstable main contrib non-free

at the first of the file and have the line:.

  • deb http://ftp.hk.debian.org/debian/ stable main non-free contrib

commented with "#". Running apt-get update again and have all package information
synchronized to unstable distribution and issue a command
"apt-get install kernel-source-2.4.20" to install the source package.
The Debian-patched 2.4.20 kernel source will be downloaded and extracted to /usr/src.
I carried out the following steps to complete installation.

  • tar --bzip2 -xvf kernel-source-2.4.20.tar.bz2
  • cd kernel-source-2.4.20
  • cp /boot/config-2.4.19-386 .config
  • make menuconfig
  • make-kpkg clean
  • make-kpkg --revision=custom.1 kernel_image
  • cd ..
  • dpkg -i kernel-image-2.4.20_custom.1_i386.deb

Please noted that /boot/config-2.4.19-386 is the kernel configuration file punknix
currently runs. I just copy it to .20 kernel and those new kernel configuration
will be used with default value. After installation, the LILO configuration will also
be altered pointing to new kernel. I then reboot the server and have a new kernel
runs!