ext4: define MKFS_EXT4_PROG
authorTheodore Ts'o <tytso@mit.edu>
Mon, 29 Sep 2014 02:46:43 +0000 (12:46 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 29 Sep 2014 02:46:43 +0000 (12:46 +1000)
And use it instead of "mkfs.ext4" / "mkfs -t ext4"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/config
common/rc
tests/btrfs/012
tests/ext4/003
tests/ext4/306

index fc21b3753646adada18f09e0f9eb43a33ae75926..d68d4d0c5d034deb63b430cc11625d970dc1881c 100644 (file)
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         ;;
     Linux)
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
+        export MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
index b8f711a5781091af89395d6cf42cd10d81fec92b..35d7d5dcc064a869734c2e197f4f5dc6c0bd4bbc 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
         [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
         ;;
+    ext4)
+        [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
+        ;;
     nfs)
         ;;
     cifs)
@@ -459,7 +462,7 @@ _scratch_mkfs_ext4()
 
        local tmp_dir=/tmp/
 
-       /sbin/mkfs -t ext4 -- -F $MKFS_OPTIONS $extra_mkfs_options $SCRATCH_DEV \
+       $MKFS_EXT4_PROG -F $MKFS_OPTIONS $extra_mkfs_options $SCRATCH_DEV \
                        2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd
        local mkfs_status=$?
 
@@ -474,7 +477,7 @@ _scratch_mkfs_ext4()
                ) >> $seqres.full
 
                # running mkfs again. overwrite previous mkfs output files
-               /sbin/mkfs -t ext4 -- -F $extra_mkfs_options $SCRATCH_DEV \
+               $MKFS_EXT4_PROG -F $extra_mkfs_options $SCRATCH_DEV \
                                2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd
                local mkfs_status=$?
        fi
index f7e5da5c7566b80d39d53c68695359fc7c39a847..124c8ae007294b0eabf55842b908c608aa8c7af5 100755 (executable)
@@ -55,7 +55,6 @@ _supported_os Linux
 _require_scratch
 
 BTRFS_CONVERT_PROG="`set_prog_path btrfs-convert`"
-MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
 E2FSCK_PROG="`set_prog_path e2fsck`"
 
 _require_command $BTRFS_CONVERT_PROG btrfs-convert
index 572e685d5cd113086990dec0ba4005cc12cf92f9..fde0e9c1bf7470258dad622bbdb8d3df2b881f52 100755 (executable)
@@ -43,7 +43,7 @@ _require_ext4_bigalloc
 
 rm -f $seqres.full
 
-yes | mkfs.ext4 -O bigalloc -C 65536  -g 256 $SCRATCH_DEV 512m \
+yes | $MKFS_EXT4_PROG -O bigalloc -C 65536  -g 256 $SCRATCH_DEV 512m \
        >> $seqres.full 2>&1
 _scratch_mount || _fail "couldn't mount fs"
 
index fd50b0e871de73f32f5bd778f830a22b66a95806..caffe0e441cd60ccf5baff074c0772ad76303a23 100755 (executable)
@@ -48,7 +48,7 @@ _require_scratch
 rm -f $seqres.full
 
 # Make a small ext4 fs with extents disabled & mount it
-yes | mkfs.ext4 -O ^extents,^64bit $SCRATCH_DEV 512m >> $seqres.full 2>&1
+yes | $MKFS_EXT4_PROG -O ^extents,^64bit $SCRATCH_DEV 512m >> $seqres.full 2>&1
 _scratch_mount || _fail "couldn't mount fs"
 
 # Create a small non-extent-based file