[OLPC-devel] Re: boot OLPC laptop from USB flash drive?

Richard Smith smithbone at gmail.com
Sat Aug 19 04:41:18 EDT 2006


> OLPC guys -- this transition is important enough that I think it should
> be on the front page -- I can't find it.
>
> Zach -- you have to make the change, so let's see if we can help you.

Zach,

If you don't mind being an Alpha tester I have have put together a
bootstrap procedure for moving from Insyde BIOS to LinuxBIOS.

It uses grub and a hacked version of the kernel and initrd that
buildrom produces.

If this works then we can see about putting it up on the wiki.

Hardware Needed:

- USB keyboard
- CRT or LCD Monitor
- USB Disk (Any size will do the image is only 3.4MiB)
- Powered USB hub.
  There have been reports that some USB keys won't work when pluged
directly up to the OLPC due to power problems.  So use a powered hub.

Software Needed

- Working Linux system (I use Debian testing)
- Latest Buildrom: http://wiki.laptop.org/go/Building_LinuxBIOS#Buildrom
   I really mean the latest.  Just a few hours ago I commited
olpcflash 0.2.0 which is what you should use.
- bootstrap.tar.gz (Attached to this e-mail)

Procedure

Start buildrom building.

While buildrom is cruching prep up the USB disk.
Assume your USB disk is /dev/sda
Assume you mount your USB disk at /mnt/tgt

Fire up a root shell.

make or modifiy a partition table on the USB disk such that it has a
Linux partition /dev/sda1
you can use 'fdisk' or 'cfdisk' for this.

- make sure that you make the type of partition "Linux" which is type
83.  Grub will happly work on a FAT partition but you wont be able to
mount it later on since the kernel only has support for ext2.
- make sure the partition is marked bootable.

Now format that partition as ext2
mke2fs /dev/sda1

mount the disk
'mount /dev/sda1 /mnt/tgt'

Extract the bootstrap.tar.gz tarball in the root of the USB disk.
'cd /mnt/tgt'
'tar xvzf /path/to/bootstrap.tar.gz'

This should give you:

/boot/grub/<lots of file>
/bzImage
/initrd

Install GRUB into the MBR of the USB disk.
'grub-install --no-floppy --root-directory=/mnt/tgt /dev/sda'

wait for buildrom to finish
When its done go into the ./buildrom/deploy directory and copy the
linuxbios.rom file to /mnt/tgt.  It should be 983,040 in size.  If its
not then abort and seek assistance.

Ummount /mnt/tgt

Now you have a bootable USB disk with the necessary files on it to
flash the SPI FLASH on the OLPC.

Plug up the USB disk to whatever USB configuration you have.
Power on (or reboot) the OLPC.

Insyde will boot and after a while you will see a GRUB bootloader
screen.  Insyde tries to boot the floppy first by default so you have
to wait until it times out. Then it boots a USB disk.

Either hit return or wait 5 seconds and GRUB will boot the kernel.

When the kernel stops booting hit Enter a few times.  For some reason
you don't get a '$' prompt right off the bat.  Hitting enter gets you
a prompt.

The system is now running on a tiny filesystem.stored in RAM.

Mount the usb disk.
'mount /dev/sda1 /key'
'cd /key'

Save a copy of whats in the SPI flash
'olpcflash -r insyde.bin'

Verify it
'olpcflash -v insyde.bin'

write in your new linuxBIOS image
'olpcflash -w linuxbios.rom'

Verify it
'olpcflash -v linuxbios.rom'

If all went well you now have moved to LinuxBIOS.

Now you need some full blown olpc images.  See the wiki for details.

-- 
Richard A. Smith



More information about the Devel mailing list