]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Pass environment to initrd and tools tree builds
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Sep 2023 14:33:07 +0000 (16:33 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Sep 2023 14:42:16 +0000 (16:42 +0200)
The environment might contain http_proxy and https_proxy which
need to be passed on to child builds to make things work correctly.

mkosi/__init__.py

index 2b53d75df79cc97341dd40c9a7689d7aff5741e0..3ba440c683a4e2eed6ef11b6c15b049636f316bc 100644 (file)
@@ -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",
         ]