Skip to contentSkip to conversation

test-appliance: detect 'mkfs.f2fs -f' support by grepping help output

PATCH Applied Eric Biggers 2 participants 2 messages Apr 16, 2018 – Apr 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test-appliance: detect 'mkfs.f2fs -f' support by grepping help output

From: Eric Biggers <[email protected]>

Grep the help output rather than the binary itself. This matches the detection method that was implemented in xfstests common/config.

---
 kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kvm-xfstests/test-appliance/files/root/fs/f2fs/config +1 -1
index 0efcb76..b0c2196 100644
@@ -20,7 +20,7 @@ function format_filesystem()
     local dev="$1"
     local opts="$2"
 
-    if grep -q 'force overwrite' /sbin/mkfs.f2fs; then
+    if /sbin/mkfs.f2fs --help |& grep -q "[[:space:]]-f[[:space:]|]"; then
 	# f2fs-tools v1.9+
 	opts+=" -f"
     fi
Signature · 1 line
2.17.0.484.g0c8726318c-goog