]>
Commit | Line | Data |
---|---|---|
108cfeca KZ |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) 2009 Karel Zak <kzak@redhat.com> | |
4 | # | |
601d12fb | 5 | # This file is part of util-linux. |
108cfeca KZ |
6 | # |
7 | # This file is free software; you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation; either version 2 of the License, or | |
10 | # (at your option) any later version. | |
11 | # | |
12 | # This file is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
e130ce53 | 17 | TS_TOPDIR="${0%/*}/../.." |
716133fc | 18 | TS_DESC="mkfs fsck" |
108cfeca | 19 | |
86aa0ee7 | 20 | . $TS_TOPDIR/functions.sh |
108cfeca | 21 | ts_init "$*" |
2f791546 SK |
22 | |
23 | ts_check_test_command "$TS_CMD_MKMINIX" | |
716133fc RM |
24 | ts_check_test_command "$TS_CMD_FSCKMINIX" |
25 | ||
26 | mkfs_and_fsck_minix() { | |
27 | local ret | |
28 | ts_log "#####################################" | |
cbf858aa KZ |
29 | ts_log_both "$ mkfs.minix $1 image" |
30 | $TS_CMD_MKMINIX $1 $img >> $TS_OUTPUT 2>> $TS_ERRLOG | |
716133fc RM |
31 | ret=$? |
32 | echo "return mkfs: $ret" >> $TS_OUTPUT | |
33 | test $ret = 0 || return $ret | |
34 | ||
cbf858aa KZ |
35 | ts_log_both "$ fsck.minix -lavsf image" |
36 | $TS_CMD_FSCKMINIX -lavsf $img >> $TS_OUTPUT 2>> $TS_ERRLOG | |
716133fc RM |
37 | ret=$? |
38 | echo "return fsck: $ret" >> $TS_OUTPUT | |
39 | return $ret | |
40 | } | |
41 | ||
42 | img=$(ts_image_init) | |
43 | ||
44 | # TODO looping over arbitrary badblock files (-l bad) gives a lot segfaults | |
45 | for ver in "" "-1" "-2" "-3"; do | |
46 | for n in "" "-n 14" "-n 30" "-n 60"; do | |
47 | mkfs_and_fsck_minix "$ver $n" | |
48 | done | |
49 | done | |
50 | ||
51 | rm -f $img | |
52 | ||
53 | sed -i "s@$img@image@g" $TS_OUTPUT | |
108cfeca | 54 | |
108cfeca KZ |
55 | ts_finalize |
56 |