[Fedora-livecd-list] tools/livecd-iso-to-disk.sh

Jeremy Katz katzj at fedoraproject.org
Thu Aug 28 21:39:38 UTC 2008


 tools/livecd-iso-to-disk.sh |   30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 5b69d94863531e446b9d5c9033347740601cbed0
Author: Jeremy Katz <katzj at redhat.com>
Date:   Thu Aug 28 17:38:01 2008 -0400

    Initial stab at setting up USB/SD for booting on the XO
    
    If you've built a live image with a kernel that will boot on the XO, this
    will let you put that image onto a USB stick/SD card with the needed
    forth files to boot.  Then just drop to the OF prompt while booting your XO
    and type either
      boot u:\olpc-usb.fth
    or
      boot sd:\olpc-sd.fth
    
    for booting from USB or SD

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index a2f058e..f3667d1 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -254,6 +254,9 @@ while [ $# -gt 2 ]; do
 	--mactel)
 	    mactel=1
 	    ;;
+	--xo)
+	    xo=1
+	    ;;
         --extra-kernel-args)
             kernelargs=$2
             shift
@@ -302,7 +305,7 @@ if [ -z "$mactel" ]; then
   checkPartActive $USBDEV
   [ -n "$resetmbr" ] && resetMBR $USBDEV
   checkMBR $USBDEV
-else
+elif [ -n "$mactel" ]; then
   [ -n "$resetmbr" ] && createGPTLayout $USBDEV
   checkGPT $USBDEV
 fi
@@ -479,6 +482,31 @@ if [ -n "$homesizemb" ]; then
     fi
 fi
 
+# create the forth files for booting on the XO if requested
+# we'd do this unconditionally, but you have to have a kernel that will
+# boot on the XO anyway.
+if [ -n "$xo" ]; then
+    echo "Setting up /olpc-usb.fth file"
+    args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
+    cat > $USBMNT/olpc-usb.fth <<EOF
+\ Boot script for USB boot
+" $args" to boot-file
+" u:\syslinux\initrd0.img" to ramdisk
+unfreeze
+boot u:\syslinux\vmlinuz0
+EOF
+
+    echo "Setting up /olpc-sd.fth file"
+    cat > $USBMNT/olpc-sd.fth <<EOF
+\ Boot script for SD boot
+" $args" to boot-file
+" sd:\syslinux\initrd0.img" to ramdisk
+unfreeze
+boot sd:\syslinux\vmlinuz0
+EOF
+
+fi
+
 echo "Installing boot loader"
 if [ -n "$mactel" ]; then
     # replace the ia32 hack





More information about the Fedora-livecd-list mailing list