diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-06-26 12:21:37 +0300 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-06-26 12:21:37 +0300 |
commit | d1bb1a20f03f1124d2897e8bb929cef80c0a1c86 (patch) | |
tree | 7f37daca25e26530af8260209498f47c627c055e | |
parent | 11c8f614e266e09180261954d70e41a9088be431 (diff) | |
download | setup-efi-ivi-d1bb1a20f03f1124d2897e8bb929cef80c0a1c86.tar.gz setup-efi-ivi-d1bb1a20f03f1124d2897e8bb929cef80c0a1c86.tar.bz2 setup-efi-ivi-d1bb1a20f03f1124d2897e8bb929cef80c0a1c86.zip |
setup-efi-ivi: use printf instead of echo
This is better because echo is very different in different shells, and
interpret various special bytes differently, and its behavior may sometimes be
very surprizing.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | packaging/setup-efi-ivi.spec | 1 | ||||
-rwxr-xr-x | setup-efi-ivi | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/packaging/setup-efi-ivi.spec b/packaging/setup-efi-ivi.spec index 77c6b31..023ef45 100644 --- a/packaging/setup-efi-ivi.spec +++ b/packaging/setup-efi-ivi.spec @@ -10,6 +10,7 @@ Requires: gummiboot Requires: /usr/bin/sed Requires: /usr/bin/sort Requires: /usr/bin/grep +Requires: /usr/bin/printf ExclusiveArch: %{ix86} x86_64 %description diff --git a/setup-efi-ivi b/setup-efi-ivi index 7f00b92..22ae9a0 100755 --- a/setup-efi-ivi +++ b/setup-efi-ivi @@ -9,7 +9,7 @@ PROG="setup-efi-ivi" # This is a helper function which prints an error message and exits fatal() { - echo "$PROG: error: $1" 1>&2 + printf "%s\n" "$PROG: error: $1" 1>&2 exit 1 } @@ -26,15 +26,15 @@ boot_fstype= while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do mountpoint="INSTALLERFW_PART${pnum}_MOUNTPOINT" - mountpoint="$(eval echo '$'$mountpoint)" + mountpoint="$(eval printf "%s" '$'$mountpoint)" # Find out all the required data for the root and boot partition if [ "$mountpoint" == "/" ]; then root_partuuid=INSTALLERFW_PART${pnum}_PARTUUID - root_partuuid="$(eval echo '$'$root_partuuid)" + root_partuuid="$(eval printf "%s" '$'$root_partuuid)" elif [ "$mountpoint" == "$boot_mountpoint" ]; then boot_fstype=INSTALLERFW_PART${pnum}_FSTYPE - boot_fstype="$(eval echo '$'$boot_fstype)" + boot_fstype="$(eval printf "%s" '$'$boot_fstype)" fi pnum="$((pnum+1))" @@ -59,7 +59,7 @@ mkdir -p "$boot_mountpoint/EFI/boot" # Find out the latest kernel binary in boot partition vmlinuz="$(ls -1 "$boot_mountpoint" | grep "^vmlinuz-" | sort -r | head -n1)" -vmlinuz_version="$(echo $vmlinuz | sed -e 's/vmlinuz-\(.*\)/\1/')" +vmlinuz_version="$(printf "%s" $vmlinuz | sed -e 's/vmlinuz-\(.*\)/\1/')" # Create the gummiboot configuration file mkdir -p "$boot_mountpoint/loader" |