srcdir="$(readlink -ev -- ${0%/*})"
PATH="/usr/share/setup-ivi:$srcdir:$PATH"
-. setup-ivi-sh-functions
-. 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")"
-# Save the installer framework variables
-installerfw_file="$(installerfw_get_env_file_name)"
-if [ -f "$installerfw_file" ]; then
- installerfw_restore_env
-else
+if installerfw_available; then
installerfw_save_env
+else
+ installerfw_restore_env
fi
# Get OS name
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\""
# Set the default kernel to the kernel with highest version
newest_kernel="$(get_newest_kernel "$bootdir")"
setup-ivi-bootloader-conf $verbose default "$newest_kernel"
+
+# And finally, create the /etc/fstab file
+setup-ivi-fstab $verbose --force