File: do_option

package info (click to toggle)
partman-partitioning 64lenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,392 kB
  • ctags: 26
  • sloc: sh: 1,231; makefile: 41
file content (65 lines) | stat: -rwxr-xr-x 1,176 bytes parent folder | download
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
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh

. /lib/partman/lib/base.sh

task=$1
dev=$2
id=$3

cd $dev

if [ "$task" = bootable ]; then
	open_dialog PARTITION_INFO $id
	read_line x1 x2 x3 type x5 x6 x7
	close_dialog
	if [ "$type" = logical ]; then
		db_input high partman-partitioning/bootable_logical || true
		db_go || exit 0
		db_get partman-partitioning/bootable_logical
		[ "$RET" = true ] || exit 0
	fi
fi

new_flags=''
open_dialog GET_FLAGS $id
while { read_line flag; [ "$flag" ]; }; do
	if [ "$flag" != boot ]; then
		if [ "$new_flags" ]; then
			new_flags="$new_flags
$flag"
		else
			new_flags="$flag"
		fi
	fi
done
close_dialog

if [ $task = bootable ]; then
	new_flags="$new_flags
boot"
fi

open_dialog SET_FLAGS $id
write_line "$new_flags"
write_line NO_MORE
close_dialog

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

db_progress START 0 $numparts partman/text/please_wait
db_progress INFO partman-partitioning/new_state

for id in $partitions; do
	update_partition $dev $id
	db_progress STEP 1
done

db_progress STOP