* 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.
core-include-dmsetup
Steve Langasek 7 years ago
parent 2b208d7287
commit f16611774f

10
debian/changelog vendored

@ -1,10 +1,18 @@
livecd-rootfs (2.408.19) xenial; urgency=medium
livecd-rootfs (2.408.19) UNRELEASED; urgency=medium
[ Nishanth Aravamudan ]
* live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI
Initiator Name at first iscsid run for cloud images to ensure it is
unique (LP: #1444992).
[ Steve Langasek ]
* 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.
-- Victor Tapia <victor.tapia@canonical.com> Tue, 19 Sep 2017 10:55:11 +0200
livecd-rootfs (2.408.18) xenial; urgency=medium

@ -98,16 +98,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"
apt-get install -qqy udev
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"
}

@ -119,11 +119,8 @@ EOF
chroot mountpoint apt-get -y clean
rm mountpoint/tmp/device.map
sync
umount mountpoint/boot/efi
sleep 5
apt-get install -qqy udev
udevadm settle
mount
umount_partition mountpoint
rmdir mountpoint

Loading…
Cancel
Save