tools/livecd-iso-to-disk.sh | 82 ++++++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 17 deletions(-)
New commits:
commit c92dfe621904c6f3770454bcd92c768860a85159
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Mar 17 14:11:43 2011 -0700
Add extracting BOOTX64.efi from iso (#688258)
Some iso's (RHEL6) don't have the BOOTX64.efi binary in /EFI/BOOT,
but it is in the eltorito image, so if it is missing from the iso
extract it from the eltorito using the dumpet utility.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 46f42ab..deb5473 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1066,6 +1066,34 @@ if [ -n "$efi" ]; then
# this is a little ugly, but it gets the "interesting" named config file
BOOTCONFIG_EFI=$TGTMNT$EFI_BOOT/+(BOOT|boot)?*.conf
rm -f $TGTMNT$EFI_BOOT/grub.conf
+
+ # On some images (RHEL) the BOOT*.efi file isn't in $EFI_BOOT, but is in
+ # the eltorito image, so try to extract it if it is missing
+
+ # test for presence of *.efi grub binary
+ if [ ! -f $TGTMNT$EFI_BOOT/+(BOOT|boot)?*.efi ]; then
+ if [ ! -x /usr/bin/dumpet ]; then
+ echo "No /usr/bin/dumpet tool found. EFI image will not boot."
+ echo "Source media is missing grub binary in /EFI/BOOT/*efi"
+ exitclean
+ else
+ # dump the eltorito image with dumpet, output is $SRC.1
+ dumpet -i $SRC -d
+ EFIMNT=$(mktemp -d /media/srctmp.XXXXXX)
+ mount -o loop $SRC.1 $EFIMNT
+
+ if [ -f $EFIMNT$EFI_BOOT/+(BOOT|boot)?*.efi ]; then
+ cp $EFIMNT$EFI_BOOT/+(BOOT|boot)?*.efi $TGTMNT$EFI_BOOT
+ else
+ echo "No BOOT*.efi found in eltorito image. EFI will not boot"
+ umount $EFIMNT
+ rm $SRC.1
+ exitclean
+ fi
+ umount $EFIMNT
+ rm $SRC.1
+ fi
+ fi
fi
if [[ live == $srctype ]]; then
commit 0023914160f084ff85087d9a90f3fd3dc9f23285
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Mar 17 10:22:41 2011 -0700
Add repo to DVD EFI install config file (#688258)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 47cce30..46f42ab 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1101,6 +1101,10 @@ fi
if [ "$srctype" = "installer" ]; then
sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG}
repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
+ if [ -n "$efi" ]; then
+ # Images are in / now
+ sed -i -e "s;images/pxeboot/;;g" -e "s;vmlinuz;vmlinuz
${LANG:+LANG=$LANG} repo=hd:$TGTLABEL:/;g" $BOOTCONFIG_EFI
+ fi
fi
# DVD Installer for netinst
commit d575b4c2747dd297d0733b77573297626dda211b
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Mar 16 17:22:30 2011 -0700
Add EFI support to netboot (#688258)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 41f7f85..47cce30 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1099,17 +1099,22 @@ fi
# DVD Installer
if [ "$srctype" = "installer" ]; then
- sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG}
repo=hd:$TGTLABEL:/;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:$TGTLABEL:/;g" $BOOTCONFIG
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
fi
# DVD Installer for netinst
if [ "$srctype" = "netinst" ]; then
if [ "$imgtype" = "install" ]; then
- sed -i -e "s;stage2=\S*;stage2=hd:$TGTLABEL:/images/install.img;g"
$BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;stage2=hd:$TGTLABEL:/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
+
+ if [ -n "$efi" ]; then
+ # Images are in / now
+ sed -ie "s;images/pxeboot/;;g" $BOOTCONFIG_EFI
+ fi
fi
fi
commit fbcc2be6f9c70b7ff7d801f07d04a3ea2535b955
Author: Brian C. Lane <bcl(a)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 454b893..41f7f85 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -647,6 +647,7 @@ copyFile() {
set -e
set -o pipefail
trap exitclean EXIT
+shopt -s extglob
cryptedhome=1
keephome=1
@@ -863,9 +864,15 @@ if [ -f "$TGTMNT/$LIVEOS/$HOMEFILE" -a -n
"$keephome" -a "$homesizemb" -gt 0 ];
exitclean
fi
-if [ -n "$efi" -a ! -d $SRCMNT/EFI/boot ]; then
- echo "ERROR: This live image does not support EFI booting"
- exitclean
+if [ -n "$efi" ]; then
+ if [ -d $SRCMNT/EFI/BOOT ]; then
+ EFI_BOOT="/EFI/BOOT"
+ elif [ -d $SRCMNT/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 target device
@@ -881,8 +888,8 @@ fi
if [[ live == $srctype ]]; then
targets="$TGTMNT/$SYSLINUXPATH"
- [[ -n $efi ]] && targets+=" $TGTMNT/EFI/boot"
- [[ -n $xo ]] && targets+=" $TGTMNT/boot/olpc.fth"
+ [[ -n $efi ]] && targets+=" $TGTMNT$EFI_BOOT"
+ [[ -n $xo ]] && targets+=" $TGTMNT/BOOT/olpc.fth"
duTable=($(du -c -B 1M $targets 2> /dev/null || :))
((tbd += ${duTable[*]: -2:1}))
fi
@@ -913,8 +920,8 @@ if [[ live == $srctype ]]; then
sources="$SRCMNT/LiveOS/ext3fs.img $SRCMNT/LiveOS/osmin.img"
[[ -z $skipcompress ]] && sources+=" $SRCMNT/LiveOS/squashfs.img"
sources+=" $SRCMNT/isolinux $SRCMNT/syslinux"
- [[ -n $efi ]] && sources+=" $SRCMNT/EFI/boot"
- [[ -n $xo ]] && sources+=" $SRCMNT/boot/olpc.fth"
+ [[ -n $efi ]] && sources+=" $SRCMNT$EFI_BOOT"
+ [[ -n $xo ]] && sources+=" $SRCMNT/BOOT/olpc.fth"
duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null || :))
((livesize += ${duTable[*]: -2:1}))
fi
@@ -996,7 +1003,7 @@ fi
# Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
[ ! -d $TGTMNT/$SYSLINUXPATH ] && mkdir -p $TGTMNT/$SYSLINUXPATH
-[ -n "$efi" -a ! -d $TGTMNT/EFI/boot ] && mkdir -p $TGTMNT/EFI/boot
+[ -n "$efi" -a ! -d $TGTMNT$EFI_BOOT ] && mkdir -p $TGTMNT$EFI_BOOT
# Live image copy
set -o pipefail
@@ -1050,11 +1057,15 @@ BOOTCONFIG=$TGTMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
if [ -n "$efi" ]; then
- cp $SRCMNT/EFI/boot/* $TGTMNT/EFI/boot
+ cp $SRCMNT$EFI_BOOT/* $TGTMNT$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=$TGTMNT/EFI/boot/boot?*.conf
- rm -f $TGTMNT/EFI/boot/grub.conf
+ BOOTCONFIG_EFI=$TGTMNT$EFI_BOOT/+(BOOT|boot)?*.conf
+ rm -f $TGTMNT$EFI_BOOT/grub.conf
fi
if [[ live == $srctype ]]; then
@@ -1229,8 +1240,8 @@ if [ -z "$multi" ]; then
echo "Installing boot loader"
if [ -n "$efi" ]; then
# replace the ia32 hack
- if [ -f "$TGTMNT/EFI/boot/boot.conf" ]; then
- cp -f $TGTMNT/EFI/boot/bootia32.conf $TGTMNT/EFI/boot/boot.conf
+ if [ -f "$TGTMNT$EFI_BOOT/boot.conf" ]; then
+ cp -f $TGTMNT$EFI_BOOT/BOOTia32.conf $TGTMNT$EFI_BOOT/BOOT.conf
fi
fi
Show replies by date