do_option 836 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/sh

. /lib/partman/definitions.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"
20
db_input critical partman-partitioning/set_flags || true
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
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