[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Fedora-livecd-list] [PATCH] Using both EFI and MBR at once on Live USB images and other misc. fixes



On 1/26/09 9:52 PM, Jeremy Katz wrote:

Applied, thanks!

Jeremy
Thanks for commiting it so fast! I've been testing the two configurations all night, and funnily enough the gpt+mbr setup works better than the mbr setup alone on my home machine: If I don't specify --mactel, I can boot in QEMU fine but my machine (GA-965P-S3 mobo) refuses to boot it, saying that it can't find the kernel image for "linux".

There's also a small bug that I forgot to account for in the last patch - $BOOTCONFIG is overwritten if --mactel is set, so the syslinux.cfg file is left in an inconsistent state with root=CDLABEL=<...> and rootfstype=iso9660. The attached patch fixes this problem by using $BOOTCONFIG and $BOOTCONFIG_EFI.

Stewart
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 85dba7e..c310936 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -509,6 +509,8 @@ fi
 
 cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
 BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
+# Set this to nothing so sed doesn't care
+BOOTCONFIG_EFI=
 if [ -n "$mactel" ];then
   if [ -d $CDMNT/EFI/boot ]; then
     cp $CDMNT/EFI/boot/* $USBMNT/EFI/boot
@@ -541,14 +543,14 @@ EOF
   fi
 
   # this is a little ugly, but it gets the "interesting" named config file
-  BOOTCONFIG=$USBMNT/EFI/boot/boot?*.conf
+  BOOTCONFIG_EFI=$USBMNT/EFI/boot/boot?*.conf
   rm -f $USBMNT/EFI/boot/grub.conf
 fi
 
 echo "Updating boot config file"
 # adjust label and fstype
-sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $BOOTCONFIG
-if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG ; fi
+sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $BOOTCONFIG  $BOOTCONFIG_EFI
+if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
 
 if [ "$overlaysizemb" -gt 0 ]; then
     echo "Initializing persistent overlay file"
@@ -559,8 +561,8 @@ if [ "$overlaysizemb" -gt 0 ]; then
     else
 	dd if=/dev/null of=$USBMNT/LiveOS/$OVERFILE count=1 bs=1M seek=$overlaysizemb
     fi
-    sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG
-    sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG
+    sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI
+    sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG  $BOOTCONFIG_EFI
 fi
 
 if [ "$swapsizemb" -gt 0 ]; then

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]