File: do_option

package info (click to toggle)
partman-partitioning 159
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,788 kB
  • sloc: sh: 1,198; makefile: 21
file content (42 lines) | stat: -rwxr-xr-x 819 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
#!/bin/sh -e

. /lib/partman/lib/base.sh
. /lib/partman/lib/disk-label.sh

dev="$2"
cd $dev

[ -f size ] || exit 1

db_input critical partman-partitioning/confirm_new_label
db_go || exit 0
db_get partman-partitioning/confirm_new_label
if [ "$RET" = false ]; then
	db_reset partman-partitioning/confirm_new_label
	exit 1
fi
db_reset partman-partitioning/confirm_new_label

prepare_new_labels "$dev"
create_new_label "$dev" ""

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

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

open_dialog GET_LABEL_TYPE
read_line label_type
close_dialog

if [ "$label_type" = sun ]; then
	backupdir=../../backup/$(basename $dev)
	rm -rf "$backupdir"
	cp -a . "$backupdir"
fi