]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Copy /etc/hosts into sandbox as well if it exists
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 4 Jan 2025 13:37:54 +0000 (14:37 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Sat, 4 Jan 2025 15:55:25 +0000 (16:55 +0100)
mkosi/__init__.py

index 57eab634d06919777f81241228d4254ab1f1bafa..1701b1a46bcba88735a36475029e0b3b7d69cc2e 100644 (file)
@@ -1100,6 +1100,9 @@ def install_sandbox_trees(config: Config, dst: Path) -> None:
             )
         )
 
+    if not (dst / "etc/hosts").exists() and Path("/etc/hosts").exists():
+        shutil.copy("/etc/hosts", dst / "etc/hosts")
+
     Path(dst / "etc/static").unlink(missing_ok=True)
     if (config.tools() / "etc/static").is_symlink():
         (dst / "etc/static").symlink_to((config.tools() / "etc/static").readlink())