setup-gummiboot-conf: use INSTALLERFW_MOUNT_PREFIX
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 11:30:22 +0000 (14:30 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 11:30:22 +0000 (14:30 +0300)
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
setup-gummiboot-conf

index 93b3443..fb21f8b 100755 (executable)
 # 4. The 'default' entry name does not have wildcards ("*")
 # 5. Kernels binaries are placed in the root of ESP
 #
-# May be there are few more implicit assumption. This all can be improved and
-# made to be more flexible if needed.
+# May be there are few more implicit assumption.
+#
+#This script requires a number of environment variables to be defined. Namely:
+#
+# 1. INSTALLERFW_MOUNT_PREFIX - where the target partitions are mounted (the
+#    "root" directory of the file-system we install gummiboot to)
 
 PROG="setup-gummiboot-conf"
 
@@ -31,10 +35,16 @@ fatal()
        exit 1
 }
 
-# Right now we assume that ESP is always in "/boot", but later we can add a
-# command line option for this.
-esp="/home/dedekind/tmp/boot"
+# Make sure the installer framework variables are defined
+[ "${INSTALLERFW_MOUNT_PREFIX:+x}" == "x" ] ||
+       fatal "installer framework environment variables not found"
+
+# Get the ESP location
+esp="$INSTALLERFW_MOUNT_PREFIX/boot"
+
+# The gummiboot configuration file
 conf_file="$esp/loader/loader.conf"
+# The gummiboot kernel entries directory
 entries_dir="$esp/loader/entries"
 
 # Make sure the gummiboot configuration file exists