Saturday, April 11, 2009

Script which Creates Live USB from ISO
For OLPC XO or any system
(Fedora script ported to SuSE 11.1)

I wanted to run the Sugarlab's latest Sugar-on-Stick Soas2 on the OLPC using Live USB (Actually SD). There is a utility which uses syslinux to convert ISO to a live USB or SD or CR (or hard disk I guess), and is here: https://fedorahosted.org/liveusb-creator/ , but underlying is really one shell script, writen originally by Jeremy Katz from Red Hat http://people.sugarlabs.org/sdz/livecd-iso-to-disk.sh .

My goal was to convert the script livecd-iso-to-disk.sh to SuSE and it was succesful with a few changes. (Although I ended up with many more changes of cosmetic and refactoring nature).

There were some things that did not work on SuSE, a few I remember - there was a harcoded path to "parted", a hardcoded partition id=1 which did not work for my SD on SuSE (partition id=p1 e.g. /dev/mmcblk0p1). Also I neede later version of syslinux then SuSE version of syslinux, which was missing gptmbr.bin for the Extensible Firmware Interface option.

Also I added lots of comments on top. This script is amazing, it does the whole process of creating Live USB and has tons of options, including format, ability to create "home image" on the USB which is not overwritten with an update, contains the OLPC boot Forth script etc etc. Thanks Red Hat.

The script now runs on SuSE and it is on the below. I would be interested to know if it still runs on Fedora (it should) and other distros (I do not know).

Here is the version with my changes. The most significant "functional" difference is the added last parameter, partition name (which could be "1" for the USB, "p1" for SD but it will depend on the distro).

No comments: