* Improve teardown_mountpoint to recursively find all submounts and

unmount them, instead of working from a hard-coded list.  This makes
  the code resilient against other submounts being added later, including
  downstream.
* Also nuke the sleep / udevadm settle calls in the process, which should
  never be required and slow down the builds.
ubuntu/artful
Steve Langasek 7 years ago
parent 7198b6c0ff
commit 801aad2f77

11
debian/changelog vendored

@ -1,3 +1,14 @@
livecd-rootfs (2.456) UNRELEASED; urgency=medium
* Improve teardown_mountpoint to recursively find all submounts and
unmount them, instead of working from a hard-coded list. This makes
the code resilient against other submounts being added later, including
downstream.
* Also nuke the sleep / udevadm settle calls in the process, which should
never be required and slow down the builds.
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 13:38:58 -0700
livecd-rootfs (2.455) artful; urgency=medium
* Restore the call to 'umount -R $mountpoint' from umount_partition,

@ -95,14 +95,13 @@ teardown_mountpoint() {
# Reverse the operations from setup_mountpoint
local mountpoint="$1"
umount "$mountpoint/var/cache/apt"
umount "$mountpoint/var/lib/apt"
umount "$mountpoint/tmp"
umount "$mountpoint/sys"
umount "$mountpoint/proc"
umount -R "$mountpoint/dev"
udevadm settle
sleep 3
# ensure we have exactly one trailing slash, and escape all slashes for awk
mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
# sort -r ensures that deeper mountpoints are unmounted first
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
{ print \$2 }" | LC_ALL=C sort -r); do
umount $submount
done
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
}

Loading…
Cancel
Save