From: Thierry Parmentelat Date: Fri, 21 Mar 2014 17:19:02 +0000 (+0100) Subject: invoke mkfs.btrfs with -f only if supported X-Git-Tag: bootmanager-5.2-3~1 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=371a46f3a2b8fb34de45436d600bf0433daad97a invoke mkfs.btrfs with -f only if supported --- diff --git a/source/steps/InstallPartitionDisks.py b/source/steps/InstallPartitionDisks.py index f5382d1..dc14016 100644 --- a/source/steps/InstallPartitionDisks.py +++ b/source/steps/InstallPartitionDisks.py @@ -181,7 +181,13 @@ def Run( vars, log ): utils.sysexec_noerr( "tune2fs -c -1 -i 0 %s" % devname, log) else: log.write("formatting %s btrfs partition (%s).\n" % (fs,devname)) - utils.sysexec( "mkfs.btrfs -f %s" % (devname), log ) + # early BootCD's seem to come with a version of mkfs.btrfs that does not support -f + # let's check for that before invoking it + mkfs="mkfs.btrfs" + if os.system("mkfs.btrfs --help 2>&1 | grep force")==0: + mkfs+=" -f" + mkfs+=" %s"%devname + utils.sysexec( mkfs, log ) # as of 2013/02 it looks like there's not yet an option to set fsck frequency with btrfs # save the list of block devices in the log