Call losetup -d properly.

This commit is contained in:
Steve Langasek 2023-04-17 12:22:17 -07:00
parent fa29b73130
commit a130ee17c3
2 changed files with 8 additions and 2 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
livecd-rootfs (2.830) UNRELEASED; urgency=medium
* Call losetup -d properly.
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 17 Apr 2023 12:22:06 -0700
livecd-rootfs (2.829) lunar; urgency=medium
[ Loïc Minier ]

View File

@ -12,13 +12,13 @@ loop_raw=
backing_img=
clean_loops() {
if [ -n "${backing_img}" ]; then
if [ -n "${loop_device}" ]; then
# If something just finished writing to the device or a
# partition (e.g. the zerofree in umount_partition) udev might
# still be processing the device.
udevadm settle
sync
losetup -v -d "${backing_img}"
losetup -v -d "${loop_device}"
unset backing_img
fi