2 # operate on a very small (1-sector) "disk"
4 # Copyright (C) 2009-2011 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 . "${srcdir=.}/init.sh"; path_prepend_ ../parted
26 dd if=/dev/null of=$dev bs=1 seek=$ss || framework_failure
28 # create an msdos partition table:
29 # Before parted-2.1, without -s, this would fail with a bogus diagnostic:
30 # Error: Success during read on .../tests/loop-file
31 # Retry/Ignore/Cancel? ^C
32 parted $opt $dev mklabel msdos ---pretend-input-tty </dev/null > out 2>&1 \
35 sed 's/.*WARNING: You are not superuser.*//;/^$/d' out > k && mv k out \
37 # When run as root, there are just curses-related control chars. Remove them.
38 sed 's/^.\{1,12\}$//;/^$/d' out > k && mv k out \
40 compare out /dev/null || fail=1
42 parted -s $dev p || fail=1