Merge lp:~cjwatson/livecd-rootfs/recursive-mount-dev into lp:livecd-rootfs

Proposed by Colin Watson
Status: Merged
Merged at revision: 1506
Proposed branch: lp:~cjwatson/livecd-rootfs/recursive-mount-dev
Merge into: lp:livecd-rootfs
Diff against target: 70 lines (+9/-11)
4 files modified
debian/changelog (+5/-0)
live-build/functions (+2/-7)
live-build/ubuntu-cpc/hooks/032-root-squashfs.binary (+1/-2)
live-build/ubuntu-server/hooks/032-installer-squashfs.binary (+1/-2)
To merge this branch: bzr merge lp:~cjwatson/livecd-rootfs/recursive-mount-dev
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Dimitri John Ledkov Approve
Review via email: mp+330407@code.launchpad.net

Commit message

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).

Description of the change

This also fixes the oddity whereby setup_mountpoint mounted $mountpoint/dev/pts with -t proc.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

note to self: -R is not available in trusty's umount, thus if we need this back in trusty too something else should be done, or umount backported at least in the cpc PPAs.

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

I will go ahead with merging this for artful/zesty/xenial as-is, notwithstanding Dimitri's above comment, because fixing this in trusty is not critical-path for any of our cloud images and I'm comfortable with us solving this differently (more complicated) as a trusty-only change later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2017-09-01 16:54:50 +0000
+++ debian/changelog 2017-09-08 10:50:00 +0000
@@ -3,6 +3,11 @@
3 [ Chris Glass ]3 [ Chris Glass ]
4 * Create vagrant user for vagrant image, per upstream requirements.4 * Create vagrant user for vagrant image, per upstream requirements.
55
6 [ Colin Watson ]
7 * Mount and unmount /dev recursively, to cope with setups where there are
8 interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
9 LXD).
10
6 -- Adam Conrad <adconrad@ubuntu.com> Fri, 01 Sep 2017 10:53:46 -060011 -- Adam Conrad <adconrad@ubuntu.com> Fri, 01 Sep 2017 10:53:46 -0600
712
8livecd-rootfs (2.452) artful; urgency=medium13livecd-rootfs (2.452) artful; urgency=medium
914
=== modified file 'live-build/functions'
--- live-build/functions 2017-08-30 14:46:47 +0000
+++ live-build/functions 2017-09-08 10:50:00 +0000
@@ -79,8 +79,7 @@
79setup_mountpoint() {79setup_mountpoint() {
80 local mountpoint="$1"80 local mountpoint="$1"
8181
82 mount --bind /dev "$mountpoint/dev"82 mount --rbind /dev "$mountpoint/dev"
83 mount devpts-live -t proc "$mountpoint/dev/pts"
84 mount proc-live -t proc "$mountpoint/proc"83 mount proc-live -t proc "$mountpoint/proc"
85 mount sysfs-live -t sysfs "$mountpoint/sys"84 mount sysfs-live -t sysfs "$mountpoint/sys"
86 mount -t tmpfs none "$mountpoint/tmp"85 mount -t tmpfs none "$mountpoint/tmp"
@@ -141,11 +140,7 @@
141umount_partition() {140umount_partition() {
142 local mountpoint=${1}141 local mountpoint=${1}
143 mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"142 mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
144 for submnt in proc sys dev/pts dev tmp;143 umount -R $mountpoint
145 do
146 umount $mountpoint/$submnt
147 done
148 umount $mountpoint
149 udevadm settle144 udevadm settle
150145
151 if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then146 if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
152147
=== modified file 'live-build/ubuntu-cpc/hooks/032-root-squashfs.binary'
--- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-06-14 16:25:11 +0000
+++ live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-09-08 10:50:00 +0000
@@ -39,8 +39,7 @@
39mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"39mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"
40umount "binary/boot/squashfs.dir/proc"40umount "binary/boot/squashfs.dir/proc"
41umount "binary/boot/squashfs.dir/sys"41umount "binary/boot/squashfs.dir/sys"
42umount "binary/boot/squashfs.dir/dev/pts"42umount -R "binary/boot/squashfs.dir/dev"
43umount "binary/boot/squashfs.dir/dev"
44umount "binary/boot/squashfs.dir/tmp"43umount "binary/boot/squashfs.dir/tmp"
4544
46squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"45squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
4746
=== modified file 'live-build/ubuntu-server/hooks/032-installer-squashfs.binary'
--- live-build/ubuntu-server/hooks/032-installer-squashfs.binary 2017-06-14 16:25:11 +0000
+++ live-build/ubuntu-server/hooks/032-installer-squashfs.binary 2017-09-08 10:50:00 +0000
@@ -155,8 +155,7 @@
155# Then we can start unmounting the "real" root:155# Then we can start unmounting the "real" root:
156umount "binary/boot/squashfs.dir/proc"156umount "binary/boot/squashfs.dir/proc"
157umount "binary/boot/squashfs.dir/sys"157umount "binary/boot/squashfs.dir/sys"
158umount "binary/boot/squashfs.dir/dev/pts"158umount -R "binary/boot/squashfs.dir/dev"
159umount "binary/boot/squashfs.dir/dev"
160umount "binary/boot/squashfs.dir/tmp"159umount "binary/boot/squashfs.dir/tmp"
161160
162squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"161squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"

Subscribers

People subscribed via source and target branches