]>
Commit | Line | Data |
---|---|---|
355eceba KZ |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) 2009 Karel Zak <kzak@redhat.com> | |
4 | # | |
601d12fb | 5 | # This file is part of util-linux. |
355eceba 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%/*}/../.." |
355eceba KZ |
18 | TS_DESC="is mounted" |
19 | ||
20 | . $TS_TOPDIR/functions.sh | |
21 | ts_init "$*" | |
2f791546 SK |
22 | |
23 | ts_check_test_command "$TS_CMD_FDISK" | |
24 | ts_check_test_command "$TS_CMD_MOUNT" | |
19e00ec9 KZ |
25 | ts_check_test_command "$TS_CMD_UMOUNT" |
26 | ts_check_test_command "$TS_HELPER_ISMOUNTED" | |
2f791546 | 27 | |
355eceba | 28 | ts_skip_nonroot |
a5b45f2f | 29 | ts_check_losetup |
ee6c0ca6 | 30 | ts_check_prog "mkfs.ext3" |
355eceba | 31 | |
355eceba KZ |
32 | > $TS_OUTPUT |
33 | ||
cbae7931 RM |
34 | ts_device_init |
35 | DEVICE=$TS_LODEV | |
355eceba | 36 | |
f1849be9 | 37 | mkfs.ext3 $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" |
355eceba | 38 | |
f1849be9 | 39 | ts_device_has "TYPE" "ext3" $DEVICE || ts_die "Cannot find ext3 on $DEVICE" |
355eceba KZ |
40 | |
41 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | |
42 | ||
cbf858aa | 43 | $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG |
355eceba KZ |
44 | |
45 | # test by ismounted.c | |
cbf858aa | 46 | $TS_HELPER_ISMOUNTED $DEVICE | awk '{print $1}' >> $TS_OUTPUT 2>> $TS_ERRLOG |
355eceba | 47 | |
f1849be9 | 48 | $TS_CMD_UMOUNT $DEVICE || ts_die "Cannot umount $DEVICE" |
355eceba | 49 | |
355eceba | 50 | ts_finalize |