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