Skip to content

Commit

Permalink
rpmostreepayload: Do /sysroot mount non-recursively
Browse files Browse the repository at this point in the history
In rhinstaller#903 we
changed all of rpmostreepayload's internal mounts to be
recursive to fix `/boot/efi`.  And indeed all should be recursive,
except one - the `/sysroot` mount.  By asking for that to be
recursive we've created a loop.

I noticed a while ago that the output of `findmnt` during an install was insane
(the deployment directory was visible twice, etc.), but never debugged it. It
turns out this was the cause.

Fixing this makes the mounts look a lot more sane, and will help
for future work I have for `/var` mounts.
  • Loading branch information
cgwalters committed Jul 24, 2017
1 parent d3ce782 commit db2920f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyanaconda/payload/rpmostreepayload.py
Expand Up @@ -248,7 +248,6 @@ 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.getSysroot() + '/usr', None),
(iutil.getTargetPhysicalRoot(), iutil.getSysroot() + "/sysroot"),
(iutil.getTargetPhysicalRoot() + "/boot", iutil.getSysroot() + "/boot")]

# https://github.com/ostreedev/ostree/issues/855
Expand All @@ -275,6 +274,12 @@ def prepareMountTargets(self, storage):
["--rbind", src, dest])
self._internal_mounts.append(src if is_ro_bind else dest)

# And finally, do a nonrecursive bind for the sysroot
self._safeExecWithRedirect("mount",
["--bind", iutil.getTargetPhysicalRoot(),
iutil.getSysroot() + "/sysroot"])
self._internal_mounts.append(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 also allow Anaconda and %post scripts to write to directories like
Expand Down

0 comments on commit db2920f

Please sign in to comment.