- # make sure /dev/disk/by-uuid/... is up2date, otherwise grub
- # will fail to detect the uuid in the chroot
- if echo "$TARGET" | grep -q "/dev/md" ; then
- blockdev --rereadpt "${TARGET}"
- elif ! [ -n "$VIRTUAL" ] ; then
- blockdev --rereadpt "${TARGET%%[0-9]*}"
- fi
- # give the system 2 seconds, otherwise we might run into
- # race conditions :-/
- sleep 2
+ # mkfs.ext* might prompt with "/dev/sdX# contains a ext* file system
+ # created on ... Proceed anyway? (y,n)" which we want to skip in force mode
+ if [ -n "$MKFS" ] && [ -n "$FORCE" ] ; then
+ case "$MKFS" in
+ mkfs.ext*)
+ einfo "Enabling force option (-F) for mkfs.ext* tool as requested via --force switch."
+ MKFS_OPTS="$MKFS_OPTS -F"
+ eend 0
+ ;;
+ esac
+ fi
+
+ if [ -n "$MKFS" ] ; then
+ einfo "Running $MKFS $MKFS_OPTS on $TARGET"
+ $MKFS $MKFS_OPTS $TARGET ; RC=$?