From: Artem Bityutskiy Date: Wed, 1 Jan 2014 14:23:22 +0000 (+0200) Subject: Fix installerfw environment save/restore X-Git-Tag: accepted/tizen/ivi/20140108.190104~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fddf16b8c31b3e901b9558348e35939fdb472ea;p=profile%2Fivi%2Fsetup-ivi.git Fix installerfw environment save/restore Change-Id: I39edcdf6571b19f423f48adfe439ed11f2df1379 Signed-off-by: Artem Bityutskiy --- diff --git a/installerfw-sh-functions b/installerfw-sh-functions index bfa4321..f8203d3 100644 --- a/installerfw-sh-functions +++ b/installerfw-sh-functions @@ -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 } diff --git a/setup-ivi-boot b/setup-ivi-boot index 13f2406..09336f0 100755 --- a/setup-ivi-boot +++ b/setup-ivi-boot @@ -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 diff --git a/setup-ivi-fstab b/setup-ivi-fstab index 100966c..a0c1153 100755 --- a/setup-ivi-fstab +++ b/setup-ivi-fstab @@ -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")"