setup-efi-ivi: do not assume that boot partition in in /boot
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 10:02:36 +0000 (13:02 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 10:02:36 +0000 (13:02 +0300)
Do not assume that the boot partition is currently mounted under /boot. In
pc-installer environment it can be mounted under a different directory.

Instead, use the INSTALLERFW_MOUNT_PREFIX variable to find the path to the boot
partition. This should let pc-installer use this script as well.

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

index 1520adf..ad5adf8 100755 (executable)
@@ -13,8 +13,6 @@ fatal()
        exit 1
 }
 
-boot_mountpoint="/boot"
-
 # Make sure the installer framework variables are defined
 [ "x$INSTALLERFW_INSTALLER_NAME" != "x" ] ||
        fatal "installer framework environment variables not found"
@@ -32,7 +30,8 @@ while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
        if [ "$mountpoint" == "/" ]; then
                root_partuuid=INSTALLERFW_PART${pnum}_PARTUUID
                root_partuuid="$(eval printf "%s" '$'$root_partuuid)"
-       elif [ "$mountpoint" == "$boot_mountpoint" ]; then
+       # 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)"
        fi
@@ -44,6 +43,9 @@ done
 [ "$boot_fstype" == "vfat" ] || \
        fatal "boot partition has to have type \"vfat\""
 
+# Find the current path to the boot partition
+boot_mountpoint="$INSTALLERFW_MOUNT_PREFIX/boot"
+
 # Make sure gummiboot is installed in the system
 if ! ([ -f /usr/lib/gummiboot/gummibootia32.efi ] || \
       [ -f /usr/lib/gummiboot/gummibootx64.efi ]); then