]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Set $QEMU_ARCHITECTURE for configure scripts
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 12 May 2024 09:54:18 +0000 (11:54 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Sun, 12 May 2024 12:44:09 +0000 (14:44 +0200)
Allows trivial access to the qemu binary that mkosi will use to run
qemu.

mkosi/__init__.py
mkosi/resources/mkosi.md

index 724158d927ddc142b3a388e438a99a56e793c08f..44608d5af39047b1bc1fa3c04f9420dd7ab3dcb3 100644 (file)
@@ -446,6 +446,7 @@ def run_configure_scripts(config: Config) -> Config:
         DISTRIBUTION=str(config.distribution),
         RELEASE=config.release,
         ARCHITECTURE=str(config.architecture),
+        QEMU_ARCHITECTURE=config.architecture.to_qemu(),
         SRCDIR="/work/src",
         MKOSI_UID=str(INVOKING_USER.uid),
         MKOSI_GID=str(INVOKING_USER.gid),
index db34c64854915e79f216a4b3d5b75d8a698ea34f..965bd6044257584cdbf3b7f1eee0c8ef20a4156b 100644 (file)
@@ -2171,6 +2171,10 @@ Scripts executed by mkosi receive the following environment variables:
   architecture of the host machine. See the documentation of
   `Architecture=` for possible values for this variable.
 
+* `$QEMU_ARCHITECTURE` contains the architecture from `$ARCHITECTURE` in
+   the format used by `qemu`. Useful for finding the qemu binary (
+    `qemu-system-$QEMU_ARCHITECTURE`).
+
 * `$DISTRIBUTION` contains the distribution from the `Distribution=` setting.
 
 * `$RELEASE` contains the release from the `Release=` setting.
@@ -2269,6 +2273,7 @@ Consult this table for which script receives which environment variables:
 | Variable            | `mkosi.configure` | `mkosi.sync` | `mkosi.prepare` | `mkosi.build` | `mkosi.postinst` | `mkosi.finalize` | `mkosi.clean` |
 |---------------------|-------------------|--------------|-----------------|---------------|------------------|------------------|---------------|
 | `ARCHITECTURE`      | X                 | X            | X               | X             | X                | X                | X             |
+| `QEMU_ARCHITECTURE` | X                 |              |                 |               |                  |                  |               |
 | `DISTRIBUTION`      | X                 | X            | X               | X             | X                | X                | X             |
 | `RELEASE`           | X                 | X            | X               | X             | X                | X                | X             |
 | `PROFILE`           | X                 | X            | X               | X             | X                | X                | X             |