From 827b238764351c15844473cc68f8ece881486ea5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 21 Dec 2023 12:42:46 +0100 Subject: [PATCH] format/v2: add new "partition" field to "describe_mount" --- osbuild/formats/v2.py | 3 ++- test/mod/test_fmt_v2.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/osbuild/formats/v2.py b/osbuild/formats/v2.py index 4ce5ae6d..775be12c 100644 --- a/osbuild/formats/v2.py +++ b/osbuild/formats/v2.py @@ -84,9 +84,10 @@ def describe(manifest: Manifest, *, with_id=False) -> Dict: if mnt.device: desc["source"] = mnt.device.name - if mnt.options: desc["options"] = mnt.options + if mnt.partition: + desc["partition"] = mnt.partition return desc def describe_mounts(mounts: Dict): diff --git a/test/mod/test_fmt_v2.py b/test/mod/test_fmt_v2.py index de8e92ba..78f7649b 100644 --- a/test/mod/test_fmt_v2.py +++ b/test/mod/test_fmt_v2.py @@ -80,6 +80,13 @@ BASIC_PIPELINE = { "filename": "empty.img" } }, + "var": { + "type": "org.osbuild.loopback", + "options": { + "filename": "empty.img", + "partscan": True, + }, + }, }, "mounts": [ { @@ -93,6 +100,13 @@ BASIC_PIPELINE = { "type": "org.osbuild.noop", "source": "boot", "target": "/boot", + }, + { + "name": "var", + "type": "org.osbuild.noop", + "source": "var", + "target": "/var", + "partition": 1, } ] }