+----------------------------------------------------------+ | Debian Kernel compilation | | | | Tutorial by Philip Iezzi | | based on: | | http://newbiedoc.sourceforge.net/system/kernel-pkg.html | | | | changed on 2004-03-06 | +----------------------------------------------------------+ sample commands are based on a new 2.4.25 Kernel while 2.4.xx stands for the old kernel. You can get it from a mirror, for Switzerland, e.g. Switch: ftp://sunsite.cnlab-switch.ch/mirror/debian/pool/main/k/kernel-source-2.4.25/kernel-source-2.4.25_2.4.25-1_all.deb packages you definitely need: ----------------------------- libncurses5-dev kernel-package (contains make-kpkg) $> dpkg -i kernel-source-2.4.25_2.4.25-1_all.deb $> cd /usr/src $> tar -jxf kernel-source-2.4.25.tar.bz2 $> rm linux $> ln -s kernel-source-2.4.25 linux $> cd linux $> make menuconfig (load old config from /boot/config-2.4.xx, "Load an Alternate Configuration File") COMPILATION: I'm using --append-to-version to identify the kernel. 040305 is a shorthand for "2004 March 05". I did not use the --revision option of make-kpkg as I don't care about debian package version. Defaults to "10.00.Custom". If you want, you could add e.g. --revision="custom.foo.bar.1.1" ----------------------------------------------------- $> make-kpkg clean $> make-kpkg --append-to-version=.040305 kernel_image or (all in one line with a nice logfile, running in background): $> make-kpkg clean && make-kpkg --append-to-version=.040305 kernel_image > COMPILE.LOG 2>&1 & ----------------------------------------------------- this is usually not required: $> make-kpkg --append-to-version=.040305 modules_image ----------------------------------------------------- $> cd .. $> dpkg -i kernel-image-2.4.25.040305_10.00.Custom_i386.deb LILO configuration: If you use a separate partition for /boot, better use your own symlinks inside /boot instead of the default one's in / sample configuration... --------------------------------- /etc/lilo.conf --------------------------------- default=Linux image=/boot/vmlinuz label=Linux read-only image=/boot/vmlinuz.old label=LinuxOLD read-only optional image=/boot/vmlinuz.test label=LinuxTEST read-only optional --------------------------------- $> cd /boot $> rm vmlinuz.old $> ln -s vmlinuz-2.4.xx vmlinuz.old $> rm vmlinuz.test $> ln -s vmlinuz-2.4.25.040305 vmlinuz.test (currently keep the link vmlinuz->vmlinuz-2.4.xx) To test the kernel, first run: $> lilo $> lilo -R LinuxTEST $> reboot Then test it for a week or so and finally set it as default kernel: $> cd /boot $> rm vmlinuz $> ln -s vmlinuz-2.4.25.040305 vmlinuz $> lilo $> reboot if you don't believe anything is new... $> uname -a We're all done! Get a beer and relax... And wait for the next kernel panic! :)