[Fedora-livecd-list] Branch 'f13-branch' - 9 commits - Makefile tools/livecd-iso-to-disk.sh

Brian C. Lane bcl at fedoraproject.org
Wed Aug 24 00:25:44 UTC 2011


 Makefile                    |    2 -
 tools/livecd-iso-to-disk.sh |   71 ++++++++++++++++++++++++++++++++------------
 2 files changed, 53 insertions(+), 20 deletions(-)

New commits:
commit 3583c1f548fbe7d1fabe1a76a9c9e26fa5bcf535
Author: Brian C. Lane <bcl at redhat.com>
Date:   Tue Aug 23 13:03:45 2011 -0700

    Version 13.4

diff --git a/Makefile b/Makefile
index c62a6fa..c658b1d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 
-VERSION = 13.3
+VERSION = 13.4
 
 INSTALL = /usr/bin/install -c
 INSTALL_PROGRAM = ${INSTALL}


commit e42b532ebe3859b8e43dd75565068666bee82f5e
Author: Brian C. Lane <bcl at redhat.com>
Date:   Tue Aug 23 16:16:52 2011 -0700

    Use copyFile on the iso

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 8c4e7a1..1d2156c 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -746,7 +746,7 @@ if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) ]; then
         done
     fi
     if [ "$isotype" = "installer" -a -z "$skipcopy" ]; then
-        cp $ISO $USBMNT/
+        copyFile $ISO $USBMNT/
     fi
     sync
 fi


commit 949d0504973f4f4635c8258b749258ddbcb4e03a
Author: Brian C. Lane <bcl at redhat.com>
Date:   Wed Mar 16 17:22:30 2011 -0700

    Add EFI support to netboot and DVD iso

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index ee4bebb..8c4e7a1 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -778,17 +778,25 @@ if [ "$LIVEOS" != "LiveOS" ]; then sed -i -e "s;liveimg;liveimg live_dir=$LIVEOS
 
 # DVD Installer
 if [ "$isotype" = "installer" ]; then
-    sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;g" $BOOTCONFIG $BOOTCONFIG_EFI
-    sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+    sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;g" $BOOTCONFIG
+    sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
+    if [ -n "$efi" ]; then
+        # Images are in $SYSLINUXPATH now
+        sed -i -e "s;/images/pxeboot/;/$SYSLINUXPATH/;g" -e "s;vmlinuz;vmlinuz ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;g" $BOOTCONFIG_EFI
+    fi
 fi
 
 # DVD Installer for netinst
 if [ "$isotype" = "netinst" ]; then
     if [ "$imgtype" = "install" ]; then
-        sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+        sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG
     else
         # The initrd has everything, so no stage2
-        sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+        sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
+    fi
+    if [ -n "$efi" ]; then
+        # Images are in $SYSLINUXPATH now
+        sed -ie "s;/images/pxeboot/;/$SYSLINUXPATH/;g" $BOOTCONFIG_EFI
     fi
 fi
 


