4 # cross check mkfs detection of foreign filesystems
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 # get standard environment, filters and checks
26 # real QA test starts here
33 echo "Silence is golden."
34 for fs in `echo /sbin/mkfs.* | sed -e 's/.sbin.mkfs.//g'`
36 preop="" # for special input needs
37 preargs="" # for any special pre-device options
38 postargs="" # for any special post-device options
40 # minix, msdos and vfat mkfs fails for large devices, restrict to 2000 blocks
41 [ $fs = minix ] && postargs=2000
42 [ $fs = msdos ] && postargs=2000
43 [ $fs = vfat ] && postargs=2000
44 # these folks prompt before writing
45 [ $fs = jfs ] && preop="echo Y |"
46 [ $fs = reiserfs ] && preop="echo y |"
47 # cramfs mkfs requires a directory argument
48 [ $fs = cramfs ] && preargs=/proc/fs/xfs
50 # overwite the first few Kb - should blow away superblocks
51 src/devzero -n 20 $SCRATCH_DEV >/dev/null
53 # create a filesystem of this type
54 echo "=== Creating $fs filesystem..." >>$seq.full
55 echo " ( mkfs -t $fs $SCRATCH_DEV )" >>$seq.full
56 eval $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs >>$seq.full 2>&1
58 # next, ensure we don't overwrite it
59 echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
60 /sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
62 [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"