[Fedora-livecd-list] [PATCH 1/3] livecd-iso-to-disk: Create ext3 if extlinux can't boot ext4

Lubomir Rintel lkundrak at v3.sk
Fri Mar 11 15:25:23 UTC 2011


This makes it possible to successfully use livecd-iso-to-disk with slightly
older syslinux, such as one in Oracle Enterprise Linux 6.
---
 tools/livecd-iso-to-disk.sh |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 8cdf86e..8e3b481 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -472,7 +472,7 @@ createEXTFSLayout() {
     getpartition ${device#/dev/}
     TGTDEV=${device}${partnum}
     umount $TGTDEV &> /dev/null
-    /sbin/mkfs.ext4 -L LIVE $TGTDEV
+    /sbin/mkfs.$TGTFS -L LIVE $TGTDEV
     TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
 }
 
@@ -553,6 +553,13 @@ checkSyslinuxVersion() {
     else
         SYSLINUXPATH="syslinux"
     fi
+    if [ ! -x /sbin/extlinux ]; then
+        TGTFS="vfat"
+    elif extlinux -v 2>&1 | grep -q 'extlinux 3'; then
+        TGTFS="ext3"
+    else
+        TGTFS="ext4"
+    fi
 }
 
 checkMounted() {
@@ -773,7 +780,8 @@ if [ -z "$noverify" ]; then
     fi
 fi
 
-#checkFilesystem $TGTDEV
+checkSyslinuxVersion
+
 # do some basic sanity checks.
 checkMounted $TGTDEV
 if [ -n "$format" -a -z "$skipcopy" ]; then
@@ -793,7 +801,6 @@ if [ -n "$efi" ]; then
     checkGPT $TGTDEV
 fi
 
-checkSyslinuxVersion
 # Because we can't set boot flag for EFI Protective on msdos partition tables
 [ -z "$efi" ] && checkPartActive $TGTDEV
 [ -n "$resetmbr" ] && resetMBR $TGTDEV
-- 
1.7.1



More information about the livecd mailing list