setup-efi-ivi: always use the mount prefix variable
[profile/ivi/setup-efi-ivi.git] / setup-efi-ivi
index 209d5ed..f5d9356 100755 (executable)
@@ -50,21 +50,23 @@ while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
        pnum="$((pnum+1))"
 done
 
-# Get the ESP location
-esp="$INSTALLERFW_MOUNT_PREFIX/$boot_mountpoint"
-
+# Path to the gummiboot files
+gummiboot_path="$INSTALLERFW_MOUNT_PREFIX/usr/lib/gummiboot"
 # Make sure gummiboot is installed in the system
-if ! ([ -f /usr/lib/gummiboot/gummibootia32.efi ] || \
-      [ -f /usr/lib/gummiboot/gummibootx64.efi ]); then
-       fatal "\"/usr/lib/gummiboot/gummiboot*.efi\" files not found!"
+if ! ([ -f $gummiboot_path/gummibootia32.efi ] || \
+      [ -f $gummiboot_path/gummibootx64.efi ]); then
+       fatal "\"$gummiboot_path/gummiboot*.efi\" files not found!"
 fi
 
+# Get the ESP location
+esp="$INSTALLERFW_MOUNT_PREFIX/$boot_mountpoint"
+
 # Install gummiboot
 mkdir -p "$esp/EFI/boot"
-[ -f "/usr/lib/gummiboot/gummibootia32.efi" ] &&
-       cp "/usr/lib/gummiboot/gummibootia32.efi" "$esp/EFI/boot/bootia32.efi"
-[ -f "/usr/lib/gummiboot/gummibootx64.efi" ] &&
-       cp "/usr/lib/gummiboot/gummibootx64.efi" "$esp/EFI/boot/bootx64.efi"
+[ -f "$gummiboot_path/gummibootia32.efi" ] &&
+       cp "$gummiboot_path/gummibootia32.efi" "$esp/EFI/boot/bootia32.efi"
+[ -f "$gummiboot_path/gummibootx64.efi" ] &&
+       cp "$gummiboot_path/gummibootx64.efi" "$esp/EFI/boot/bootx64.efi"
 
 # Generate the list of installed kernels
 kernels="$(ls -1 "$esp" | grep "^vmlinuz-" | sort -r | head -n1)"