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
sysfs /sys sysfs defaults 0 0"
pnum=0
-br="
-"
while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
+ installerfw_verify_defined "INSTALLERFW_PART${pnum}_UUID"
+ installerfw_verify_defined "INSTALLERFW_PART${pnum}_MOUNTPOINT"
+ installerfw_verify_defined "INSTALLERFW_PART${pnum}_FSTYPE"
+
eval uuid="\${INSTALLERFW_PART${pnum}_UUID:-}"
eval mountpoint="\${INSTALLERFW_PART${pnum}_MOUNTPOINT:-}"
eval fsopts="\${INSTALLERFW_PART${pnum}_FSOPTS:-defaults}"
eval fstype="\${INSTALLERFW_PART${pnum}_FSTYPE:-}"
+ if [ "$fstype" = "vfat" ]; then
+ # FAT FS's short UUID has to be uppercase
+ uuid="$(printf "%s" "$uuid" | tr "[:lower:]" "[:upper:]")"
+ else
+ # Normal UUID has to be lowercase
+ uuid="$(printf "%s" "$uuid" | tr "[:upper:]" "[:lower:]")"
+ fi
+
contents="${contents}${br}UUID=$uuid $mountpoint $fstype $fsopts 0 0"
pnum="$((pnum+1))"