Fix installerfw environment save/restore
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 1 Jan 2014 14:23:22 +0000 (16:23 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 1 Jan 2014 14:23:22 +0000 (16:23 +0200)
Change-Id: I39edcdf6571b19f423f48adfe439ed11f2df1379
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
installerfw-sh-functions
setup-ivi-boot
setup-ivi-fstab

index bfa4321..f8203d3 100644 (file)
@@ -116,7 +116,11 @@ installerfw_restore_env()
 # Check whether installer framework variables are defined
 installerfw_available()
 {
-       printenv | LC_ALL=C grep -q "^INSTALLERFW_[^[:blank:]]\+"
+       if printenv | LC_ALL=C grep -q "^INSTALLERFW_[^[:blank:]]\+"; then
+               return 0;
+       else
+               return 1;
+       fi
 }
 
 # Check if the system is an EFI boot system by checking whether the boot
@@ -133,11 +137,11 @@ installerfw_is_efi_boot_system()
        if [ "${INSTALLERFW_PTABLE_FORMAT:-}" = "gpt" ] && \
           [ "$__ptypeid" = "$__esp_ptypeid" ]; then
                __verbose "installerfw_is_efi_boot_system(): /boot is" \
-                         "the EFI system partition (type is" "\"$__ptypeid\")"
+                         "the EFI system partition"
                return 0
        else
                __verbose "installerfw_is_efi_boot_system(): no EFI" \
-                         "system partition found (type is" "\"$__ptypeid\")"
+                         "system partition found"
                return 1
        fi
 }
index 13f2406..09336f0 100755 (executable)
@@ -143,9 +143,7 @@ done
 bootdir="$(installerfw_mnt_prefix "/boot")"
 
 if installerfw_available; then
-       if ! [ -s "$(installerfw_get_env_file_name)" ]; then
-               installerfw_save_env
-       fi
+       installerfw_save_env
 else
        installerfw_restore_env
 fi
index 100966c..a0c1153 100755 (executable)
@@ -73,7 +73,9 @@ while true; do
        shift
 done
 
-installerfw_available || installerfw_restore_env
+if ! installerfw_available; then
+       installerfw_restore_env
+fi
 
 fstab="$(installerfw_mnt_prefix "/etc/fstab")"