[Merge] ~gjolly/livecd-rootfs:ubuntu-cpc/device_busy into livecd-rootfs:ubuntu/master
John Chittum
mp+448708 at code.launchpad.net
Tue Aug 8 17:52:42 UTC 2023
Diff comments:
> diff --git a/live-build/functions b/live-build/functions
> index 8088cb2..a51ba15 100644
> --- a/live-build/functions
> +++ b/live-build/functions
> @@ -224,20 +224,32 @@ EOF
>
> }
>
> +wait_on_device_busy() {
> + device="$1"
> +
> + while true; do
there's a timeout in our builds because we request one with launchpad. Is there a default timeout without it? I honestly don't know.
whatever you do, don't replicate my horrible backoff w/ jitter code. it was bad then, and bad now :)
> + python3 -c "import os; os.open('$device', os.O_RDONLY | os.O_EXCL)" &> /dev/null && break
> + echo "device busy"
> + sleep 5
> + done
> +}
> +
> umount_partition() {
> local mountpoint=${1}
> teardown_mountpoint $mountpoint
> mount --make-private $mountpoint
> umount $mountpoint
> udevadm settle
> - # workaround for LP: 1960537
> - sleep 30
>
> if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
> # buildd's don't have /etc/mtab symlinked
> # /etc/mtab is needed in order zerofree space for ext4 filesystems
> [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab
>
> + # the calls to e2fsck will fail if the block device is still "busy"
> + # this is a workaround for LP#2030771
> + wait_on_device_busy "${rootfs_dev_mapper}"
> +
> # both of these are likely overkill, but it does result in slightly
> # smaller ext4 filesystem
> e2fsck -y -E discard ${rootfs_dev_mapper}
--
https://code.launchpad.net/~gjolly/livecd-rootfs/+git/livecd-rootfs/+merge/448708
Your team Ubuntu Core Development Team is requested to review the proposed merge of ~gjolly/livecd-rootfs:ubuntu-cpc/device_busy into livecd-rootfs:ubuntu/master.
More information about the Ubuntu-reviews
mailing list