/lib/partman/finish.d/20mount_partitions is in ubiquity 18.04.14.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/bin/sh
. /lib/partman/lib/base.sh
fstab=$(
for i in /lib/partman/fstab.d/*; do
[ -x "$i" ] || continue
$i
done |
while read fs mp type options dump pass; do
echo $mp $fs $type $options $dump $pass
done |
sort |
while read mp fs type options dump pass; do
newoptions=
while [ "$options" ]; do
case $options in
(ro,*)
options="${options#ro,}"
;;
(ro)
options=
;;
(*,*)
newoptions="${newoptions:+$newoptions,}${options%%,*}"
options="${options#*,}"
;;
(*)
newoptions="${newoptions:+$newoptions,}$options"
options=
;;
esac
done
if [ -z "$newoptions" ]; then
newoptions=defaults
fi
echo $fs $mp $type $newoptions $dump $pass
done
)
IFS="$NL"
for f in $fstab; do
restore_ifs
set -- $f
case "$2" in
/media/*)
mkdir -p "/target$2"
continue
;;
/*)
mkdir -p "/target$2"
;;
esac
for m in /lib/partman/mount.d/*; do
[ -x "$m" ] || continue
# partman-doc specifies that mount.d scripts output the command
# needed to unmount the partition; currently this is unused
unmount_cmd=$($m "$f")
if [ "$?" = 0 ]; then
continue 2
fi
done
db_subst partman-target/mount_failed DEVICE $(humandev $1)
db_subst partman-target/mount_failed MOUNTPOINT $2
db_subst partman-target/mount_failed TYPE $3
db_input critical partman-target/mount_failed || true
db_go || exit 1
db_get partman-target/mount_failed
if [ "$RET" = true ]; then
exit 1
else
exit 2
fi
done
|