debian-forge/tools
Pierre-Yves Chibon 65b98448c6 Add support for defining variables from other variables or basic expression
Using this we can now define variables in the variable section using
basic expression that are evaluated as f-string.
For example, you can use the syntax:

```
"mpp-vars": {
   "rootfs_uuid": {"mpp-format-string": "{__import__('uuid').uuid1()}"},
   "bootfs_uuid": "156f0420-627b-4151-ae6f-fda298097515"
},
```

This will automatically call uuid.uuid1() for rootfs_uuid, thus allowing
to dynamically set the uuid for the rootfs variable.
This variable being able to be overridden via the -D argument of the
osbuild-mpp tool.

In addition, you can also define variable based on variables defined
above, for example:

```
"mpp-vars": {
   "rootfs_size": 4294967296,
   "homefs_size": {"mpp-format-string": "{rootfs_size}"}
},
```

For context, we're in particular interested in this for the uuid
generation, as we have had issues with xfs failing to mount a filesystem
if the uuid is already mounted. In particular, if we built e.g. a
raspberry pi image using osbuild and then we use that raspberry pi for building
the same manifest (typically a later version of it) the osbuild fails in the
loopback mount case. Being able to easily support reproducible fixed-uuid
images, as well as ones with a real unique uuid makes a lot of sense.

This commit was created with a lot of inputs from Alexander Larsson.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-09-24 13:32:51 +02:00
..
inline-source.py tools: add inline-source.py 2021-05-12 14:26:16 +02:00
lorax-template-pkgs.py tools/lorax-templates-pkg: set executable bit 2021-07-15 23:08:51 +01:00
osbuild mpp: combine depsolve and import into mpp.py 2021-06-30 20:26:07 +01:00
osbuild-mpp Add support for defining variables from other variables or basic expression 2021-09-24 13:32:51 +02:00
tree-diff tree-diff: properly detect missing selinux labels 2021-01-26 12:09:23 +01:00