From: Daan De Meyer Date: Tue, 26 Dec 2023 15:21:06 +0000 (+0100) Subject: Mount scripts into sandbox as well X-Git-Tag: v20~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=718ce858c3dc235dec6a65dfd08da9d12e2ea8c0;p=thirdparty%2Fmkosi.git Mount scripts into sandbox as well The script might not come from the directory mkosi is running in so we have to make sure it gets mounted into the sandbox. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index aef3f7ba2..dca4f90ac 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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,