|
|
|
@ -158,17 +158,10 @@ teardown_mountpoint() {
|
|
|
|
|
|
|
|
|
|
# ensure we have exactly one trailing slash, and escape all slashes for awk
|
|
|
|
|
mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
|
|
|
|
|
|
|
|
|
|
# Make all submounts private
|
|
|
|
|
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
|
|
|
|
{ print \$2 }" | LC_ALL=C sort -r); do
|
|
|
|
|
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
|
|
|
|
|
mount --make-private $submount
|
|
|
|
|
umount $submount
|
|
|
|
|
done
|
|
|
|
|
recover_sourceslist "${mountpoint}"
|
|
|
|
|