3
. /lib/partman/lib/base.sh
7
for dev in $DEVICES/*; do
8
[ -d "$dev" ] || continue
11
open_dialog PARTITIONS
12
while { read_line num id size type fs path name; [ "$id" ]; }; do
13
[ "$fs" != free ] || continue
14
partitions="$partitions $id,$num"
18
for part in $partitions; do
21
[ -f $id/method -a -f $id/format \
22
-a -f $id/acting_filesystem ] || continue
23
filesystem=$(cat $id/acting_filesystem)
26
if [ -f $id/formatted ] && \
27
[ $id/formatted -nt $id/method ] && \
28
([ ! -f $id/filesystem ] || \
29
[ $id/formatted -nt $id/filesystem ]); then
32
log "Try to create file system for $dev/$id"
33
if [ -f $id/mountpoint ]; then
34
template=partman-basicfilesystems/progress_formatting_mountable
35
db_subst $template MOUNT_POINT "$(cat $id/mountpoint)"
37
template=partman-basicfilesystems/progress_formatting
39
open_dialog PARTITION_INFO $id
40
read_line x1 x2 x3 x4 x5 device x6
44
db_metaget partman/filesystem_short/"$filesystem" description || RET=''
45
[ "$RET" ] || RET="$filesystem"
46
db_subst $template TYPE "$RET"
47
db_subst $template PARTITION "$num"
48
db_subst $template DEVICE $(humandev $(cat device))
50
db_progress START 0 3 partman/text/formatting
51
db_progress INFO $template
55
if [ -f $id/label ]; then
56
label=$(cat $id/label | \
57
sed 's/\(............\).*/\1/g')
60
# Ensure label is quoted correctly
61
log-output -t partman --pass-stdout \
62
mkfs.btrfs -f ${label:+-L "$label"} \
63
$device >/dev/null || code=$?
67
if [ "$code" != 0 ]; then
68
T=partman-basicfilesystems/create_failed
69
db_subst $T FILESYSTEM "$filesystem"
70
db_subst $T PARTITION "$num"
71
db_subst $T DEVICE $(humandev $(cat device))
72
db_input critical $T || true