From d5fc082dab72c1a5586b20b80d9f5101e0bed229 Mon Sep 17 00:00:00 2001 From: vxtls <187420201+vxtls@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:23:48 -0500 Subject: [PATCH] fix(stage0-image): preserve runtime /steps/env while syncing step sources --- rootfs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rootfs.py b/rootfs.py index 1d141905..748a41ea 100755 --- a/rootfs.py +++ b/rootfs.py @@ -95,6 +95,11 @@ mirrors = sys.argv[8:] old_config_path = os.path.join(mountpoint, "steps", "bootstrap.cfg") if not os.path.isfile(old_config_path): raise SystemExit(f"Missing config in stage0 image: {old_config_path}") +old_env_path = os.path.join(mountpoint, "steps", "env") +old_env_content = None +if os.path.isfile(old_env_path): + with open(old_env_path, "rb") as env_file: + old_env_content = env_file.read() with open(old_config_path, "r", encoding="utf-8") as cfg: lines = [ @@ -111,6 +116,9 @@ if os.path.isdir(dest_steps): shutil.copytree(steps_dir, dest_steps, dirs_exist_ok=True) else: shutil.copytree(steps_dir, dest_steps) +if old_env_content is not None: + with open(os.path.join(dest_steps, "env"), "wb") as env_file: + env_file.write(old_env_content) config_path = os.path.join(dest_steps, "bootstrap.cfg") if build_guix_also: