[an error occurred while processing this directive]
Linux Kernel Build Checklist
Building a kernel should not be that scary, but things do have to be done in the proper order, and you have to remember things like building and installing separate modules. Here is a quick checklist of what to do when you build a new custom kernel.
Last updated: 1 April 2002
The version of the kernel you are building is used in many places; I've labeled it "2.4.XX-VV" but you should replace this with the version of your kernel. You can change the "-VV" part (or any part) of the name by editing the variables at the begining of the kernel Makefile.
[an error occurred while processing this directive]
- Make sure /usr/src/linux is a link to the proper kernel version. Be careful when unpacking the kernel source, as it will unpack into /usr/src/linx and overwrite what is already there!
- If you are copying a previous configuration then put the config file in place as /usr/src/linux/.config
- make xconfig (or make menuconfig as you wish.)
- make dep ; make clean
- make bzImage
This makes the compressed kernel.
- cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.XX-VV
This moves the kernel to /boot.
- make modules ; make modules_install
This puts the modules in /lib/modules/2.4.XX-VV (after erasing what is already there!)
- Build any other modules not included with the kernel source package (eg. AFS, ethernet drivers, graphics card modules) and install them in /lib/modules/2.4.XX-VV in the appropriate directories. You always have to do this after make modules_install since that cleans out the modules directory.
- depmod -a 2.4.XX-VV
This creates /lib/modules/2.4.XX-VV/modules.dep
- cp System.map /boot/System.map-2.4.XX-VV
(If you are booting to multiple kernels then you want to have the version on each, and simply remove /boot/System.map, which may be recreated as a link to the current version booted.)
- cd /boot and make an initial RAM disk with the command:
mkinitrd initrd-2.4.XX-VV.img 2.4.XX-VV(If one exists you will need the -f flag to force an overwrite.)
- Edit /etc/lilo.conf to add your new kernel. It is a good idea to keep old, stable kernels around for a while and give the new one "alias=test until you have verified that it really works and tested it for a while.
Then write LILO to the MBR with the command:
lilo
- Reboot and select the "test" kernel and try it out.
- When the kernel works well enough make it the default "linux" kernel. Keep at least one older working kernel around too, just in case there are problems later on.
- Once you are sure the kernel is stable, make a new emergency boot disk with:
mkbootdisk 2.4.XX-VV