1FSCK_OPT=-yf
2
3# use current directory instead of /tmp becase tmpfs doesn't support DIO
4rm -f $TMPFILE
5TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
6
7stat -f $TMPFILE | grep -q "Type: tmpfs"
8if [ $? = 0 ] ; then
9	rm -f $TMPFILE
10	echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
11	return 0
12fi
13
14echo "make the test image ..." > $test_name.log
15$MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1
16status=$?
17if [ "$status" != 0 ] ; then
18	echo "mke2fs -O mmp failed" > $test_name.failed
19	echo "$test_name: $test_description: failed"
20	return $status
21fi
22
23# create a corrupted image
24echo "modify the mmp sequence ..." >> $test_name.log
25$DEBUGFS -w -R "set_mmp_value magic 0x12345678" $TMPFILE >> $test_name.log 2>&1
26
27SKIP_GUNZIP=true
28. $cmd_dir/run_e2fsck
29