Recompiling_Ubuntu's_Kernel

Recompiling the Kernel in Ubuntu

sudo su

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

apt-get install linux-source

cd /usr/src

tar -xjf linux-source-2.6.24.tar.bz2

ln -s linux-source-2.6.24 linux

cd linux

cp /boot/config-2.6.24-generic ./.config :This will allow you to load the current kernel's configuration into the build configuration program, so you can just change what you want, without having to change everything.

make menuconfig

make-kpkg clean

fakeroot make-kpkg –initrd –append-to-version=-my-custom-kernel kernel_image kernel_headers :replacing “my-custom-kernel” with a string of your choice, used to identify the kernel (it'll show up in the kernel's name – in `uname –r` - as, for example, “2.6.24-my-custom-kernel”). This process can take a very long time, so go and do something else for an hour or so. * Change up a directory: cd .. * Install the .deb packages for both your new kernel and the headers. These .deb files can be transported to another system (with similar hardware) to save recompiling it again on that machine. To do this, run: dpkg -i linux-image-2.6.24-my-custom-kernel_2.6.24-my-custom-kernel-10.00.Custom_i386.deb :and dpkg -i linux-headers-2.6.24-my-custom-kernel_2.6.24_my-custom-kernel-10.00.Custom_i386.deb ==== Warning ==== Certain alpha builds of Ubuntu Hardy Heron (8.04) have a bug in the update-grub script that the dpkg command runs leading to an error message saying that “/var/cache/debconf/config.dat is locked by another process”. This is a known bug and has been fixed, apparently, but my workaround was to copy the /usr/sbin/update-grub script from a 7.10 Ubuntu installation into the local /usr/sbin** directory then re-running the dpkg commands above. It will warn that a directory already exists, but as it was from a failed installation just answer “no” to the prompt. ===== See Also ===== https://help.ubuntu.com/community/Kernel/Compile#Alternate Build Method: The Old-Fashioned Debian Way http://ubuntuforums.org/showpost.php?p=9638461&postcount=1488 ===== References ===== http://www.howtoforge.com/kernel_compilation_ubuntu<br> http://www.beginlinux.com/index.php/desktop_training/ubuntu/ubfile_m/ub_compile