[PATCH 3/6] install: Handle distinct physical root/sysroot

Chris Lumens clumens at redhat.com
Mon Apr 28 17:39:45 UTC 2014


> @@ -165,7 +167,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.osname
> +                          and not flags.flags.dirInstall)
> +    if not write_storage_late:
>          storage.write()
>  
>      # Do packaging.

If you are just trying to check that the "ostreesetup" command has been
used, you can reference ksdata.ostreesetup.seen.  This should have the
same effect as the above given that the osname attribute is required,
but skips all the None vs. "" vs. set business and reads a little
clearer to me.

> @@ -188,9 +192,25 @@ 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 /
> +            storage.umountFilesystems()
> +            rootmnt = storage.mountpoints.get('/')
> +            rootmnt.setup()
> +            # Explicitly mount the root on the physical sysroot
> +            rootmnt.format.setup(rootmnt.format.options, chroot=iutil.getTargetPhysicalRoot())
> +            # But everything else goes in the target root
> +            storage.mountFilesystems(skipRoot=True)
> +        else:
> +            storage.write()
> +    
>      # Do bootloader.
>      if willInstallBootloader:
>          with progress_report(_("Installing bootloader")):

I'd love to see some blank lines in this block.

- Chris


More information about the anaconda-patches mailing list