Building A Kernel .deb Package [Debian Etch]
Download latest kernel from www.Kernel.org
[make sure gcc, kernel-package, fakeroot, libncurses5-dev, automake, initrd-tools --are already installed]
then extract & copy to /usr/src/
then create a link
Eg:
#ln -s linux-2.6.24 linux
#make clean
#make clean
#make mrproper
#cp /boot/config-’uname-r’ ./.config
here ‘uname-r’ means — your present working kernel
#make menuconfig
which brings up the kernel configuration menu. Below the menu select ‘load an Alternate Configuration File‘ and choose .config (which contains the configuration of your current working kernel) as the configuration file:
Then browse through the kernel configuration menu and make your choices. When you are finished — select Exit, answer the following question (Do you wish to save your new kernel configuration?) with Yes:
To build the kernel, execute these commands:
#make-kpkg clean
#fakeroot make-kpkg –initrd –append-to-version=-2.6.24
After –append-to-version= you can write any string that helps you identify the kernel, but it must begin with a minus (-) and must not contain whitespace.
Now be patient, the kernel compilation can take some hours, depending on your kernel configuration and your processor speed.
After the successful kernel build, you can find two .deb packages in the /usr/src directory.
Eg:
linux-image-2.6.24_2.6.24-10.00.Custum_i386.deb
linux-headers-2.6.24_2.6.24-10.00.Custum_i386.deb
install this
#dpkg -i linux-image-2.6.24_2.6.24-10.00.Custum_i386.deb
#dpkg -i linux-headers-2.6.24_2.6.24-10.00.Custum_i386.deb
(You can now even transfer the two .deb files to other Debian Etch systems and install them there exactly the same way, which means you don’t have to compile the kernel there again.)
That’s it. The GRUB bootloader configuration file /boot/grub/menu.lst has been modified automatically, and a ramdisk for the new kernel has been create in /boot.