setup-ivi-fstab: use correct case
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Jan 2014 17:23:26 +0000 (19:23 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 8 Jan 2014 17:33:33 +0000 (19:33 +0200)
Apparently, mount is case-sensitive. The UUID for normal file-systems like ext4
must be lower case, just like it is in /dev/disk/by-uuid/. But the short FAT-FS
ID has to be all-capitals. Take this into account in 'setup-ivi-fstab'.

Also add a couple more checks to make sure the installer framework variables
that we use exist.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
setup-ivi-fstab

index 7f1440f..a91c19c 100755 (executable)
@@ -98,11 +98,23 @@ sysfs   /sys      sysfs   defaults        0 0"
 
 pnum=0
 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))"