From: Luca Boccassi Date: Sun, 21 Aug 2022 20:19:09 +0000 (+0100) Subject: manifest: include metadata about the image itself X-Git-Tag: v14~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59aa8283d5ce564d5ea7c04103168e4cf35eb552;p=thirdparty%2Fmkosi.git manifest: include metadata about the image itself --- diff --git a/mkosi/manifest.py b/mkosi/manifest.py index a0d004326..9d32afc64 100644 --- a/mkosi/manifest.py +++ b/mkosi/manifest.py @@ -234,7 +234,22 @@ class Manifest: return len(self.packages) > 0 def as_dict(self) -> Dict[str, Any]: + config = { + "name": self.args.image_id or "image", + "distribution": self.args.distribution.name, + "architecture": self.args.architecture, + } + if self.args.image_version is not None: + config["version"] = self.args.image_version + if self.args.release is not None: + config["release"] = self.args.release + return { + # Bump this when incompatible changes are made to the manifest format. + "manifest_version": 1, + # Describe the image itself. + "config": config, + # Describe the image content in terms of packages. "packages": [package.as_dict() for package in self.packages], }