After the rsync, the installed /etc/fstab will contain the UUIDs from
the raw image and thus do not correspond with the UUIDs needed for the
target partitions.
The fix here is to iterate through the partitions after install, get the
UUIDs from the output of 'blkid', and substituting the old UUIDs with
the new ones.
Change-Id: Iee478c2fc93f5685891c0e7374f23c5e85b05610
/sbin/extlinux -i ${TGTMNT}/boot/extlinux
}
+function fixup_fstab {
+ local pnum=0
+ local devpnum="$((pnum+1))"
+ local tmp=""
+ local srcuuid=""
+ local tgtuuid=""
+
+ while [ "$pnum" -lt "$INSTALLERFW_PART_COUNT" ]; do
+ tmp="INSTALLERFW_PART${pnum}_UUID"
+ srcuuid=${!tmp}
+
+ tgtuuid=$(blkid ${TARGET_DEV}${devpnum} | sed 's/.* UUID="\([^"]*\)".*/\1/')
+ sed -i "s/.*\(UUID=\).*${srcuuid}\(.*\)/\1${tgtuuid}\2/" ${TGTMNT}/etc/fstab
+
+ pnum="$((pnum+1))"
+ devpnum="$((devpnum+1))"
+ done
+}
+
function install_os {
rsync -WaHXSh --exclude='/dev/' --exclude='/lost+found/' --exclude='/media/*' --exclude='/sys/' --exclude='/proc/' --exclude="/tmp/" --exclude="/run/" $SRCOSMNT/ $TGTMNT
# TODO: switch to using systemd mount units instead of the fstab
#rm ${TGTMNT}/etc/fstab
+ fixup_fstab
+
if [[ $FILESYSTEM = "btrfs" ]]; then
ROOTFLAGS="rootflags=subvol=tizen"
else