File: do_option

package info (click to toggle)
partman-partitioning 108
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,688 kB
  • ctags: 23
  • sloc: sh: 1,199; makefile: 18
file content (46 lines) | stat: -rwxr-xr-x 818 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

. /lib/partman/lib/base.sh

dev=$2
id=$3

cd $dev

open_dialog VALID_FLAGS $id
valid_flags=$(read_list)
close_dialog

open_dialog GET_FLAGS $id
old_flags=$(read_list)
close_dialog

db_set partman-partitioning/set_flags "$old_flags"
db_subst partman-partitioning/set_flags CHOICES "$valid_flags"
db_input critical partman-partitioning/set_flags || true
db_go || exit 1
db_get partman-partitioning/set_flags

log "New flags:" $RET

open_dialog SET_FLAGS $id
IFS=','
for flag in $RET; do
	restore_ifs
	write_line $flag
done
write_line NO_MORE
restore_ifs
close_dialog

partitions=''
open_dialog PARTITIONS
while { read_line num id size type fs path name; [ "$id" ]; }; do
	[ "$fs" != free ] || continue
	partitions="$partitions $id"
done
close_dialog

for id in $partitions; do
	update_partition $dev $id
done