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
1=== modified file 'debian/changelog'
2--- debian/changelog 2017-09-01 16:54:50 +0000
3+++ debian/changelog 2017-09-08 10:50:00 +0000
4@@ -3,6 +3,11 @@
5 [ Chris Glass ]
6 * Create vagrant user for vagrant image, per upstream requirements.
7
8+ [ Colin Watson ]
9+ * Mount and unmount /dev recursively, to cope with setups where there are
10+ interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
11+ LXD).
12+
13 -- Adam Conrad <adconrad@ubuntu.com> Fri, 01 Sep 2017 10:53:46 -0600
14
15 livecd-rootfs (2.452) artful; urgency=medium
16
17=== modified file 'live-build/functions'
18--- live-build/functions 2017-08-30 14:46:47 +0000
19+++ live-build/functions 2017-09-08 10:50:00 +0000
20@@ -79,8 +79,7 @@
21 setup_mountpoint() {
22 local mountpoint="$1"
23
24- mount --bind /dev "$mountpoint/dev"
25- mount devpts-live -t proc "$mountpoint/dev/pts"
26+ mount --rbind /dev "$mountpoint/dev"
27 mount proc-live -t proc "$mountpoint/proc"
28 mount sysfs-live -t sysfs "$mountpoint/sys"
29 mount -t tmpfs none "$mountpoint/tmp"
30@@ -141,11 +140,7 @@
31 umount_partition() {
32 local mountpoint=${1}
33 mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
34- for submnt in proc sys dev/pts dev tmp;
35- do
36- umount $mountpoint/$submnt
37- done
38- umount $mountpoint
39+ umount -R $mountpoint
40 udevadm settle
41
42 if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
43
44=== modified file 'live-build/ubuntu-cpc/hooks/032-root-squashfs.binary'
45--- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-06-14 16:25:11 +0000
46+++ live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-09-08 10:50:00 +0000
47@@ -39,8 +39,7 @@
48 mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"
49 umount "binary/boot/squashfs.dir/proc"
50 umount "binary/boot/squashfs.dir/sys"
51-umount "binary/boot/squashfs.dir/dev/pts"
52-umount "binary/boot/squashfs.dir/dev"
53+umount -R "binary/boot/squashfs.dir/dev"
54 umount "binary/boot/squashfs.dir/tmp"
55
56 squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
57
58=== modified file 'live-build/ubuntu-server/hooks/032-installer-squashfs.binary'
59--- live-build/ubuntu-server/hooks/032-installer-squashfs.binary 2017-06-14 16:25:11 +0000
60+++ live-build/ubuntu-server/hooks/032-installer-squashfs.binary 2017-09-08 10:50:00 +0000
61@@ -155,8 +155,7 @@
62 # Then we can start unmounting the "real" root:
63 umount "binary/boot/squashfs.dir/proc"
64 umount "binary/boot/squashfs.dir/sys"
65-umount "binary/boot/squashfs.dir/dev/pts"
66-umount "binary/boot/squashfs.dir/dev"
67+umount -R "binary/boot/squashfs.dir/dev"
68 umount "binary/boot/squashfs.dir/tmp"
69
70 squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"

Subscribers

People subscribed via source and target branches