From ccf9ddaa923698f6a38d9a5ad59f0abbd8b30423 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 May 2017 14:09:40 -0400 Subject: [PATCH] rpmostreepayload: Handle /var as a user-specified mountpoint See: https://github.com/ostreedev/ostree/issues/855 Basically, if `/var` is in the user specified mounts, don't override it with the "default ostree" `var`. This allows people to easily keep all of their local state (apart from `/etc`) in a single partition with potentially different quotas etc. --- pyanaconda/packaging/rpmostreepayload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py index c9ac6e21e60..b5a38325ffa 100644 --- a/pyanaconda/packaging/rpmostreepayload.py +++ b/pyanaconda/packaging/rpmostreepayload.py @@ -221,11 +221,14 @@ def prepareMountTargets(self, storage): # Set up bind mounts as if we've booted the target system, so # that %post script work inside the target. - self._binds = [(varroot, iutil.getSysroot() + '/var'), - (iutil.getSysroot() + '/usr', None), + self._binds = [(iutil.getSysroot() + '/usr', None), (iutil.getTargetPhysicalRoot(), iutil.getSysroot() + "/sysroot"), (iutil.getTargetPhysicalRoot() + "/boot", iutil.getSysroot() + "/boot")] + # https://github.com/ostreedev/ostree/issues/855 + if storage.mountpoints.get("/var") is None: + binds.append((varroot, iutil.getSysroot() + '/var')) + # Bind mount filesystems from /mnt/sysimage to the ostree root; perhaps # in the future consider `mount --move` to make the output of `findmnt` # not induce blindness.