From: joe on
How do I add block devices to my initrd-tree when building a
initrd.gz file using mkinitrd (Slackware 13.1)?

I want to setup the initrd.gz so that I can use it to mount a
USB hard drive, then subsequently boot a partition on it.

I succeeded in using mkinitrd to make a initrd.gz that (together
with lilo) allows me to boot 13.1 installed to a partition
on an IDE internal hard drive. Now I want to generalize that a
bit by doing the same with a partition on a USB external hard
drive. I thought I knew how to do this, but mkinitrd has changed,
and maybe other changes to Slackware are slowing me down also.

What I want to do isn't working. I want to put extra block devices
into the initrd-tree, then re-run mkinitrd and lilo so that those
block devices become a part of the environment that is visible after
booting with "rescue" on the command line.

"rescue" on the command line causes the booting to halt while an
ash shell is opened and running. I like that feature of mkinitrd.
It is a great tool. But when I do it and look in /dev I get a big
surprise it does not contain the same block devices that were in
initrd-tree/dev.

What is going on here?

I'd really like to know. This is troubling, and annoying. Have I
made a mistake somewhere?

-Joe

(For the curious, I'll tell the rest of the plan: Once I get the
block devices into /dev, I'll also add the ehci-hcd module using
"mkinitrd -m ehci-hcd". Then I'll build the resulting initrd.gz
and a kernel into a bootable Grub CD. The CD will allow me to
boot the USB hard drive without depending on a machine to have the
Boot USB option.)
From: joe on
joe(a)kiwi.hopto.org wrote:

> What is going on here?
>
> I'd really like to know. This is troubling, and annoying. Have I
> made a mistake somewhere?
>
> -Joe
>
> (For the curious, I'll tell the rest of the plan: Once I get the
> block devices into /dev, I'll also add the ehci-hcd module using
> "mkinitrd -m ehci-hcd". Then I'll build the resulting initrd.gz
> and a kernel into a bootable Grub CD. The CD will allow me to
> boot the USB hard drive without depending on a machine to have the
> Boot USB option.)

Update:

I don't understand much about what I did, but it seems I got it working.

I did a lot of things, but I think that what I did could be boiled down to this:

vvv

I added udevadm and udevd to initrd-tree/sbin, and I copied

/lib/modules/2.6.33.4-smp/modules.dep

to the corresponding place in initrd-tree. Then I ran

mkinitrd -m ehci-hcd:uhci-hcd:ohci-hcd:usb-storage

^^^

This much made an initrd.gz file. Then I used it with lilo to make a lilo-boot
on an internal hard drive that was capable of booting my usb hard drive. I had
used "rescue" on the boot line so I could manually mount the usb hard drive's
partition. I think I could automate that step thru mkinitrd, but I haven't tried yet.

Then I used grub and the same initrd.gz to make a bootable CD that functioned in
the same way.

It seems my trouble was caused by a lack of modules, udevadm and udevd. I don't
think modules.dep, uhci-hcd, or ohci-hcd were needed, but I'm happy to have them as
they make the CD useful for rescue purposes. I need to do more testing to learn what
exactly was needed to solve this. Recent changes to how /dev is used by the kernel
caught me unprepared I guess.

Anybody have any comments?
From: Joseph Rosevear on
joe(a)pear.hopto.org wrote:
>
> It seems my trouble was caused by a lack of modules, udevadm and udevd. I don't
> think modules.dep, uhci-hcd, or ohci-hcd were needed, but I'm happy to have them as
> they make the CD useful for rescue purposes. I need to do more testing to learn what
> exactly was needed to solve this. Recent changes to how /dev is used by the kernel
> caught me unprepared I guess.

I forgot to explain. Now with udevadm and udevd, there is no need to
add block devices to the initrd-tree. The needed block devices are put
there automatically.

-Joe