partman-btrfs/active_partition/btrfs/choices
Joey Hess 0eb02adc27 initial commit of partman-btrfs
This is untested and unlikely to work without parted support.
Committing what I have since I don't trust btrfs to preserve the data. ;-)

Note to translators: Probably not worth wasting your time with this yet.
Have not run debconf-updatepo.

r62090
2010-01-27 20:14:29 +00:00

70 lines
1.3 KiB
Bash
Executable file

#!/bin/sh
. /usr/share/debconf/confmodule
set -e
dev=$1
id=$2
part=$dev/$id
cd $dev
[ -f $part/method -a -f $part/acting_filesystem ] || exit 0
filesystem=$(cat $part/acting_filesystem)
case "$filesystem" in
btrfs)
:
;;
*)
exit 0
;;
esac
choice_mountpoint () {
case "$filesystem" in
btrfs)
if [ -f $part/mountpoint ]; then
mp=$(cat $part/mountpoint)
else
db_metaget partman-basicfilesystems/text/no_mountpoint description
mp="$RET"
fi
db_metaget partman-btrfs/text/specify_mountpoint description
printf "mountpoint\t%s\${!TAB}%s\n" "$RET" "$mp"
;;
esac
}
choice_options () {
db_metaget partman-basicfilesystems/text/options description
printf "options\t%s\${!TAB}%.45s\n" "$RET" "$(get_mountoptions $dev $id)"
}
choice_label () {
# allow to set label only if the partition is to be formatted
[ -f $part/format ] || return 0
[ ! -f $part/formatted \
-o $part/formatted -ot $part/method \
-o $part/formatted -ot $part/filesystem ] || return 0
case "$filesystem" in
btrfs)
if [ -f $part/label ]; then
label=$(cat $part/label)
else
db_metaget partman-basicfilesystems/text/none description
label=$RET
fi
db_metaget partman-basicfilesystems/text/specify_label description
printf "label\t%s\${!TAB}%s\n" "$RET" "$label"
;;
esac
}
choice_mountpoint
choice_options
choice_label