[f23-branch 1/1] rpmostreepayload: Fix two issues with mounting

cgwalters installerbot-noreply at redhat.com
Sun Oct 25 13:17:31 UTC 2015


From: Colin Walters <walters at verbum.org>

This makes the internal mounts show up a lot more cleanly
in the output of `mount` at least after installation.

This might fix:
https://bugzilla.redhat.com/show_bug.cgi?id=1274977
as it's possible Blivet/systemd will be less confused.

Basically I believe that becuase later mounts were traversing the
`/mnt/sysroot` -> `$deploy/sysroot` bind mount, they were being
`canonicalized` to point into the target.  This messed up the
hierarchy.

That's one bug - the other silly bug is that we were missing a `-o
remount` option for the `/usr` bind mount, causing it to be mounted
twice.
---
 pyanaconda/packaging/rpmostreepayload.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
index 5fdeaad..e97eddb 100644
--- a/pyanaconda/packaging/rpmostreepayload.py
+++ b/pyanaconda/packaging/rpmostreepayload.py
@@ -232,9 +232,7 @@ def prepareMountTargets(self, storage):
 
         # Set up bind mounts as if we've booted the target system, so
         # that %post script work inside the target.
-        binds = [(iutil.getTargetPhysicalRoot(),
-                  iutil.getSysroot() + '/sysroot'),
-                 (varroot,
+        binds = [(varroot,
                   iutil.getSysroot() + '/var'),
                  (iutil.getSysroot() + '/usr', None)]
 
@@ -243,7 +241,15 @@ def prepareMountTargets(self, storage):
                                        ["--bind", src, dest if dest else src])
             if dest is None:
                 self._safeExecWithRedirect("mount",
-                                           ["--bind", "-o", "ro", src, src])
+                                           ["--bind", "-o", "remount,ro", src, src])
+
+        # We previously bind mounted /mnt/sysimage to
+        # /mnt/sysimage/.../sysroot, but this caused issues with mount
+        # path canonicalization.  Instead, directly mount the physical
+        # device at two different paths.
+        self._safeExecWithRedirect("mount",
+                                   [storage.rootDevice.format.device,
+                                    iutil.getSysroot() + "/sysroot"])
 
         # Now, ensure that all other potential mount point directories such as
         # (/home) are created.  We run through the full tmpfiles here in order


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/2af75c65f5c15440d2a425a1beb27554cd0ebfc3


More information about the anaconda-patches mailing list