File: partman-command

package info (click to toggle)
partman-base 147
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,836 kB
  • ctags: 219
  • sloc: ansic: 2,347; sh: 2,248; makefile: 34
file content (54 lines) | stat: -rwxr-xr-x 1,309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/sh
# This script is intended for developer debugging purposes only. If you use
# it for anything else, on your own head be it ...

export DEBIAN_FRONTEND=noninteractive

. /lib/partman/lib/base.sh

if [ "${1#/dev/}" != "$1" ]; then
	dirname="$(echo "$1" | sed 's:/:=:g')"
	cd "$DEVICES/$dirname" || exit $?
	shift
else
	dir="$(pwd)"
	case $dir in
	    $DEVICES/*)
		;;
	    *)
		echo "Must be run from a subdirectory of $DEVICES" >&2
		exit 1
	esac
fi

# Within each group, please keep commands in the same order as in
# parted_server.c:main_loop().
case $1 in
    OPEN|OPENED|VIRTUAL|IS_CHANGED|PARTITION_INFO|GET_CHS|USES_NAMES|GET_MAX_PRIMARY|USES_EXTENDED|GET_FILE_SYSTEM|CHECK_FILE_SYSTEM|CREATE_FILE_SYSTEM|NEW_PARTITION|RESIZE_PARTITION|GET_RESIZE_RANGE|VIRTUAL_RESIZE_PARTITION|GET_VIRTUAL_RESIZE_RANGE|GET_LABEL_TYPE|IS_BUSY|ALIGNMENT_OFFSET)
	mode=line
	;;
    PARTITIONS|LABEL_TYPES|VALID_FLAGS|GET_FLAGS|FILE_SYSTEM_TYPES)
	mode=paragraph
	;;
    CLOSE|DISK_UNCHANGED|DUMP|COMMIT|UNDO|SET_FLAGS|SET_NAME|CHANGE_FILE_SYSTEM|NEW_LABEL|DELETE_PARTITION|COPY_PARTITION)
	mode=silent
	;;
    *)
	echo "Unrecognised command: $1" >&2
	exit 1
	;;
esac

open_dialog "$@"
case $mode in
    line)
	read_line response
	echo "$response"
	;;
    paragraph)
	read_paragraph
	;;
esac
close_dialog

exit 0