Currently we get 'sduuid' in form of
[[ -z $sdblkid ]] && sdblkid=$(blkid -o full /dev/mmcblk*p1)
# 3 - Extract the UUID from $sdblkid via regex:
sduuid=$(echo "$sdblkid" | sed -nE 's/^.*[[:space:]]UUID="([0-9a-zA-Z-]*)".*/\1/p')
which outputs only UUID
78cdc7b8-0f2e-4444-ba7c-38aa26198de1
This is fine, as long as we use it correctly afterwards, but everytime we modifify fstab,
echo "${sduuid} /media/mmcboot ext4 ${mountopts[ext4]}" >> "${TempDir}"/rootfs/etc/fstab
echo "/media/mmcboot/boot /boot none bind 0 0" >> "${TempDir}"/rootfs/etc/fstab
which results in
# <file system> <mount point> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs defaults,nosuid 0 0
78cdc7b8-0f2e-4444-ba7c-38aa26198de1 /media/mmcboot ext4 defaults,noatime,commit=600,errors=remount-ro,x-gvfs-hide 0 1
/media/mmcboot/boot /boot none bind 0 0
UUID=52f9b8a6-b6ab-4e81-a362-5c4ca041d539 / ext4 defaults,noatime,commit=600,errors=remount-ro,x-gvfs-hide 0 1
Missing "UUID=" and prevents booting correctly.
But we cannot simply change sduuid, because on other steps it is used correctly. Maybe make clear which variable has the form of "UUID=XXXXX-XXX-XXXX" in their name, for better understanding, like
sduuid for only UUID ("blabla-bla") and sdwuuid für "UUID=blabla-bla".
Or use the lazy mode with a check before we modify fstab and add "UUID" as simple string.
Example log