Currently image-builder sources configuration from /usr/lib/image-builder/bootc. Specifically it will read disk.yaml (for partition table information), and/or iso.yaml (for ISO configuration).
These files partially define how image-builder will convert a given bootable container into an artifact.
There is a wish from (amongst others) the CoreOS team to be able to select how things are converted, not based on a different input container, but based on a runtime option. As an example for s390x secure execution the partition table needs to include verity partitions but we can imagine other usecases such as a btrfs or ext4 variant for Fedora images. These variants would be user-selectable.
The idea is that we consider any files found in /usr/lib/image-builder/bootc the 'default' variant. By that we mean 'no variant selected'.
Variants can be defined in /usr/lib/image-builder/bootc/variant.d/ each one is a directory and the variant name is the directory name, for example: /usr/lib/image-builder/bootc/variant.d/secure-execution containing a disk.yaml with specific partition layout for secure-execution. The person building the bootable container can decide which variants are included where (and on which architectures) through the use of $TARGETARCH or any logic they want to use.
Another example of this would be to have a rpi3 and a rpi4+ variant where the former is MBR-partitioned and the latter uses GPT-partitioning.
image-builder (build|manifest) would gain a new command line option tentatively named --bootc-variant which takes a string and modifies the path we look at for the configuration. Handling errors if it doesn't exist.
image-builder bootc inspect would also get a --variant argument to select the variant to inspect for.
image-builder bootc variants would list the available variants (could live elsewhere too?).
It's up to the publishers of the containers to make people aware of variant usage. A full end-to-end example would be:
$ image-builder bootc variants --ref quay.io/fedora/fedora-bootc:latest
btrfs
plain
$ image-builder build --bootc-ref quay.io/fedora/fedora-bootc:latest --bootc-variant plain
# ...
Currently
image-buildersources configuration from/usr/lib/image-builder/bootc. Specifically it will readdisk.yaml(for partition table information), and/oriso.yaml(for ISO configuration).These files partially define how
image-builderwill convert a given bootable container into an artifact.There is a wish from (amongst others) the CoreOS team to be able to select how things are converted, not based on a different input container, but based on a runtime option. As an example for
s390xsecure execution the partition table needs to include verity partitions but we can imagine other usecases such as abtrfsorext4variant for Fedora images. These variants would be user-selectable.The idea is that we consider any files found in
/usr/lib/image-builder/bootcthe 'default' variant. By that we mean 'no variant selected'.Variants can be defined in
/usr/lib/image-builder/bootc/variant.d/each one is a directory and the variant name is the directory name, for example:/usr/lib/image-builder/bootc/variant.d/secure-executioncontaining adisk.yamlwith specific partition layout forsecure-execution. The person building the bootable container can decide which variants are included where (and on which architectures) through the use of$TARGETARCHor any logic they want to use.Another example of this would be to have a
rpi3and arpi4+variant where the former is MBR-partitioned and the latter uses GPT-partitioning.image-builder (build|manifest)would gain a new command line option tentatively named--bootc-variantwhich takes a string and modifies the path we look at for the configuration. Handling errors if it doesn't exist.image-builder bootc inspectwould also get a--variantargument to select the variant to inspect for.image-builder bootc variantswould list the available variants (could live elsewhere too?).It's up to the publishers of the containers to make people aware of variant usage. A full end-to-end example would be: