From 0b4be06cf99d5b7eb319f049aee8b13ccba488fd Mon Sep 17 00:00:00 2001 From: Eugeny Shcheglov Date: Fri, 26 Jul 2024 13:33:40 +0300 Subject: [PATCH] Documentation update Add IMAGE_ID and IMAGE_VERSION to the available variables list --- mkosi/resources/mkosi.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index 3438ec66b..ffd026d3a 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -2166,6 +2166,10 @@ Scripts executed by mkosi receive the following environment variables: current image. This file can be parsed inside scripts to gain access to all settings for the current image. +* `$IMAGE_ID` contains the identifier from the `ImageId=` or `--image-id=` setting. + +* `$IMAGE_VERSION` contains the version from the `ImageVersion=` or `--image-version=` setting + Consult this table for which script receives which environment variables: | Variable | `configure` | `sync` | `prepare` | `build` | `postinst` | `finalize` | `postoutput` | `clean` | @@ -2196,6 +2200,8 @@ Consult this table for which script receives which environment variables: | `MKOSI_UID` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | `MKOSI_GID` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | `MKOSI_CONFIG` | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| `IMAGE_ID` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| `IMAGE_VERSION` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Additionally, when a script is executed, a few scripts are made available via `$PATH` to simplify common usecases.