+-------------------------------------------------+ | Vanilla Stock Kernel compilation | | (tested on Debian Woody) | | | | Tutorial by Philip Iezzi | | changed on 2003-12-09 | | 2003-01-06 | | 2004-03-05 | +-------------------------------------------------+ notes: 2.4.xx stands for the new kernel 2.4.yy stands for the old running kernel packages you definitely need: ------------------------------ libncurses5-dev 1) get kernel, unzip sources in /usr/src ---------------------------------------- Get the full package from kernel.org, where it says "F": $> wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.xx.tar.bz2 $> tar -jxf linux-2.4.xx.tar.bz2 (or, if you like it more complex:) $> bzip2 -cd linux-2.4.xx.tar.bz2 | tar xf - 2) symbolic link in /usr/src ---------------------------- $> ln -s linux-2.4.xx linux.vanilla # only if e.g. ac-patch requires this! $> ln -s linux-2.4.xx linux 3) [optional] apply kernel patches ---------------------------------- e.g.: $> patch -p0 cd /usr/src/linux $> make menuconfig (make xconfig) Load the current configuration from /boot/config-2.4.yy ("Load an alternate configuration file") Change some settings, if required, e.g.: - APM-support - grsecurity level (only avail. if patched by grsecurity) - quota-support - loopback device - ext3 - ... $> diff /boot/config-2.4.yy /usr/src/linux/.config edit .config by hand, if you miss something, e.g.: < # CONFIG_BLK_DEV_ATARAID is not set < # CONFIG_BLK_DEV_ATARAID_PDC is not set < # CONFIG_BLK_DEV_ATARAID_HPT is not set --- > CONFIG_BLK_DEV_ATARAID=y > CONFIG_BLK_DEV_ATARAID_PDC=y > CONFIG_BLK_DEV_ATARAID_HPT=y 6) Compilation -------------- cd /usr/src/linux $> make dep $> make clean $> make bzImage $> make modules $> make modules_install or, alltogether (in background with stdout/stderr output logging): -------------- $> make dep clean bzImage modules modules_install > COMPILE_OUTP_2.4.xx 2>&1 & $> cp -a ./arch/i386/boot/bzImage /boot/vmlinuz-2.4.xx $> cp -a System.map /boot/System.map-2.4.xx 7) LILO ------- 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.yy vmlinuz.old $> rm vmlinuz.test $> ln -s vmlinuz-2.4.xx vmlinuz.test (currently keep the link vmlinuz->vmlinuz-2.4.yy) 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.xx 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! :) ---------------------------------------------------------- --------------------- DONE! -------------------------- ---------------------------------------------------------- additional information: ---------------------------------------------------------- GRSECURITY PATCH http://www.grsecurity.net/ ---------------------------------------------------------- ---------------------------------------------------------- wrong/missing modules --> recompile ---------------------------------------------------------- make menuconfig make modules make modules_install modconf (--> load module) ---------------------------------------------------------- messed up modules, versions (unresolved symbol errors) http://msgs.securepoint.com/cgi-bin/get/netfilter-0203/315/1.html ---------------------------------------------------------- edit Makefile and set EXTRAVERSION = ... mv .config .. (<- move avay .config as this gets deleted with make mrproper) make mrproper mv ../.config . make oldconfig [make dep clean ...] ---------------------------------------------------------- Von:news user (news@sisyphus.news.be.easynet.net) Betrifft:Re: kernel 2.4 debian woddy 3.0 Newsgroups:fr.comp.os.linux.configuration View: Complete Thread (4 articles) Datum:2002-09-01 10:01:03 PST ---------------------------------------------------------- apt-get install kernel-source-2.4.19 libncurses5-dev cd /usr/src bunzip kernel-source-2.4.19.bz2 tar xvf kernel-source-2.4.19.tar cd /usr/src/kernel-source-2.4.19 make menuconfig *la tu config ton noyau, tu quittes et tu sauves* make dep clean bzImage modules modules_install cp /usr/src/kernel-source-2.4.19/arch/i386/boot/bzimage /boot/vmlinuz-2.4.19 cp /usr/src/kernel-source-2.4.19/System.map /boot/System.map-2.4.19 rm /vmlinuz ln -s /boot/vmlinuz-2.4.19 vmlinuz vi /etc/lilo.conf *tu fais les modifications nécessaires dans ce fichiern, tu quittes et tu sauves * lilo et voila :) Debian propose aussi un utilitaire très pratique mais que je n'aime pas trop : make-kpkg qui fait un .deb de ton kernel et qu'ensuite il faut installe avec dpkg -i kernel-REVISION.deb. Voire man make-kpkg à ce sujet ...