1if test -x $DEBUGFS_EXE; then 2 3test_description="create fs image from /dev" 4MKFS_DIR=/dev 5OUT=$test_name.log 6 7$MKE2FS -q -F -o Linux -T ext4 -O metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -d $MKFS_DIR $TMPFILE 16384 > $OUT 2>&1 8mkfs_status=$? 9 10$DUMPE2FS $TMPFILE >> $OUT 2>&1 11$DEBUGFS -R 'ls /' $TMPFILE >> $OUT 2>&1 12 13$FSCK -f -n $TMPFILE >> $OUT 2>&1 14fsck_status=$? 15 16sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp 17mv $OUT.tmp $OUT 18 19if [ $mkfs_status -ne 0 ]; then 20 echo "$test_name: $test_description: skipped" 21elif [ $mkfs_status -eq 0 ] && [ $fsck_status -eq 0 ]; then 22 echo "$test_name: $test_description: ok" 23 touch $test_name.ok 24else 25 echo "$test_name: $test_description: failed" 26fi 27 28rm -rf $TMPFILE.cmd $OUT.sed 29unset MKFS_DIR OUT EXP 30 31else #if test -x $DEBUGFS_EXE; then 32 echo "$test_name: $test_description: skipped" 33fi 34