From: Daan De Meyer Date: Wed, 6 Sep 2023 14:33:07 +0000 (+0200) Subject: Pass environment to initrd and tools tree builds X-Git-Tag: v16~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c88631b7594a4bd2e33168ecdc660381b9e87fb;p=thirdparty%2Fmkosi.git Pass environment to initrd and tools tree builds The environment might contain http_proxy and https_proxy which need to be passed on to child builds to make things work correctly. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 2b53d75df..3ba440c68 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -943,6 +943,7 @@ def build_initrd(state: MkosiState) -> Path: *(["--timezone", state.config.timezone] if state.config.timezone else []), *(["--hostname", state.config.hostname] if state.config.hostname else []), *(["--root-password", rootpwopt] if rootpwopt else []), + *([f"--environment={k}='{v}'" for k, v in state.config.environment.items()]), *(["-f"] * state.args.force), "build", ] @@ -2176,6 +2177,7 @@ def finalize_tools(args: MkosiArgs, presets: Sequence[MkosiConfig]) -> Sequence[ "--bootable", "no", "--manifest-format", "", *(["--source-date-epoch", str(p.source_date_epoch)] if p.source_date_epoch is not None else []), + *([f"--environment={k}='{v}'" for k, v in p.environment.items()]), *(["-f"] * args.force), "build", ]