setup-efi-ivi: use less hard-coding
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 11:22:40 +0000 (14:22 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 11:25:54 +0000 (14:25 +0300)
We do require that the boot partition is under /boot. But let's do it in less
places. Once we know the boot partition number (N), use the
INSTALLERFW_PARTN_MOUNTPOINT instead.

Also, remove the vfat type checking - it is an unneeded complication.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
setup-efi-ivi

index 60dc818..7860497 100755 (executable)
@@ -13,8 +13,7 @@
 # 2. INSTALLERFW_PARTX_MOUNTPOINT - mount point of partition number X
 #    (0 <= x < $INSTALLERFW_PART_COUNT)
 # 3. INSTALLERFW_PARTX_PARTUUID - GPT GUID (AKA PARTUUID) of partition number X
-# 4. INSTALLERFW_PARTX_FSTYPE - which file-system format partition number X has
-# 5. INSTALLERFW_MOUNT_PREFIX - where the target partitions are mounted (the
+# 4. INSTALLERFW_MOUNT_PREFIX - where the target partitions are mounted (the
 #    "root" directory of the file-system we install gummiboot to)
 
 PROG="setup-efi-ivi"
@@ -30,10 +29,10 @@ fatal()
 [ "${INSTALLERFW_PART_COUNT:+x}" == "x" ] ||
        fatal "installer framework environment variables not found"
 
-# Find the root and boot paritions
+# Find the required root and boot parition parameters
 pnum=0
 root_partuuid=
-boot_fstype=
+boot_mountpoint=
 
 while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
        mountpoint="INSTALLERFW_PART${pnum}_MOUNTPOINT"
@@ -45,19 +44,14 @@ while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
                root_partuuid="$(eval printf "%s" '$'$root_partuuid)"
        # The boot parition has to be at "/boot"
        elif [ "$mountpoint" == "/boot" ]; then
-               boot_fstype="INSTALLERFW_PART${pnum}_FSTYPE"
-               boot_fstype="$(eval printf "%s" '$'$boot_fstype)"
+               boot_mountpoint="$mountpoint"
        fi
 
        pnum="$((pnum+1))"
 done
 
-# Make sure that the boot partition has a FAT file-system
-[ "$boot_fstype" == "vfat" ] || \
-       fatal "boot partition has to have type \"vfat\""
-
 # Get the ESP location
-esp="$INSTALLERFW_MOUNT_PREFIX/boot"
+esp="$INSTALLERFW_MOUNT_PREFIX/$boot_mountpoint"
 
 # Make sure gummiboot is installed in the system
 if ! ([ -f /usr/lib/gummiboot/gummibootia32.efi ] || \