fuente:
http://www.linuxfromscratch.org/pipermail/blfs-support/2006-March/058982.htmlWell, this worked for me:
First of all I have recompiled my kernel with:
Device Drivers -> USB Support ->
Support for Host-side USB
EHCI HCD (USB 2.0) support
OHCI HCD support
UHCI HCD (most Intel and VIA) support
USB Mass Storage support
statically compiled into the kernel.
I needed also this:
Device Drivers -> Block devices ->
Loopback device support
RAM disk support
Initial RAM disk (initrd) support
statically compiled into the kernel.
Then I recompiled and installed the kernel
(mine is 2.6.12.5) and rebooted.
Now we have to build an initrd-tree, we can
build it from "scratch" (possibly, a more appropriate
solution on this site) but we can also use an already
done script.
A good candidate seems to be the mkinitrd script from
the last slackware distro, so I downloaded this:
mkinitrd-1.0.1-i486-3.tgz
from a slack mirror. Then:
cd /usr/local/src
cp /home/alex/scaricati/mkinitrd-1.0.1-i486-3.tgz .
tar xvzf mkinitrd-1.0.1-i486-3.tgz
install -v -m 755 usr/sbin/mkinitrd /usr/sbin/
install -v -d -m 755 /usr/share/mkinitrd
cp usr/share/mkinitrd/initrd-tree.tar.gz /usr/share/mkinitrd/
# you can also read and install the docs and man page
# about busybox and mkinitrd. Be sure to read
# the script itself to understand how it works.
Now the mkinitrd script is installed and we can
build the initrd-tree, so:
cd /boot
mkinitrd
# Add your disk-device in initrd-tree/rootdev
# (mine is /dev/sda6, correct this with yours)
cat > initrd-tree/rootdev << "EOF"
/dev/sda6
EOF
# Add the name of the used file-system for the
# previous partition (mine is ext3)
cat > initrd-tree/rootfs << "EOF"
ext3
EOF
Now, the problem with this solution is that we
have to give time enough to the kernel to discover
the usb-storage before that the initial ram disk
try to mount the real root partition (in my case
/dev/sda6). To solve this I added the line
sleep 12
in initrd-tree/linuxrc, just before this comment:
# Switch to real root partition:
(line 89).
(Yes, I know it's a bit naive, but I have not
a better solution ATM, perhaps someone can suggest
something more appropriate here)
One can tune the previous sleep in case is not
enough; in my case wait for 12 seconds is sufficient.
If someone needs to load also some modules from the
initrd, they have to be copied in
initrd-tree/lib/modules/`uname -r`
and edit load_kernel_modules, then
chmod 755 load_kernel_modules
Now we have to run the mkinitrd script
again from the /boot directory:
cd /boot
mkinitrd
This time the script should create the real
initrd.gz. We need also to copy the kernel
from the usb-disk partition in the hard-disk.
Now we can instruct grub to boot from sdaX.
I added this to /boot/grub/menu.lst:
(With grub installed in the MBR of /dev/hda)
title USBDISK-BOOT
kernel (hd0,10)/boot/usblfskernel-2.6.12.5 root=/dev/sda6
initrd (hd0,10)/boot/initrd.gz
Again, be sure to correct the previous line with
your correct data.
As you see, this solution requires to have both
the kernel and the initrd image in a disk where grub
can find them, but after that grub should menage to boot
the system installed in the usb-disk.
This let me to reboot from an usb-disk partition.
Well, it seems to be all (hope I haven't forgot
anything or made too much confusion)
Regards, Alessandro Alocci
http://www.linuxfromscratch.org/pipermail/blfs-support/2006-March/058982.html