1test_description="e2fsck with resize_inode" 2if ! test -x $DEBUGFS_EXE; then 3 echo "$test_name: $test_description: skipped (no debugfs)" 4 return 0 5fi 6 7FSCK_OPT=-yf 8OUT=$test_name.log 9if [ -f $test_dir/expect.gz ]; then 10 EXP=$test_name.tmp 11 gunzip < $test_dir/expect.gz > $EXP1 12else 13 EXP=$test_dir/expect 14fi 15 16dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 17 18echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT.new 19$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 >> $OUT.new 2>&1 20 21$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 22status=$? 23echo Exit status is $status >> $OUT.new 24 25echo ----------------------------------------------- >> $OUT.new 26 27echo " " >> $OUT.new 28echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" >> $OUT.new 29$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1 30status=$? 31echo Exit status is $status >> $OUT.new 32 33$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 34status=$? 35echo Exit status is $status >> $OUT.new 36 37$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 38status=$? 39echo Exit status is $status >> $OUT.new 40 41echo ----------------------------------------------- >> $OUT.new 42 43echo " " >> $OUT.new 44echo "debugfs -R ''clri <7>'' -w test.img" >> $OUT.new 45$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1 46status=$? 47echo Exit status is $status >> $OUT.new 48 49$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 50status=$? 51echo Exit status is $status >> $OUT.new 52 53$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 54status=$? 55echo Exit status is $status >> $OUT.new 56 57echo ----------------------------------------------- >> $OUT.new 58 59echo " " >> $OUT.new 60echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" >> $OUT.new 61$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1 62status=$? 63echo Exit status is $status >> $OUT.new 64 65$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 66status=$? 67echo Exit status is $status >> $OUT.new 68 69$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 70status=$? 71echo Exit status is $status >> $OUT.new 72 73echo ----------------------------------------------- >> $OUT.new 74 75echo " " >> $OUT.new 76echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" >> $OUT.new 77$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1 78status=$? 79echo Exit status is $status >> $OUT.new 80 81$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 82status=$? 83echo Exit status is $status >> $OUT.new 84 85echo ----------------------------------------------- >> $OUT.new 86 87echo " " >> $OUT.new 88echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" >> $OUT.new 89$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1 90status=$? 91echo Exit status is $status >> $OUT.new 92 93$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 94status=$? 95echo Exit status is $status >> $OUT.new 96 97$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 98status=$? 99echo Exit status is $status >> $OUT.new 100sed -f $cmd_dir/filter.sed $OUT.new > $OUT 101rm -f $OUT.new 102 103cmp -s $OUT $EXP 104status=$? 105 106if [ "$status" = 0 ] ; then 107 echo "$test_name: $test_description: ok" 108 touch $test_name.ok 109else 110 echo "$test_name: $test_description: failed" 111 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 112 rm -f tmp_expect 113fi 114 115unset IMAGE FSCK_OPT OUT EXP 116