]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
skip passwd bind mounts if the path does not exist on the host
authorMalte Poll <mp@edgeless.systems>
Mon, 14 Aug 2023 18:03:14 +0000 (20:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Aug 2023 18:58:00 +0000 (20:58 +0200)
mkosi/run.py

index e1ed6ca84ceaa99fdc92f2f1eacc029f4bed88b6..96290b5ae05bb1b781eeb7397b5799b67c777278 100644 (file)
@@ -344,6 +344,8 @@ def finalize_passwd_mounts(root: Path) -> list[PathString]:
     options: list[PathString] = []
 
     for f in ("passwd", "group", "shadow", "gshadow"):
+        if not (Path("etc") / f).exists():
+            continue
         p = root / "etc" / f
         if p.exists():
             options += ["--bind", p, f"/etc/{f}"]