setup-efi-ivi: document which environment variables we depend on
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 10:25:30 +0000 (13:25 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 26 Jun 2013 10:25:30 +0000 (13:25 +0300)
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
setup-efi-ivi

index f2d3bad..3d3dd96 100755 (executable)
@@ -4,6 +4,19 @@
 # Author: Artem Bityutskiy
 # License: GPLv2
 
+#
+# This is a simple script which installs gummiboot to the ESP and creates the
+# gummiboot configuration files. This script requires a number of environment
+# variables to be defined. Namely:
+#
+# 1. INSTALLERFW_PART_COUNT - count of paritions
+# 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
+#    "root" directory of the file-system we install gummiboot to)
+
 PROG="setup-efi-ivi"
 
 # This is a helper function which prints an error message and exits
@@ -14,7 +27,7 @@ fatal()
 }
 
 # Make sure the installer framework variables are defined
-[ "${INSTALLERFW_INSTALLER_NAME:+x}" == "x" ] ||
+[ "${INSTALLERFW_PART_COUNT:+x}" == "x" ] ||
        fatal "installer framework environment variables not found"
 
 # Find the root and boot paritions
@@ -28,11 +41,11 @@ while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
 
        # Find out all the required data for the root and boot partition
        if [ "$mountpoint" == "/" ]; then
-               root_partuuid=INSTALLERFW_PART${pnum}_PARTUUID
+               root_partuuid="INSTALLERFW_PART${pnum}_PARTUUID"
                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="INSTALLERFW_PART${pnum}_FSTYPE"
                boot_fstype="$(eval printf "%s" '$'$boot_fstype)"
        fi
 
@@ -67,7 +80,7 @@ vmlinuz_version="$(printf "%s" $vmlinuz | sed -e 's/vmlinuz-\(.*\)/\1/')"
 mkdir -p "$boot_mountpoint/loader"
 
 cat > "$boot_mountpoint/loader/loader.conf" <<-EOF
-timeout 0
+timeo ut 0
 default vmlinuz-$vmlinuz_version.conf
 EOF