[U-Boot-Users] USB booting...

I am attempting to boot Linux on a target platform using a USB mass storage device (flash disk) to hold the kernel and the root filesystem.
I thought it may be a good idea to replicate the same steps used when booting from a tftp server, i.e. I copy the root filesystem (using an initrd image) to an address in RAM, then copy the kernel to a different address in RAM. Finally bootm with the start address of the kernel. Bootargs will be set during this process.
So I created two partitions on the USB flash disk, partion 1 holds the kernel image and partition 2 holds the initrd image.
The partition table looks like this:
Disk /dev/sdb: 32 MB, 32768000 bytes 2 heads, 32 sectors/track, 1000 cylinders Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System /dev/sdb1 1 154 4912 83 Linux /dev/sdb2 155 308 4928 83 Linux
My file sizes are:
initrd: 1203800 bytes. uImage: 2285056 bytes.
The command I want to use to copy the initrd is:
usb read 20800000 x y.
Where 20800000 is the address for the initrd to be copied to, x will be the block-offest to the start of partition 2 and y will be the size in blocks of the initrd image.
Now I need to calculate the block-size based on cylinders, heads, units etc.
My questions are, am I making this too complex, is there an easier way to achieve the same result of booting using a USB flash disk with seperate kernel/initrd images?
Appologies for the long-winded pre-amble, but I don't know how to ask a question like this without describing the problem.
Thanks for any insight,
Neil.

In message 1120664027.6064.99.camel@daroca you wrote:
I am attempting to boot Linux on a target platform using a USB mass storage device (flash disk) to hold the kernel and the root filesystem.
I thought it may be a good idea to replicate the same steps used when booting from a tftp server, i.e. I copy the root filesystem (using an initrd image) to an address in RAM, then copy the kernel to a different address in RAM. Finally bootm with the start address of the kernel. Bootargs will be set during this process.
You can do it this way, but it is a waste of system RAM. Why don't you use a (read-only) file system mounted on the USB device?
So I created two partitions on the USB flash disk, partion 1 holds the kernel image and partition 2 holds the initrd image.
This is possible, but seems overly complicated to me. For alternative approaches please see the DULG, especially http://www.denx.de/twiki/bin/view/DULG/RootFileSystemDesignAndBuilding
usb read 20800000 x y.
Where 20800000 is the address for the initrd to be copied to, x will be the block-offest to the start of partition 2 and y will be the size in blocks of the initrd image.
Now I need to calculate the block-size based on cylinders, heads, units etc.
No, you don't. The block size is always a constant - 512 bytes per block.
My questions are, am I making this too complex, is there an easier way to achieve the same result of booting using a USB flash disk with seperate kernel/initrd images?
Yes, there is. Just read the manual.
Appologies for the long-winded pre-amble, but I don't know how to ask a question like this without describing the problem.
RTFM first?
Best regards,
Wolfgang Denk
participants (2)
-
Neil Bryan
-
Wolfgang Denk