About Unix and Linux

Friday, March 24, 2006

Compiling kernel in debian

cd /usr/src/kernel-src-2.6.8
make-kpkg --rev Custom.1 kernel_image

this will create a kernel-src-2.6.8-Custom.1-386.deb. To install the kernel
dpkg --install /usr/src/kernel-src-2.6.8-Custom.1-386.deb
See that there are atleast two kernels present. One the original one which came with the distro and the new one that we have just installed. The original one can be used if the new one doesn't boot for some matter. Reboot. If the kernel doesnt boot, boot into the original kernel and then
cd /boot
mkinitrd -o initrd.img-2.6.8-386 2.6.8

add the following line in /boot/grub/menu.lst

initrd /initrd.img-2.6.8-386

just after

kernel /vmlinuz-2.6.8 root=/dev/hdaX ro

This might solve the problem. Even if there is no problem I find that having the initrd seems to help. I found that when making minor changes to drivers make-kpkg wasnt building the code and packing the modules. so I had to do a "make" before make-kpkg. Usually make-kpkg takes a long time only the first time. After that it is decently fast.

0 Comments:

Post a Comment

<< Home