View Full Version : how to build a custom kernel / initrd for Ubuntu
butters
October 21st, 2004, 07:09 AM
I am interested in building a custom kernel for Ubuntu, as the one I'm running now tries to assign IRQ7 to both the ramdisk and Intel ICH, taking out my wireless networking and sound (even though Ubuntu perfectly recognizes and loads the modules for these devices). I took a look through the config file in /boot to check if Ubuntu has any special requirements that are different from Gentoo. Mainly its just ramdisk and initrd support (I can probably get rid of devfs since Ubuntu now uses udev).
I have no experience with building initrd images. How do I build a new initrd for my custom kernel? Is there a make initrd target? Can I boot Ubuntu without an initrd?
I have to give the Ubuntu developers some serious credit. It's not as tinker-friendly as Gentoo, but it's definately far ahead in the "90% perfect after 35 minute out-of-the-box default install" category. Its like Fedora Core but without the wretched stink of Red Hat. One minor gripe: gstreamer is simply not ready for consumption. I had to remove totem-gstreamer and install totem-xine in order to get mpeg playback to work.
triad169
October 21st, 2004, 08:57 AM
Howdy Butters,
Yes kernel is a beast (reminds me of them genkernel days). I havent messed with kernel yet in Ubuntu but it should be very similiar to Debian since it is based off debian. Just saw this nice How-to posted on PCLinux for compiling kernel in debian.
http://www.falkotimme.com/howtos/debian_kernel2.6_compile/index.php
Actually after lookinmg through the Ubuntu Wiki there is a HowTo also in there:
http://wiki.ubuntu.com/KernelCompile
So between the two you should be all set.
Triad
butters
October 21st, 2004, 01:19 PM
Oh god!! Why does Ubuntu make kernel configuration so painful? Even after doing a make mrproper on the source tree, it still insists on having tons and tons of modules enabled by default. I had to go through a keep hitting "n down" over and over again to clear out all the worthless nonsense.
Well, I still don't know how to deal with the whole initrd thing, so I just disabled ramdisk and initrd support. I assume the dpkg -i kernel-image command makes an entry in grub.conf (oops called by the deprecated menu.lst filename in Ubuntu), so I'll check that to see if it wants to have an initrd line for my new kernel, and delete it if it does.
Coming from an original love-sources tester who moved to the nitro patchset and typically compiles 2-3 kernels per week, it really disturbed me to have to slash and burn through menuconfig in order to get a reasonably trim kernel.
make help doesn't say anything about building an initrd image, but I did find some other configuration targets like make defconfig and minconfig that might make the next configuration less irritating than this one.
Since I'm not using Reiser4 anymore (sigh), I opted for a slightly more conservative kernel than my usual diet of nitro and love: plain vanilla 2.6.9 patched with 2.6.9-ck1.
It is my sincere hope that one day these forums can achieve the greatness of the Gentoo forums I love so much. First I'm going to have to work my way back into the 300+ post count...
graham
October 23rd, 2004, 05:05 AM
Oh god!! Why does Ubuntu make kernel configuration so painful? Even after doing a make mrproper on the source tree, it still insists on having tons and tons of modules enabled by default. I had to go through a keep hitting "n down" over and over again to clear out all the worthless nonsense.
I'm sure you've already thought of the obvious possibility - to make as much hardware as possible work out of the box.
First I'm going to have to work my way back into the 300+ post count...
And what will that tell us?
tareko
March 14th, 2007, 08:45 AM
The link above from the ubuntu wiki is not right. The proper link is:
https://wiki.ubuntu.com/KernelCustomBuild
tarek : )
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.