[NBLUG/talk] An different kind of initrd

Lincoln Peters sampln at sbcglobal.net
Sun Sep 26 13:13:33 PDT 2004


Since I didn't get any responses on my query about using a USB mass
storage device as a root filesystem, I'm guessing that I've encountered
an issue that few (if any) Linux users have met before, and so I've
tried to improvise.  My goal now is to build a special initrd that will
wait for the USB mass storage device to come online, then mount it and
boot from it.

After several minutes of searching Google for information on building an
initrd, I have only found information applicable to building an initrd
for the purpose of booting a system that requires so many drivers that
they cannot fit in one kernel.  In my case, however, I only need an
initrd so that I can run a home-made C program which will mount the
device as soon as the usb-storage driver detects it, run a pivot_root to
make it the root filesystem, and turn over control of the system to
init.  Only the kernel documentation seems to address this, and it seems
a bit vague.

What I want to do seems simple enough; I should be able to compile this
C program statically, place it in the initrd with the name "linuxrc",
and change the contents of syslinux.cfg as follows:

default linux initrd=initrd root=/dev/ram0 init=/linuxrc

However, when I tried to do this, the bootloader failed to recognize the
presence of an initrd, tried to mount the root filesystem (which wasn't
available since the initrd was not run), and when it failed to mount the
root filesystem, it panicked.

I'm sure that, whatever the problem is, it is *not* the program I wrote,
as the boot process doesn't get that far.  But what am I doing wrong?

---
Lincoln Peters
<sampln at sbcglobal.net>

"Gee, Toto, I don't think we are in Kansas anymore."





More information about the talk mailing list