setup-gummiboot-conf: Set background to black
[platform/adaptation/setup-scripts.git] / installerfw-sh-functions
index 4f6374e..bee4a19 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2013 Intel Corporation
+# Copyright 2013-2014 Intel Corporation
 # Author: Artem Bityutskiy
 # License: GPLv2
 
@@ -42,9 +42,7 @@ installerfw_verify_defined()
 # tripple "/" in the resulting path.
 installerfw_mnt_prefix()
 {
-       installerfw_verify_defined "INSTALLERFW_MOUNT_PREFIX"
-
-       local path="$INSTALLERFW_MOUNT_PREFIX/$1"
+       local path="${INSTALLERFW_MOUNT_PREFIX:-}/$1"
 
        printf "%s" "$path" | LC_ALL=C sed -e 's/\/\+/\//g'
 }
@@ -77,16 +75,17 @@ installerfw_save_env()
 -e '^INSTALLERFW_PART[[:digit:]]\+_UUID=' \
 -e '^INSTALLERFW_PART_COUNT=' \
 -e '^INSTALLERFW_PTABLE_FORMAT=' \
+-e '^INSTALLERFW_INSTALLER_NAME=' \
 "
 
        local variables="$(printenv | eval "LC_ALL=C grep $opts")"
 
-       if [ "$(printf "%s" "$variables" | wc -l)" -eq "0" ]; then
+       if [ "$(printf "%s\n" "$variables" | wc -l)" -eq "0" ]; then
                __fatal "no installer framework environment variables" \
                        "found, nothing to save"
        fi
 
-       printf "%s" "$variables" | LC_ALL=C sed -n -e \
+       printf "%s\n" "$variables" | LC_ALL=C sed -n -e \
                "s/\(^INSTALLERFW_[^=]\+\)=\(.*\)/\1=\"\2\"/p" > "$file"
        __verbose "installerfw_save_env(): saved installer framework" \
                  "environment in \"$file\""
@@ -102,7 +101,7 @@ installerfw_restore_env()
                        "installer framework environment: can't find" \
                        "\"$file\""
 
-       while IFS= read -r line; do
+       while IFS= read -r line || [ -n "$line" ]; do
                eval "export $line"
        done < "$file"