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.
core-include-dmsetup
Steve Langasek 7 years ago
parent 880d4f8b89
commit 314a6b95a3

5
debian/changelog vendored

@ -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 <steve.langasek@ubuntu.com> Wed, 23 Aug 2017 17:35:40 -0700
livecd-rootfs (2.408.14) xenial; urgency=medium

@ -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

@ -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"

Loading…
Cancel
Save