From: Daan De Meyer Date: Fri, 20 Sep 2024 11:23:46 +0000 (+0200) Subject: Move /etc/static symlink handling to finalize_crypto_mounts() X-Git-Tag: v25~278^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f87853999c3b4fa8de46df50e935f6a0035a4b2d;p=thirdparty%2Fmkosi.git Move /etc/static symlink handling to finalize_crypto_mounts() --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 8072cc308..cfb21c1c3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1043,10 +1043,6 @@ def install_sandbox_trees(config: Config, dst: Path) -> None: # Ensure /etc exists in the sandbox (dst / "etc").mkdir(exist_ok=True) - # Required to be able to access certificates in the sandbox when running from nix. - if Path("/etc/static").is_symlink(): - (dst / "etc/static").symlink_to(Path("/etc/static").readlink()) - if Path("/etc/passwd").exists(): shutil.copy("/etc/passwd", dst / "etc/passwd") if Path("/etc/group").exists(): diff --git a/mkosi/mounts.py b/mkosi/mounts.py index 29567f2a4..01ec0cb47 100644 --- a/mkosi/mounts.py +++ b/mkosi/mounts.py @@ -96,13 +96,14 @@ def finalize_crypto_mounts(config: Config) -> list[PathString]: Path("etc/ssl"), Path("etc/ca-certificates"), Path("etc/pacman.d/gnupg"), + Path("etc/static"), Path("var/lib/ca-certificates"), ) if (root / subdir).exists() ] return flatten( - ("--ro-bind", src, target) + ("--symlink", src.readlink(), target) if src.is_symlink() else ("--ro-bind", src, target) for src, target in sorted(set(mounts), key=lambda s: s[1]) )