curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #01719
[Merge] ~mwhudson/curtin:even-more-unmounting-tweaks into curtin:master
Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:even-more-unmounting-tweaks into curtin:master.
Commit message:
tweak making mountpoints private some more
My recent change to move the making of mountpoints private into
do_umount actually made it less robust, because the "making private"
needs to be down on higher level mount points first, but the actual
unmounting needs to be done bottom up. So do all the making private
first in a different loop.
Requested reviews:
curtin developers (curtin-dev)
For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/406682
this time for sure etc
--
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:even-more-unmounting-tweaks into curtin:master.
diff --git a/curtin/util.py b/curtin/util.py
index ec1d4f9..c02580c 100644
--- a/curtin/util.py
+++ b/curtin/util.py
@@ -550,10 +550,14 @@ def do_umount(mountpoint, recursive=False):
#
# return boolean indicating if mountpoint was previously mounted.
ret = False
+ if recursive:
+ for line in load_file("/proc/mounts", decode=True).splitlines():
+ curmp = line.split()[1]
+ if curmp == mp or curmp.startswith(mp + os.path.sep):
+ subp(['mount', '--make-private', curmp])
for line in reversed(load_file("/proc/mounts", decode=True).splitlines()):
curmp = line.split()[1]
if curmp == mp or (recursive and curmp.startswith(mp + os.path.sep)):
- subp(['mount', '--make-private', curmp])
subp(['umount', curmp])
if curmp == mp:
ret = True
References