diff -Nru livecd-rootfs-2.408.16/debian/changelog livecd-rootfs-2.408.17/debian/changelog --- livecd-rootfs-2.408.16/debian/changelog 2017-09-12 15:25:58.000000000 -0500 +++ livecd-rootfs-2.408.17/debian/changelog 2017-09-13 12:00:59.000000000 -0500 @@ -1,3 +1,13 @@ +livecd-rootfs (2.408.17) xenial; urgency=medium + + * live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint, + to reverse the work done in setup_mountpoint. Lack of this function + has forced users of setup_mountpoint to implement this separately + and the implementations have diverged. (LP: #1716992) + * live-build/ubuntu-cpc/functions: Remove umount_settle function. + The was only used where teardown_mountpoint was lacking. + -- Robert C Jennings Wed, 13 Sep 2017 12:00:59 -0500 + livecd-rootfs (2.408.16) xenial; urgency=medium * live-build/ubuntu-cpc/functions: call apt-get update in the chroot diff -Nru livecd-rootfs-2.408.16/live-build/ubuntu-cpc/functions livecd-rootfs-2.408.17/live-build/ubuntu-cpc/functions --- livecd-rootfs-2.408.16/live-build/ubuntu-cpc/functions 2017-09-12 15:24:23.000000000 -0500 +++ livecd-rootfs-2.408.17/live-build/ubuntu-cpc/functions 2017-09-13 12:00:59.000000000 -0500 @@ -94,6 +94,21 @@ } +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 + mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" +} + mount_partition() { partition="$1" mountpoint="$2" @@ -126,16 +141,9 @@ } -umount_settle() { - # Unmount device, and let it settle - umount $1 - udevadm settle - sleep 3 -} - umount_partition() { local mountpoint=${1} - mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" + teardown_mountpoint $mountpoint umount -R $mountpoint udevadm settle diff -Nru livecd-rootfs-2.408.16/live-build/ubuntu-cpc/hooks/030-root-tarball.binary livecd-rootfs-2.408.17/live-build/ubuntu-cpc/hooks/030-root-tarball.binary --- livecd-rootfs-2.408.16/live-build/ubuntu-cpc/hooks/030-root-tarball.binary 2017-09-12 15:25:58.000000000 -0500 +++ livecd-rootfs-2.408.17/live-build/ubuntu-cpc/hooks/030-root-tarball.binary 2017-09-13 12:00:59.000000000 -0500 @@ -25,9 +25,4 @@ chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf" -umount "binary/boot/filesystem.dir/proc" -umount "binary/boot/filesystem.dir/sys" -umount -R "binary/boot/filesystem.dir/dev" -umount "binary/boot/filesystem.dir/tmp" -umount "binary/boot/filesystem.dir/var/lib/apt" -umount "binary/boot/filesystem.dir/var/cache/apt" +teardown_mountpoint binary/boot/filesystem.dir