SRCDIR="/work/src",
MKOSI_UID=str(INVOKING_USER.uid),
MKOSI_GID=str(INVOKING_USER.gid),
+ MKOSI_CONFIG="/work/config.json",
CACHED=one_zero(have_cache(context.config)),
)
*sources,
*finalize_crypto_mounts(context.config.tools()),
"--ro-bind", script, "/work/sync",
+ "--ro-bind", context.workspace / "config.json", "/work/config.json",
"--chdir", "/work/src",
]
CHROOT_SCRIPT="/work/prepare",
MKOSI_UID=str(INVOKING_USER.uid),
MKOSI_GID=str(INVOKING_USER.gid),
+ MKOSI_CONFIG="/work/config.json",
WITH_DOCS=one_zero(context.config.with_docs),
WITH_NETWORK=one_zero(context.config.with_network),
WITH_TESTS=one_zero(context.config.with_tests),
network=True,
options=sources + [
"--ro-bind", script, "/work/prepare",
+ "--ro-bind", context.workspace / "config.json", "/work/config.json",
"--ro-bind", cd, "/work/scripts",
"--bind", context.root, context.root,
*context.config.distribution.package_manager(context.config).mounts(context),
CHROOT_SCRIPT="/work/build-script",
MKOSI_UID=str(INVOKING_USER.uid),
MKOSI_GID=str(INVOKING_USER.gid),
+ MKOSI_CONFIG="/work/config.json",
WITH_DOCS=one_zero(context.config.with_docs),
WITH_NETWORK=one_zero(context.config.with_network),
WITH_TESTS=one_zero(context.config.with_tests),
network=context.config.with_network,
options=sources + [
"--ro-bind", script, "/work/build-script",
+ "--ro-bind", context.workspace / "config.json", "/work/config.json",
"--ro-bind", cd, "/work/scripts",
"--bind", context.root, context.root,
"--bind", context.install_dir, "/work/dest",
PACKAGEDIR="/work/packages",
MKOSI_UID=str(INVOKING_USER.uid),
MKOSI_GID=str(INVOKING_USER.gid),
+ MKOSI_CONFIG="/work/config.json",
)
with (
network=context.config.with_network,
options=sources + [
"--ro-bind", script, "/work/postinst",
+ "--ro-bind", context.workspace / "config.json", "/work/config.json",
"--ro-bind", cd, "/work/scripts",
"--bind", context.root, context.root,
"--bind", context.staging, "/work/out",
CHROOT_SCRIPT="/work/finalize",
MKOSI_UID=str(INVOKING_USER.uid),
MKOSI_GID=str(INVOKING_USER.gid),
+ MKOSI_CONFIG="/work/config.json",
)
with (
network=context.config.with_network,
options=sources + [
"--ro-bind", script, "/work/finalize",
+ "--ro-bind", context.workspace / "config.json", "/work/config.json",
"--ro-bind", cd, "/work/scripts",
"--bind", context.root, context.root,
"--bind", context.staging, "/work/out",
workspace = Path(tempfile.mkdtemp(dir=config.workspace_dir_or_default(), prefix="mkosi-workspace"))
stack.callback(lambda: rmtree(workspace, sandbox=config.sandbox))
(workspace / "tmp").mkdir(mode=0o1777)
+ (workspace / "config.json").write_text(config.to_json())
with scopedenv({"TMPDIR" : os.fspath(workspace / "tmp")}):
try: