stages/preptree: move home dirs to var/home

Since `/home` will not end up in the commit¹ move the home
directories to `/var/home`. This is done after the new root
file system has been initialized, and only if `/home` is not
empty.

¹ it is neither copied back in the preptree stage itself, nor
  would it be picked up by rpm-ostree compose tree postprocess
  were it copied back.
This commit is contained in:
Christian Kellner 2021-03-16 17:39:49 +00:00 committed by Achilleas Koutsou
parent f13ea76663
commit c3dde19d72

View file

@ -140,6 +140,14 @@ def main(tree, options):
move("boot", root, tree)
move("var", root, tree)
# move /home over to /var in case it is not empty
# rpm-ostree compose postprocess will convert the
# home dirs (and sub-dirs) to systemd-tmpfiles.
# NB: files and their content will not be converted
if any(os.scandir(f"{root}/home")):
move("home", root, f"{tree}/var")
for name in ["bin", "lib", "lib32", "lib64", "sbin"]:
if os.path.lexists(f"{root}/{name}"):
move(name, root, tree)