mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-11 19:01:31 +00:00
functions: fix unmounting for local builds
livecd-rootfs creates non-private mounts. When building locally using the auto/build script unmounting fails. To unmount dev/pts it is insufficient to make the mount private. Its parents must be private too. Change teardown_mountpoint() accordingly. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
1a7e9ca8c9
commit
d65af891f3
@ -158,10 +158,17 @@ teardown_mountpoint() {
|
|||||||
|
|
||||||
# ensure we have exactly one trailing slash, and escape all slashes for awk
|
# ensure we have exactly one trailing slash, and escape all slashes for awk
|
||||||
mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
|
mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
|
||||||
# sort -r ensures that deeper mountpoints are unmounted first
|
|
||||||
|
# Make all submounts private
|
||||||
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
||||||
{ print \$2 }" | LC_ALL=C sort -r); do
|
{ print \$2 }" | LC_ALL=C sort -r); do
|
||||||
mount --make-private $submount
|
mount --make-private $submount
|
||||||
|
done
|
||||||
|
|
||||||
|
# Now we can unmount them
|
||||||
|
# sort -r ensures that deeper mountpoints are unmounted first
|
||||||
|
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
||||||
|
{ print \$2 }" | LC_ALL=C sort -r); do
|
||||||
umount $submount
|
umount $submount
|
||||||
done
|
done
|
||||||
recover_sourceslist "${mountpoint}"
|
recover_sourceslist "${mountpoint}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user