From 371a46f3a2b8fb34de45436d600bf0433daad97a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 21 Mar 2014 18:19:02 +0100 Subject: [PATCH] invoke mkfs.btrfs with -f only if supported --- source/steps/InstallPartitionDisks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.43.0