initrd hacking [was: booting with grub to /dev/sda]

Jim Cromie jcromie at divsol.com
Thu Jan 6 14:42:32 UTC 2005


C. Linus Hicks wrote:

>On Wed, 2005-01-05 at 21:43 -0700, Jim Cromie wrote:
>
>  
>
>>Ive already hacked it - indirectly - by hacking mkinitrd (a shell script)
>>- I turned off the setquiet in hope that it would tell me where the bug 
>>was :-(
>>
>>here it is:#!/bin/nash
>>
>>mount -t proc /proc /proc
>>echo Mounted /proc filesystem
>>echo Mounting sysfs
>>mount -t sysfs none /sys
>>echo Creating /dev
>>mount -o mode=0755 -t tmpfs none /dev
>>mknod /dev/console c 5 1
>>mknod /dev/null c 1 3
>>mknod /dev/zero c 1 5
>>mkdir /dev/pts
>>mkdir /dev/shm
>>echo Starting udev
>>/sbin/udevstart
>>echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
>>echo "Loading jbd.ko module"
>>insmod /lib/jbd.ko
>>echo "Loading ext3.ko module"
>>insmod /lib/ext3.ko
>>echo "Loading scsi_mod.ko module"
>>insmod /lib/scsi_mod.ko
>>echo "Loading usb-storage.ko module"
>>insmod /lib/usb-storage.ko
>>sleep 5
>>/sbin/udevstart
>>echo Creating root device
>>mkrootdev /dev/root
>>umount /sys
>>echo Mounting root filesystem
>>mount -o defaults --ro -t ext3 /dev/root /sysroot
>>mount -t tmpfs --bind /dev /sysroot/dev
>>echo Switching to new root
>>switchroot /sysroot
>>umount /initrd/dev
>>
>>I stalled out after looking for nash docs explaining what
>>"mkrootdev /dev/root" actually does.
>>it would make sense if its whatever is on kernel-command line,
>>ie root=/dev/sda1 in my case.
>>
>>Id welcome other suggestions.
>>    
>>
>
>One thing I noticed... you load the SCSI modules prior to loading USB
>support. That seems backwards to me. I would have also thought that you
>need sd_mod.ko. Your boot log should show the SCSI sub-system detecting
>a disk drive and assigning a device name to it.
>
>  
>
I used mkinitrd -v, and the verbose output
had some stuff about dependencies; it looked like it had
addressed them.

I had noticed that, but dismissed it w/o much thought,
figuring 'it must be ok, otherwize all the scsi booters would have bitched'
But yes, since insmod knows nothing of dependencies,
theyre not being handled here.

thanks for bringing it up, I will try a few permutations
and get back here on it. (maybe bugzilla too)




More information about the fedora-list mailing list