/lib/partman/automatically_partition/25replace/do_option 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 | #!/bin/sh
. /lib/partman/lib/base.sh
dev=${1%//*}
oldid=${1#*//}
cd $dev
disable_swap "$dev"
open_dialog DELETE_PARTITION $oldid
close_dialog
bestsize=0
bestid=
open_dialog PARTITIONS
while :; do
read_line num id size type fs path name
[ "$id" ] || break
if [ "$fs" = free ] && longint_le $bestsize $size; then
bestsize=$size
bestid=$id
fi
done
close_dialog
db_progress STOP
[ -z "$bestid" ] && exit 1
autopartition $dev $bestid || exit $?
exit 100
|