]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Mount scripts into sandbox as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 26 Dec 2023 15:21:06 +0000 (16:21 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 26 Dec 2023 15:58:39 +0000 (16:58 +0100)
The script might not come from the directory mkosi is running in so
we have to make sure it gets mounted into the sandbox.

mkosi/__init__.py

index aef3f7ba2fb9ffb6f296f89f369594c124b2e511..dca4f90acedae4eccf06d61361cdacb578f6488e 100644 (file)
@@ -462,7 +462,7 @@ def run_prepare_scripts(state: MkosiState, build: bool) -> None:
                     state,
                     script_maybe_chroot(script, "/work/prepare") + [arg],
                     network=True,
-                    options=sources,
+                    options=sources + ["--ro-bind", script, script],
                     scripts=hd,
                     env=env | state.config.environment,
                     stdin=sys.stdin,
@@ -535,7 +535,7 @@ def run_build_scripts(state: MkosiState) -> None:
                     state,
                     script_maybe_chroot(script, "/work/build-script") + cmdline,
                     network=state.config.with_network,
-                    options=sources,
+                    options=sources + ["--ro-bind", script, script],
                     scripts=hd,
                     env=env | state.config.environment,
                     stdin=sys.stdin,
@@ -590,7 +590,7 @@ def run_postinst_scripts(state: MkosiState) -> None:
                     state,
                     script_maybe_chroot(script, "/work/postinst") + ["final"],
                     network=state.config.with_network,
-                    options=sources,
+                    options=sources + ["--ro-bind", script, script],
                     scripts=hd,
                     env=env | state.config.environment,
                     stdin=sys.stdin,
@@ -645,7 +645,7 @@ def run_finalize_scripts(state: MkosiState) -> None:
                     state,
                     script_maybe_chroot(script, "/work/finalize"),
                     network=state.config.with_network,
-                    options=sources,
+                    options=sources + ["--ro-bind", script, script],
                     scripts=hd,
                     env=env | state.config.environment,
                     stdin=sys.stdin,