commit c2992a1b150dc42d2f205c7dc5142e5a0a7f2735
Author: Brian C. Lane <bcl at redhat.com>
Date:   Tue Aug 23 15:01:59 2011 -0700

    Use rsync to copy if available

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index fbb7d02..ee4bebb 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -384,6 +384,10 @@ cp_p() {
 }
 
 copyFile() {
+        if [ -x /usr/bin/rsync ]; then
+            rsync -P "$1" "$2"
+            return
+        fi
 	if [ -x /usr/bin/gvfs-copy ]; then
 	    gvfs-copy -p "$1" "$2"
 	    return


commit 71623d5960938d8d87686edc836f5570433e0cfc
Author: Brian C. Lane <bcl at redhat.com>
Date:   Wed Mar 16 10:42:42 2011 -0700

    Support /EFI/BOOT or /EFI/boot (#688258)
    
    Some iso's use lower case. Upper case is correct, but both work.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index c3f34e2..fbb7d02 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -395,6 +395,8 @@ copyFile() {
 	cp "$1" "$2"
 }
 
+shopt -s extglob
+
 cryptedhome=1
 keephome=1
 homesizemb=0
@@ -597,9 +599,15 @@ if [ -f "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" -a "$homesizemb" -gt 0 ];
     exitclean
 fi
 
-if [ -n "$efi" -a ! -d $CDMNT/EFI/boot ]; then
-    echo "ERROR: This live image does not support EFI booting"
-    exitclean
+if [ -n "$efi" ]; then
+    if [ -d $CDMNT/EFI/BOOT ]; then
+        EFI_BOOT="/EFI/BOOT"
+    elif [ -d $CDMNT/EFI/boot ]; then
+        EFI_BOOT="/EFI/boot"
+    else
+        echo "ERROR: This live image does not support EFI booting"
+        exitclean
+    fi
 fi
 
 # let's try to make sure there's enough room on the stick
@@ -698,7 +706,7 @@ fi
 
 # Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
 [ ! -d $USBMNT/$SYSLINUXPATH ] && mkdir -p $USBMNT/$SYSLINUXPATH
-[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
+[ -n "$efi" -a ! -d $USBMNT$EFI_BOOT ] && mkdir -p $USBMNT$EFI_BOOT
 
 # Live image copy
 set -o pipefail
@@ -743,12 +751,16 @@ cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
 BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
 # Set this to nothing so sed doesn't care
 BOOTCONFIG_EFI=
-if [ -n "$efi" ];then
-    cp $CDMNT/EFI/boot/* $USBMNT/EFI/boot
+if [ -n "$efi" ]; then
+    cp $CDMNT$EFI_BOOT/* $USBMNT$EFI_BOOT
+
+    # FIXME
+    # There is a problem here. On older LiveCD's the files are boot?*.conf
+    # They really should be renamed to BOOT?*.conf
 
     # this is a little ugly, but it gets the "interesting" named config file
-    BOOTCONFIG_EFI=$USBMNT/EFI/boot/boot?*.conf
-    rm -f $USBMNT/EFI/boot/grub.conf
+    BOOTCONFIG_EFI=$USBMNT$EFI_BOOT/+(BOOT|boot)?*.conf
+    rm -f $USBMNT$EFI_BOOT/grub.conf
 fi
 
 echo "Updating boot config file"
@@ -906,7 +918,9 @@ if [ -z "$multi" ]; then
     echo "Installing boot loader"
     if [ -n "$efi" ]; then
         # replace the ia32 hack
-        if [ -f "$USBMNT/EFI/boot/boot.conf" ]; then cp -f $USBMNT/EFI/boot/bootia32.conf $USBMNT/EFI/boot/boot.conf ; fi
+        if [ -f "$USBMNT$EFI_BOOT/boot.conf" ]; then
+            cp -f $USBMNT$EFI_BOOT/BOOTia32.conf $USBMNT$EFI_BOOT/BOOT.conf
+        fi
     fi
 
     # this is a bit of a kludge, but syslinux doesn't guarantee the API for its com32 modules :/


commit bc754e54ed52cd69c40a0881a0184fdd10a4f608
Author: Brian C. Lane <bcl at redhat.com>
Date:   Thu Feb 24 15:44:46 2011 -0800

    gptmbr can be written directly to the mbr
    
    With the change to syslinux 4 the gptmbr.bin no longer needs the
    GUID of the partition to boot, it just needs the boot flag set on it.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 35ecea3..c3f34e2 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -87,15 +87,13 @@ resetMBR() {
     # if efi, we need to use the hybrid MBR
     if [ -n "$efi" ];then
         if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
-            gptmbr='/usr/lib/syslinux/gptmbr.bin'
+            cat /usr/lib/syslinux/gptmbr.bin > $device
         elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
-            gptmbr='/usr/share/syslinux/gptmbr.bin'
+            cat /usr/share/syslinux/gptmbr.bin > $device
         else
             echo "Could not find gptmbr.bin (syslinux)"
             exitclean
         fi
-        # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
-        dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
         # Make it bootable on EFI and BIOS
         parted -s $device set $partnum legacy_boot on
     else


commit da79706e826836d7ce722c53ceba50f1b9f80553
Author: Brian C. Lane <bcl at redhat.com>
Date:   Mon Aug 8 15:18:06 2011 -0700

    Ensure previous filesystems are wiped when formatting (#712553)
    
    Add wipefs step before partitioning the device. This will remove any
    previous filesystem signatures as well as iso9660's signature which
    has been known to cause problems.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 837ba2c..35ecea3 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -175,6 +175,7 @@ createGPTLayout() {
     echo "Press Enter to continue or ctrl-c to abort"
     read
     umount ${device}* &> /dev/null
+    wipefs -a ${device}
     /sbin/parted --script $device mklabel gpt
     partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
     size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
@@ -198,6 +199,7 @@ createMSDOSLayout() {
     echo "Press Enter to continue or ctrl-c to abort"
     read
     umount ${device}* &> /dev/null
+    wipefs -a ${device}
     /sbin/parted --script $device mklabel msdos
     partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
     size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
@@ -225,6 +227,7 @@ createEXTFSLayout() {
     echo "Press Enter to continue or ctrl-c to abort"
     read
     umount ${device}* &> /dev/null
+    wipefs -a ${device}
     /sbin/parted --script $device mklabel msdos
     partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
     size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')


commit 95fa55f730dff47b1331b1457c3f49c82a2fdb5b
Author: Brian C. Lane <bcl at redhat.com>
Date:   Mon Aug 8 16:21:09 2011 -0700

    Turn on the legacy_boot flag for EFI (#680563)
    
    This allows gptmbr to be able to boot on both EFI and BIOS.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 11c387b..837ba2c 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -96,6 +96,8 @@ resetMBR() {
         fi
         # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
         dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
+        # Make it bootable on EFI and BIOS
+        parted -s $device set $partnum legacy_boot on
     else
         if [ -f /usr/lib/syslinux/mbr.bin ]; then
             cat /usr/lib/syslinux/mbr.bin > $device


commit 54c2f9b09cc5aeffe495a20bfc5ea6923f65bdcd
Author: Brian C. Lane <bcl at redhat.com>
Date:   Thu May 5 16:56:36 2011 -0700

    Copy updates and product image files
    
    In order to properly support copying RHEL images to USB we need to
    include any updates.img or product.img files that are present on the
    original iso.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 3b6c151..11c387b 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -724,7 +724,11 @@ if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) ]; then
     echo "Copying DVD image to USB stick"
     mkdir -p $USBMNT/images/
     if [ "$imgtype" = "install" ]; then
-        copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+        for img in install.img updates.img product.img; do
+            if [ -e $CDMNT/images/$img ]; then
+                copyFile $CDMNT/images/$img $USBMNT/images/$img || exitclean
+            fi
+        done
     fi
     if [ "$isotype" = "installer" -a -z "$skipcopy" ]; then
         cp $ISO $USBMNT/




More information about the livecd mailing list