From: Michael Prokop Date: Fri, 7 Mar 2014 23:52:28 +0000 (+0100) Subject: Abort if FIXED_DISK_IDENTIFIERS is set but mkfs.* does not match for ext{2,3,4} file... X-Git-Tag: v0.60~2 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=b9fc7bbd75268d05159068690a72733c51ce3896;hp=5a873a814c3c3b5be33b7142f853fc7dc924e498;ds=sidebyside Abort if FIXED_DISK_IDENTIFIERS is set but mkfs.* does not match for ext{2,3,4} file system --- diff --git a/grml-debootstrap b/grml-debootstrap index fd63e7d..9cd82a7 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -889,9 +889,15 @@ mkfs() { $MKFS $TARGET ; RC=$? if [ "$FIXED_DISK_IDENTIFIERS" = "yes" ] ; then - einfo "Changing disk uuid for $TARGET to fixed (non-random) value using tune2fs" - tune2fs "$TARGET" -U 26ada0c0-1165-4098-884d-aafd2220c2c6 - eend $? + if ! echo "$MKFS" | grep -q "mkfs.ext" ; then + eerror "Not changing disk uuid for $TARGET because $MKFS doesn't seem to match for ext{2,3,4} file system" + eend 1 + bailout 1 + else + einfo "Changing disk uuid for $TARGET to fixed (non-random) value using tune2fs" + tune2fs "$TARGET" -U 26ada0c0-1165-4098-884d-aafd2220c2c6 + eend $? + fi fi # make sure /dev/disk/by-uuid/... is up2date, otherwise grub