1 printf "e2fsck with resize_inode: " 2 FSCK_OPT=-yf 3 OUT=$test_name.log 4 if [ -f $test_dir/expect.gz ]; then 5 EXP=tmp_expect 6 gunzip < $test_dir/expect.gz > $EXP1 7 else 8 EXP=$test_dir/expect 9 fi 10 11 cp /dev/null $OUT 12 13 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 14 15 echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT 16 $MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 \ 17 | sed -e '1d' | grep -v "automatically checked" | 18 grep -v "whichever comes first" >> $OUT 19 20 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 21 status=$? 22 echo Exit status is $status >> $OUT.new 23 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 24 rm -f $OUT.new 25 26 echo ----------------------------------------------- >> $OUT 27 28 echo " " >> $OUT 29 echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w $TMPFILE" > $OUT.new 30 $DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1 31 status=$? 32 echo Exit status is $status >> $OUT.new 33 sed -e '2d' $OUT.new >> $OUT 34 35 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 36 status=$? 37 echo Exit status is $status >> $OUT.new 38 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 39 rm -f $OUT.new 40 41 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 42 status=$? 43 echo Exit status is $status >> $OUT.new 44 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 45 rm -f $OUT.new 46 47 echo ----------------------------------------------- >> $OUT 48 49 echo " " >> $OUT 50 echo "debugfs -R ''clri <7>'' -w $TMPFILE" > $OUT.new 51 $DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1 52 status=$? 53 echo Exit status is $status >> $OUT.new 54 sed -e '2d' $OUT.new >> $OUT 55 56 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 57 status=$? 58 echo Exit status is $status >> $OUT.new 59 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 60 rm -f $OUT.new 61 62 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 63 status=$? 64 echo Exit status is $status >> $OUT.new 65 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 66 rm -f $OUT.new 67 68 echo ----------------------------------------------- >> $OUT 69 70 echo " " >> $OUT 71 echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w $TMPFILE" > $OUT.new 72 $DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1 73 status=$? 74 echo Exit status is $status >> $OUT.new 75 sed -e '2d' $OUT.new >> $OUT 76 77 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 78 status=$? 79 echo Exit status is $status >> $OUT.new 80 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 81 rm -f $OUT.new 82 83 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 84 status=$? 85 echo Exit status is $status >> $OUT.new 86 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 87 rm -f $OUT.new 88 89 echo ----------------------------------------------- >> $OUT 90 91 echo " " >> $OUT 92 echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w $TMPFILE" > $OUT.new 93 $DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1 94 status=$? 95 echo Exit status is $status >> $OUT.new 96 sed -e '2d' $OUT.new >> $OUT 97 98 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 99 status=$? 100 echo Exit status is $status >> $OUT.new 101 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 102 rm -f $OUT.new 103 104 echo ----------------------------------------------- >> $OUT 105 106 echo " " >> $OUT 107 echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w $TMPFILE" > $OUT.new 108 $DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1 109 status=$? 110 echo Exit status is $status >> $OUT.new 111 sed -e '2d' $OUT.new >> $OUT 112 113 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 114 status=$? 115 echo Exit status is $status >> $OUT.new 116 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 117 rm -f $OUT.new 118 119 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 120 status=$? 121 echo Exit status is $status >> $OUT.new 122 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 123 rm -f $OUT.new 124 125 126 rm -f $test_name.ok $test_name.failed 127 cmp -s $OUT $EXP 128 status=$? 129 130 if [ "$status" = 0 ] ; then 131 echo "ok" 132 touch $test_name.ok 133 else 134 echo "failed" 135 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 136 rm -f tmp_expect 137 fi 138 139 unset IMAGE FSCK_OPT OUT EXP 140 141