USB root
Okay here's the idea - I have a tablet - it has a 2.0 usb port. It knows how to boot a hard drive off USB. I have a USB drive which linux is quite happy to recognize and use, partition, and have installed my favored distribution on it. However, due to some issues with USB, the usb devices are not recognized by the kernel until after init runs - there's some lock. (the 2.5.72 kernel I'm playing with doesn't have the same problem... but there's other issues)...
As I understand it I can (and do) have a small partition on the main drive installed in the computer. Hereupon is a kernel with all drivers compiled in, no worry about modules. I have an initrd with busybox and a couple other tools... (for some reason the 2.5 kernel scsi driver doesn't recognize the partitions on the usb drive until I issue a sfdisk -R /devices/discs/disc1/disc )
So - linuxrc looks something like this...
#!/bin/ash
mount -t devfs none /devices
mount -t proc none /proc
sfdisk -R /devices/dsics/disc1/disc
mount /devices/discs/disc1/part2 /root
mount -t devfs none /root/devices
mount -t proc none /root/proc
mount /devices/discs/disc0/part5 /root/boot # the boot part this is running from
ash # pause a moment and check out the system...
cd root
/bin/pivot_root . initrd
umount initrd/devices
umount initrd/proc
exec chroot . /sbin/init a
I've tried various other options to init... but it seems to demand an A - I get a timeout for it accessing /dev/initctl - at the pause of ash in the middle I see that when I get to the exec point the current process will be like pid 11... I was reading another thread here about a similar problem dealing with scsi raid booting...
so that exec of init fails.. .and the system continues to load, and without some root option passed through grub - decides ot use /dev/hda6 - where I have a minimal redhat 9 installed (had to install that in order to install sorcerer on the usb drive....)
There was some small hint that the above type init wouldn't work under linux 2.5... so maybe I should try the same with the 2.4.19 kernel
(pause while I tinker a bit more)
Okay I'm not sure I understand why the chroot is needed after the pivot_root... why can't I just then fall out of the linuxrc script and have the normal /sbin/init run as would be normal? seems after I exit the linuxrc though the system proceeds to attempt to mount the root=(device) and then run init...
( long pause - 2.4.19 kernel isn't running the initrd correctly )
Ahh well - anyhow this is my project - I'll post the solution(s) if I find them and if anyone else has tinkered with this usb boot thing ....
|