How To Compile A Kernel - The Debian (Sarge) Way - Page 2
6 Build The KernelTo build the kernel, execute these two commands: make-kpkg clean Now be patient, the kernel compilation can take some hours, depending on your kernel configuration and your processor speed.
7 Install The New KernelAfter the successful kernel build, you can find your kernel .deb package in the /usr/src directory. cd /usr/src On my test system it was called linux-2.6.18.3-default1_2.6.18.3-default1_i386.deb. I install it like this: dpkg -i linux-2.6.18.3-default1_2.6.18.3-default1_i386.deb (You can now even transfer the .deb file to other Debian Sarge systems and install it there exactly the same way, which means you don't have to compile the kernel there again.)
8 Create A RamdiskNow we must create a ramdisk for our new kernel. Normally we do this with mkinitrd, but our new kernel uses udev instead of devfs, and you'll most likely get this error message with an mkinitrd generated ramdisk during boot-up: mount: unknown filesystem type 'devfs' which might lead to a kernel panic. The new way of creating ramdisks is with mkinitrd.yaird. Backports.org has a yaird package for Debian Sarge. Before we can install it, we must install two prerequisites: apt-get install libhtml-template-perl libparse-recdescent-perl Then we install yaird like this: cd /tmp (The original yaird package was located in http://backports.org/debian/pool/main/y/yaird/, but was removed in the meantime, so I've made the package available under http://downloads.howtoforge.com/files/yaird_0.0.12-8bpo1_i386.deb.) Before we can create the new ramdisk, we must edit the configuration file of our new kernel which you can find in the /boot directory (run ls -l /boot to find out). In this tutorial it's called /boot/config-2.6.18.3-default1, and in that file we must comment out the line CONFIG_DEFCONFIG_LIST (towards the beginning of the file) because otherwise mkinitrd.yaird will throw an error like this at us: yaird error: bad value in /boot/config-2.6.18.3-default1: CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" (fatal) So we do this: vi /boot/config-2.6.18.3-default1
Now we can finally create our ramdisk like this: mkinitrd.yaird -o /boot/initrd.img-2.6.18.3-default1 2.6.18.3-default1
9 Configure The GRUB Boot LoaderNow we must configure our GRUB boot loader so that our new kernels gets booted when we restart the system. This is very easy, just run update-grub You can check /boot/grub/menu.lst to see if your new kernel has been added: vi /boot/grub/menu.lst It should look like this now (you should find two stanzas for your new kernel at the top of the kernel stnazas list):
10 RebootNow reboot the system: shutdown -r now If everything goes well, it should come up with the new kernel. You can check if it's really using your new kernel by running uname -r This should display something like 2.6.18.3-default1 If the system doesn't start, restart it, and when you come to the GRUB boot loader menu, select your old kernel and start the system:
You can now try again to compile a working kernel. Don't forget to remove the two stanzas of the not-working kernel from /boot/grub/menu.lst.
11 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com





print: 
Recent comments
7 hours 16 min ago
8 hours 59 min ago
11 hours 24 min ago
11 hours 31 min ago
16 hours 4 min ago
18 hours 5 min ago
21 hours 29 min ago
23 hours 35 min ago
23 hours 46 min ago
1 day 2 hours ago