File: do_option

package info (click to toggle)
partman-partitioning 91
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,820 kB
  • sloc: sh: 1,233; makefile: 24
file content (54 lines) | stat: -rwxr-xr-x 1,058 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

. /lib/partman/lib/resize.sh

dev=$2
oldid=$3

cd $dev

check_virtual

if [ "$virtual" = no ] && [ -f $oldid/detected_filesystem ]; then
	case "$(cat $oldid/detected_filesystem)" in
	    ntfs)
		if ! get_ntfs_resize_range; then
			db_input critical partman-partitioning/impossible_resize || true
			db_go || true
			exit 1
		fi
		;;
	    ext2|ext3|ext4)
		if ! get_ext2_resize_range; then
			db_input critical partman-partitioning/impossible_resize || true
			db_go || true
			exit 1
		fi
		;;
	    *)
		get_resize_range
		;;
	esac
else
	get_resize_range
fi

if [ -z "$maxsize" ]; then
	logger -t partman "Error: unable to determine maximum new size for partition"
	db_input critical partman-partitioning/impossible_resize || true
	db_go || true
	exit 1
fi

human_resize_range

if [ "$virtual" = no ]; then
	db_set partman-partitioning/confirm_resize false
	db_input critical partman-partitioning/confirm_resize || true
	db_go || exit 0
	db_get partman-partitioning/confirm_resize
	[ "$RET" = true ] || exit 0
fi

ask_for_size || exit $?
exit 100