srcdir="$(readlink -ev -- ${0%/*})"
PATH="/usr/share/setup-ivi:$srcdir:$PATH"
-. "$srcdir/setup-ivi-sh-functions"
-. "$srcdir/installerfw-sh-functions"
+if [ -f "$srcdir/setup-ivi-sh-functions" ]; then
+ . "$srcdir/setup-ivi-sh-functions"
+ . "$srcdir/installerfw-sh-functions"
+else
+ . /usr/share/setup-ivi/setup-ivi-sh-functions
+ . /usr/share/setup-ivi/installerfw-sh-functions
+fi
# This is a small trick which I use to make sure my scripts are portable -
# check if 'dash' is present, and if yes - use it.
if can_switch_to_dash; then
- exec dash -euf "$srcdir/$PROG" "$@"
+ exec dash -euf -- "$srcdir/$PROG" "$@"
exit $?
fi
fi
# Install gummiboot
- mkdir -p $verbose "$installdir" >&2
+ mkdir -p $verbose -- "$installdir" >&2
[ -f "$gummiboot_path/gummibootia32.efi" ] && \
cp $verbose "$gummiboot_path/gummibootia32.efi" \
"$installdir/bootia32.efi" >&2
"variable is not defined"
# Install extlinux
- mkdir -p $verbose "$installdir" >&2
+ mkdir -p $verbose -- "$installdir" >&2
"$extlinux" --device "$boot_devnode" -i "$installdir" || \
fatal "cannot install extlinux to \"$installdir\"" \
"(requires extlinux version 5 or greater)"
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
fi
# Create bootloader entries for each kernel
-kernels="$(ls -1 "$bootdir" | LC_ALL=C grep "^vmlinuz-" | sort -r)"
+kernels="$(ls -1 "$bootdir" | LC_ALL=C grep -- "^vmlinuz-" | sort -r)"
[ -n "$kernels" ] || \
fatal "no kernels (vmlinuz-*) found in \"$bootdir\""