setup-efi-ivi: always use the mount prefix variable 42/10242/1
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 25 Sep 2013 07:47:38 +0000 (10:47 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 25 Sep 2013 11:36:42 +0000 (14:36 +0300)
Installer framework exports the INSTALLERFW_MOUNT_PREFIX varable which
basically tells what is the root directory for the system image. Usually this
is just "/". But it may be something else too, for example, when we install the
system to a different disk, all the disk partitions will be temporarily mounted
somewhere like /mnt/install_disk/, and this will be the mount prefix.

So, the problem is that we did not use the mount prefix for searching for
gummiboot. It is really expected to be present on the target
system/environment, not in the system/environment we are currently running.
This patch fixes the issue.

Change-Id: Ic414087fcac454109b8c50aa01643a00886bcb8c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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)"