return mount_overlay([state.root], state.workspace / "build-overlay", state.root)
+@contextlib.contextmanager
+def mount_volatile_overlay(state: MkosiState) -> Iterator[Path]:
+ with tempfile.TemporaryDirectory() as d:
+ Path(d).chmod(0o755)
+
+ with mount_overlay([state.root], Path(d), state.root) as p:
+ yield p
+
+
def finalize_mounts(config: MkosiConfig) -> list[PathString]:
sources = [
(src, Path.cwd() / (str(target).lstrip("/") if target else "."))
CHROOT_BUILDDIR="/work/build",
)
- with mount_build_overlay(state), mount_passwd(state.name, state.uid, state.gid, state.root):
+ with (
+ mount_build_overlay(state),\
+ mount_passwd(state.name, state.uid, state.gid, state.root),\
+ mount_volatile_overlay(state)\
+ ):
for script in state.config.build_scripts:
chroot = chroot_cmd(
state.root,