From: Daan De Meyer Date: Sat, 4 Jan 2025 13:37:54 +0000 (+0100) Subject: Copy /etc/hosts into sandbox as well if it exists X-Git-Tag: v25~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91bf2dbba58e5a3eb56628e920d5e5b23460dadc;p=thirdparty%2Fmkosi.git Copy /etc/hosts into sandbox as well if it exists --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 57eab634d..1701b1a46 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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())