From 801aad2f7777c8b12628108a913efa3d4cabdc23 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 13 Sep 2017 13:42:28 -0700 Subject: [PATCH] * 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. --- debian/changelog | 11 +++++++++++ live-build/functions | 15 +++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index aca89594..c78b280e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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, diff --git a/live-build/functions b/live-build/functions index ee5a4f3d..4c3049ec 100644 --- a/live-build/functions +++ b/live-build/functions @@ -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