6
if [ -z "$partition_recipe" ]; then
7
partition_recipe='Kickstart-supplied partitioning scheme :'
12
maxsize=$((1024 * 1024 * 1024))
17
eval set -- "$(getopt -o '' -l size:,grow,maxsize:,noformat,onpart:,usepart:,ondisk:,ondrive:,asprimary,fstype:,start:,end: -- "$@")" || die_getopt partition
44
--onpart|--usepart|--ondisk|--ondrive|--start|--end)
45
die "unsupported restriction '$1'"
49
*) die_getopt partition ;;
54
die "partition command requires a mountpoint"
58
if [ -z "$size" ]; then
59
die "partition command requires a size"
62
if [ "$mountpoint" = swap ]; then
65
elif [ "$fstype" ]; then
76
partition_recipe="$partition_recipe $size $priority $maxsize $filesystem"
78
if [ "$asprimary" ]; then
79
partition_recipe="$partition_recipe \$primary{ }"
82
if [ "$filesystem" = swap ]; then
83
partition_recipe="$partition_recipe method{ swap }"
84
elif [ "$format" ]; then
85
partition_recipe="$partition_recipe method{ format }"
87
partition_recipe="$partition_recipe method{ keep }"
90
if [ "$format" ]; then
91
partition_recipe="$partition_recipe format{ }"
94
if [ "$filesystem" != swap ]; then
95
partition_recipe="$partition_recipe use_filesystem{ }"
96
partition_recipe="$partition_recipe filesystem{ $filesystem }"
99
if [ "$mountpoint" ]; then
100
partition_recipe="$partition_recipe mountpoint{ $mountpoint }"
103
partition_recipe="$partition_recipe ."
107
partition_handler "$@"
110
partition_handler_final () {
111
if [ "$partition_recipe" ]; then
112
preseed d-i partman-auto/expert_recipe string \
117
register_final partition_handler_final