diff --git a/debian/changelog b/debian/changelog index 81071666..36d83f7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,11 @@ livecd-rootfs (2.408.15) UNRELEASED; urgency=medium * live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get update *before* installing packages, not after. + [ Colin Watson ] + * Mount and unmount /dev recursively, to cope with setups where there are + interesting bind-mounts under /dev (e.g. loop devices bind-mounted by + LXD). LP: #1716465. + -- Steve Langasek Wed, 23 Aug 2017 17:35:40 -0700 livecd-rootfs (2.408.14) xenial; urgency=medium diff --git a/live-build/ubuntu-cpc/functions b/live-build/ubuntu-cpc/functions index 3e935cad..038152a4 100644 --- a/live-build/ubuntu-cpc/functions +++ b/live-build/ubuntu-cpc/functions @@ -82,8 +82,7 @@ mount_image() { setup_mountpoint() { local mountpoint="$1" - mount --bind /dev "$mountpoint/dev" - mount devpts-live -t proc "$mountpoint/dev/pts" + mount --rbind /dev "$mountpoint/dev" mount proc-live -t proc "$mountpoint/proc" mount sysfs-live -t sysfs "$mountpoint/sys" mount -t tmpfs none "$mountpoint/tmp" @@ -136,11 +135,8 @@ umount_settle() { umount_partition() { local mountpoint=${1} mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" - for submnt in var/cache/apt var/lib/apt proc sys dev/pts dev tmp; - do - umount_settle $mountpoint/$submnt - done - umount_settle $mountpoint + umount -R $mountpoint + udevadm settle if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then # buildd's don't have /etc/mtab symlinked diff --git a/live-build/ubuntu-cpc/hooks/030-root-tarball.binary b/live-build/ubuntu-cpc/hooks/030-root-tarball.binary index 7571711b..60d2bf62 100755 --- a/live-build/ubuntu-cpc/hooks/030-root-tarball.binary +++ b/live-build/ubuntu-cpc/hooks/030-root-tarball.binary @@ -27,6 +27,5 @@ chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbi mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf" umount "binary/boot/filesystem.dir/proc" umount "binary/boot/filesystem.dir/sys" -umount "binary/boot/filesystem.dir/dev/pts" -umount "binary/boot/filesystem.dir/dev" +umount -R "binary/boot/filesystem.dir/dev" umount "binary/boot/filesystem.dir/tmp"