Monday, May 09, 2005


More cryptic notes-to-self

Mike at work is loading Gentoo. He didn't want to use genkernel to build the kernel and started with a clean .config. We ran in to some interesting roadblocks when trying to get an initrd to work. This crap is barely documented anywhere so here's my notes.

initrd has two direct prerequisites in the kernel - ext2 (file system) and ramdisk support (block device). Ramdisk support must be compiled with the enable initrd support option (this sounds dumb, but it got me).

mkinitrd checks modules.conf for any scsi_hostadapter modules, which are automatically added. It would be wise to ensure these modules were enabled in the .config.

To mount an initrd to peek in to the linuxrc:

# cp /boot/initrd-blah-blah.img /tmp
# mv /tmp/initrd-blah.img /tmp/initrd.gz # for simplicity
# gunzip /tmp/initrd.gz
# mount -o loop /tmp/initrd /some/mount

The gentoo mkinitrd wanted to change /proc/sys/kernel/real-root-dev. In order for that to work, I think the kernel needs sysctl support enabled (general setting).

Finally, there was a failure when nash tried pivot_root - it pivots the current root to /initrd on the real root. That directory didn't exist. Also, for some reason passing root=/dev/sda3 didn't work. root=0803 (device major/minor id for sda2) did. Still haven't tracked that one down.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?