Kernel-package

Upgrading the kernel in Debian:

It is sometimes necessary (and always(?) preferable) to have a tailor-made kernel. The Debian package kernel-package offers special tools for producing a kernel-image-package that can be installed and administrated like any other Debian package. Once kernel-package is installed, complete instructions can be found in /usr/doc/kernel-package. In summary, the whole procedure becomes:
  1. Install kernel-package, kernel-source-2.0.36, and bin86 by (assuming apt is used)
    	apt-get install kernel-package kernel-source-2.0.36 bin86
  2. Unpack the kernel-source by
    	cd /usr/src
    	tar xzf kernel-source-2.0.36.tar.gz 
    	rm linux
    	ln -s kernel-source-2.0.36 linux 
  3. Configure the kernel (optimally by re-using an existing .config file that reflects the hardware correctly) by
    	cd /usr/src/linux
    	make xconfig 
    (Hint: Logging in as root through ssh root@... obviates exporting the DISPLAY variable and such things.)
  4. Compile and build the custom kernel package by
    	make-kpkg clean
    	make-kpkg --revision=`hostname`.1.0 kernel_image 
    where 1.0 is a revision number that should be increased if all this is repeated for whatever reason.
  5. Install by
    	dpkg -i /usr/src/kernel-image-2.0.36_`hostname`.1.0_i386.deb 
    This installs the new kernel and the System map in the /boot directory, any modules in /lib/modules, and reruns lilo. If there is already a kernel 2.0.36 installed, its modules should be saved by e.g. mv /lib/modules/2.0.36 /lib/modules/2.0.36.bak before installing the new one.
  6. Reboot, preferably after verifying that /etc/lilo.conf makes sense. (Hint: If in doubt, the old working kernel can be used for a boot floppy by simply copying cp /vmlinuz.old /dev/fd0 .)

Anton Rebhan <rebhana@tph.tuwien.ac.at>
Page last modified: April 7, 1999