Using a stock kernel.org kernel on Fedora Core 5

May 6, 2006

If you like initrds, the stock Linux kernels from kernel.org should just compile and work. Install the kernel-devel RPM, copy the .config from /usr/src/kernels/<ver> to your source tree to duplicate the normal Fedora Core kernel configuration, make oldconfig, and go.

I don't like initrds, though. So one of the usual benefits of compiling my own kernel is not needing one, so there's one fewer moving part in my system environment. Unfortunately, Fedora Core 5 uses udev, which introduces a problem: the normal initrd is what creates /dev. No initrd, no /dev/console, and your kernel reports:

Warning: unable to open an initial console.

Usually things blow up shortly afterward. (You're also missing /dev/zero and /dev/null, which doesn't help.)

One way around this is to populate a basic /dev on the root filesystem. To get around the chicken and egg problem that FC5 boots with something mounted on top of /dev, you can use the NFS trick I mentioned yesterday.

The simpler way out is just to make an initrd anyways, despite theoretically not needing one. mkinitrd is happy to set you up with a basic initrd that just does the necessary magic to create /dev and switch into the real root filesystem and so on. As a bonus, this initrd is kernel agnostic: you can use it for any kernel version (making it slightly more palatable).

It looks somewhat like the resulting 'generic' initrd does know what your root filesystem is. Unfortunately the nash manual page and the actual init script buried in the initrd disagree with each other, so I'm not entirely sure.

Since I was in a rush yesterday, I opted to hold my nose a bit and use the initrd approach. Thus, unfortunately, I have no idea what additional steps making a real /dev may require; caveat emptor.

Sidebar: inspecting initrds

Fedora Core 5 initrds are gzip'd cpio archives. cpio -tv will list the contents; cpio -id will extract them (into the current directory). /init is the magic script that does all the work.

I will reluctantly concede that this is more convenient than the old approach of gziped filesystem images.

Written on 06 May 2006.
« Link: Readable colour text combinations
Weekly spam summary on May 6th, 2006 »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sat May 6 03:07:53 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.