X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-debootstrap;h=2d79d195518ff1b46a59623e4128c4d930ca7356;hb=efc738315b72365a6bb1c10e08beeffb674e99d5;hp=bf62dedaf7234972527dd8e50d8e662935226ddb;hpb=cbf40a49324ae7feb468e528a7845465304faaff;p=grml-debootstrap.git diff --git a/grml-debootstrap b/grml-debootstrap index bf62ded..2d79d19 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -662,9 +662,19 @@ mkfs() { if [ -n "$MKFS" ] ; then einfo "Running $MKFS on $TARGET" - $MKFS $TARGET - TARGET_UUID="$(vol_id -u $TARGET 2>/dev/null || echo '')" - eend $? + $MKFS $TARGET ; RC=$? + + # make sure /dev/disk/by-uuid/... is up2date, otherwise grub + # will fail to detect the uuid in the chroot + blockdev --rereadpt "${TARGET%%[0-9]*}" + # give the system 2 seconds, otherwise we might run into + # race conditions :-/ + sleep 2 + + eval $(blkid -o udev $TARGET 2>/dev/null) + [ -n "$ID_FS_UUID" ] && TARGET_UUID="$ID_FS_UUID" || TARGET_UUID="" + + eend $RC fi fi