X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=40480d2553e54de6ecdf62023a6df40f94f80156;hp=bf62dedaf7234972527dd8e50d8e662935226ddb;hb=ecdab0450adbba4a475979cca7bce3807b5ab908;hpb=cbf40a49324ae7feb468e528a7845465304faaff diff --git a/grml-debootstrap b/grml-debootstrap index bf62ded..40480d2 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -11,7 +11,7 @@ set -e # exit on any error # variables {{{ PN="$(basename $0)" -VERSION='0.31' +VERSION='0.32' MNTPOINT="/mnt/debootstrap.$$" # inside the chroot system locales might not be available, so use minimum: @@ -163,6 +163,21 @@ fi } # }}} +# backwards compability checks {{{ +if [ -n "$GROOT" ] ; then + echo "Error: you seem to have \$GROOT configured." >&2 + echo "This variable is no longer supported, please visit the" >&2 + echo "grml-debootstrap documentation for details." >&2 + exit 1 +fi + +if echo "$GRUB" | grep -q '^hd' ; then + echo "Error: this syntax for the grub configuration variable is no longer supported." >&2 + echo "Please do not use hd... any longer but /dev/sdX instead." >&2 + exit 1 +fi +# }}} + # welcome screen {{{ welcome_dialog() { @@ -662,9 +677,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