Skip to content

Commit

Permalink
install: Handle distinct physical root/sysroot
Browse files Browse the repository at this point in the history
Recent changes introduced the ability to have distinct physical root
and sysroot.  In this case, because we run the bootloader binaries
inside the target, we need to ensure that e.g. /boot is mounted inside
that target root.

Note in this case, we also use a new Blivet API to update its
knowledge of the system root.

This patch also updates the storage write logic to note if
ksdata.ostreesetup.osname is set, because the storage will have to be
written after the packaging.
  • Loading branch information
cgwalters authored and clumens committed May 13, 2014
1 parent 83ddc5a commit 0bbc9ad
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions pyanaconda/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from pyanaconda.i18n import _
from pyanaconda.threads import threadMgr
import logging
import blivet
log = logging.getLogger("anaconda")

def _writeKS(ksdata):
Expand Down Expand Up @@ -165,7 +166,9 @@ def doInstall(storage, payload, ksdata, instClass):
payload.preStorage()

turnOnFilesystems(storage, mountOnly=flags.flags.dirInstall)
if not flags.flags.livecdInstall and not flags.flags.dirInstall:
write_storage_late = (flags.flags.livecdInstall or ksdata.ostreesetup.seen
and not flags.flags.dirInstall)
if not write_storage_late:
storage.write()

# Do packaging.
Expand All @@ -188,9 +191,30 @@ def doInstall(storage, payload, ksdata, instClass):
payload.preInstall(packages=packages, groups=payload.languageGroups())
payload.install()

if flags.flags.livecdInstall:
storage.write()

if write_storage_late:
if iutil.getSysroot() != iutil.getTargetPhysicalRoot():
blivet.setSysroot(iutil.getTargetPhysicalRoot(),
iutil.getSysroot())
storage.write()

# Now that we have the FS layout in the target, umount
# things that were in the legacy sysroot, and put them in
# the target root, except for the physical /. First,
# unmount all target filesystems.
storage.umountFilesystems()

# Explicitly mount the root on the physical sysroot
rootmnt = storage.mountpoints.get('/')
rootmnt.setup()
rootmnt.format.setup(rootmnt.format.options, chroot=iutil.getTargetPhysicalRoot())

# Everything else goes in the target root, including /boot
# since the bootloader code will expect to find /boot
# inside the chroot.
storage.mountFilesystems(skipRoot=True)
else:
storage.write()

# Do bootloader.
if willInstallBootloader:
with progress_report(_("Installing bootloader")):
Expand Down

0 comments on commit 0bbc9ad

Please sign in to comment.