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

Jeremy Katz katzj at fedoraproject.org
Mon Oct 27 22:16:51 UTC 2008


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

New commits:
commit 7cc4bfb25339ebc6d8cc233995f6e14a6fc6bc35
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Oct 27 17:15:16 2008 -0400

    Minor fixes for mactel mode
    
    Make sure we use the new UUID of the created filesystme and remove the
    grub.conf to reduce confusion potential

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index ccbe694..497062f 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -133,6 +133,7 @@ createGPTLayout() {
     USBDEV=${device}1
     /sbin/udevsettle
     /sbin/mkdosfs -n LIVE $USBDEV
+    USBLABEL="UUID=$(/lib/udev/vol_id -u $dev)"
 }
 
 checkGPT() {
@@ -477,6 +478,7 @@ EOF
 
   # this is a little ugly, but it gets the "interesting" named config file
   BOOTCONFIG=$USBMNT/EFI/boot/boot?*.conf
+  rm -f $USBMNT/EFI/boot/grub.conf
 fi
 
 echo "Updating boot config file"


commit c13700335b3296d8672c53ae599164ff0eb27934
Author: Jeremy Katz <katzj at redhat.com>
Date:   Tue Oct 21 11:18:58 2008 -0400

    Support copying the raw ext3fs to the usb stick
    
    For some cases, squashfs is pretty expensive and we have disk space (eg,
    on SD card for the XO).  In those cases, we want to be able to ask for just
    the raw ext3fs.img to be copied.  Make --xo default to doing so

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b598fa4..ccbe694 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -274,10 +274,14 @@ while [ $# -gt 2 ]; do
 	    ;;
 	--xo)
 	    xo=1
+	    skipcompress=1
 	    ;;
 	--xo-no-home)
 	    xonohome=1
 	    ;;
+	--skipcompress)
+	    skipcompress=1
+	    ;;
         --extra-kernel-args)
             kernelargs=$2
             shift
@@ -381,6 +385,11 @@ else
   tbd=0
 fi
 livesize=$(du -s -B 1M $check | awk {'print $1;'})
+if [ -n "$skipcompress" ]; then
+    mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT
+    livesize=$(du -s -B 1M $CDMNT/LiveOS/ext3fs.img | awk {'print $1;'})
+    umount $CDMNT
+fi
 free=$(df  -B1M $USBDEV  |tail -n 1 |awk {'print $4;'})
 
 if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt $(($free + $tbd)) ]; then
@@ -415,7 +424,11 @@ echo "Copying live image to USB stick"
 [ ! -d $USBMNT/LiveOS ] && mkdir $USBMNT/LiveOS
 [ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/LiveOS/$HOMEFILE
 # cases without /LiveOS are legacy detection, remove for F10
-if [ -f $CDMNT/LiveOS/squashfs.img ]; then
+if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
+    mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT
+    cp $CDMNT/LiveOS/ext3fs.img $USBMNT/LiveOS/ext3fs.img || (umount $CDMNT ; exitclean)
+    umount $CDMNT
+elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
     cp $CDMNT/LiveOS/squashfs.img $USBMNT/LiveOS/squashfs.img || exitclean
 elif [ -f $CDMNT/squashfs.img ]; then
     cp $CDMNT/squashfs.img $USBMNT/LiveOS/squashfs.img || exitclean 


commit 0896e5bc135b1c7f14254dbaf0a97c9a0a6f89b8
Author: Jeremy Katz <katzj at redhat.com>
Date:   Tue Oct 21 11:14:17 2008 -0400

    Default to resetting the overlay on XO

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index c224230..b598fa4 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -525,6 +525,7 @@ if [ -n "$xo" ]; then
     if [ -z "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
 	args="$args persistenthome=mtd0"
     fi
+    args="$args reset_overlay"
     if [ ! -d $USBMNT/boot ]; then mkdir -p $USBMNT/boot ; fi
     cat > $USBMNT/boot/olpc.fth <<EOF
 \ Boot script for USB boot


commit 43e8184851df1d293b52b15a8384802aadc3659e
Author: Jeremy Katz <katzj at redhat.com>
Date:   Tue Oct 21 11:12:57 2008 -0400

    Verify integer arguments to livecd-iso-to-disk (#467257)
    
    Verify that arguments passed to livecd-iso-to-disk are actually integers
    as opposed to specifying, eg, 256MB

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 0a1144d..c224230 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -219,6 +219,12 @@ checkMounted() {
     fi
 }
 
+checkint() {
+    if ! test $1 -gt 0 2>/dev/null ; then
+	usage
+    fi
+}
+
 if [ $(id -u) != 0 ]; then 
     echo "You need to be root to run this script"
     exit 1
@@ -234,14 +240,17 @@ HOMEFILE="home.img"
 while [ $# -gt 2 ]; do
     case $1 in
 	--overlay-size-mb)
+	    checkint $2
 	    overlaysizemb=$2
 	    shift
 	    ;;
 	--home-size-mb)
+	    checkint $2
             homesizemb=$2
             shift
 	    ;;
 	--swap-size-mb)
+	    checkint $2
 	    swapsizemb=$2
 	    shift
 	    ;;





More information about the Fedora-livecd-list mailing list