Fri, 04 Nov 2005
Booting Fedora with vanilla kernel
While testing the XFS information leak I have written about yesterday, I had to compile my own kernel on the testing machine. I already knew what to do on most Fedora systems - there are some problems with vanilla kernels on Fedora:
- The vanilla kernel does not accept the symbolic root filesystem name as a boot option (so you have to use root=/dev/hda1 instead of root=LABEL=/ in your grub.conf.
- The initrd on Fedora kernels sets up basic device nodes using udev. When using vanilla kernels, it is necessary to create these nodes (/dev/null, /dev/console, and /dev/zero) on disk before the system is booted. More in the Fedora docs on udev, see the "Udev without initrd" section.
However, my test machine happened to be a plain default Fedora install, and Fedora installs itself on LVM(?). So the boot without initrd is not possible - the ramdisk is needed at least to set up LVM before the root filesystem can be mounted. This causes that another bunch of things have to be done before the vanilla kernel can be booted on Fedora on LVM:
- Obviously enough, support for initrd has to be compiled into the kernel.
- Fedora initrd image is a compressed cpio archive. I don't know whether it is supported by vanilla kernels, I have converted the image to the ext3 filesystem. However, on ext3 the image took more than 5 MB of data, while the default size of a ramdisk is 4 MB. So remember to bump up the appropriate compile-time parameter.
- Initrd on vanilla kernels start the script named /linuxrc, while Fedora's initrd stars /init. Just rename it to /linuxrc and it should work. And when you are at it, delete all calls to modprobe for drivers you have compiled into the kernel (as opposed to compiled as modules).
- The vanilla kernel does not accept the LV name as a root filesystem parameter. The major and minor numbers should be used instead (such as root=0xfe00 for major 254 and minor 0). However, the major number is registered dynamically, so the actual value depends on what drivers are compiled in and in which order they are loaded. For example, on a fresh Fedora system the LVM/DM has major number of 253, but on my own kernel it got 254 instead. This one took the most time to figure out.
I am not writing this to blame Fedora as unusable - I think their system is a step in right direction - to use new technologies "by default" instead of "on some special installation". I mean not only LVM here, but also udev, SELinux, etc. They should just document better what to do if somebody has to use a vanilla kernel on Fedora. I hope this text can help to fill up this gap.