Skip to content

Stock ignition configuration#528

Open
davidcassany wants to merge 5 commits into
SUSE:mainfrom
davidcassany:stock_ignition_configuration
Open

Stock ignition configuration#528
davidcassany wants to merge 5 commits into
SUSE:mainfrom
davidcassany:stock_ignition_configuration

Conversation

@davidcassany

@davidcassany davidcassany commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR adds the --mode merge and --mode splitmerge in elemental3 customize. If mode merge or splitmerge is set Elemental will embed the Ignition configuration as an initrd extension. With this option the ignition configuration will be seen as base configuration from Ignition's PoV and allow to merge on top additional user configuration. Moreover, the configuration partition, if any at all, will be labeled with CATALYST instead of ignition if no <mnt>/ignition/config.ign file is present. merge mode keeps the rest of the configuration embedded in a configuration partition. splitmerge generates non ignition configuration in a configuration directory separate from the image.

This is handy in scenarios where the user configuration is provided by the platform instead of being embedded within the image itself. Consider cases such as deploying in cloud providers.

@davidcassany
davidcassany requested a review from a team as a code owner July 13, 2026 10:18
@davidcassany
davidcassany marked this pull request as draft July 13, 2026 10:18
@davidcassany

Copy link
Copy Markdown
Contributor Author

This PR is based on top of #522 and #523, because of that it is marked as draft. The diff will be way easier to read and review once #522 and #523 are part of the main branch.

@davidcassany
davidcassany force-pushed the stock_ignition_configuration branch 2 times, most recently from 9298217 to dc5da9c Compare July 20, 2026 14:05
@davidcassany
davidcassany marked this pull request as ready for review July 20, 2026 14:06

@ipetrov117 ipetrov117 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this @davidcassany! I left one suggestions that I would be interested to hear your thoughts on.

Apart from that, I hit an error when trying to test the changes. Below I tried to explain what I found, but the TL;DR is that it seems to be related to how we handle already defined initrd extensions during the installer's boot environment.

Error hit when doing ./elemental3ctl --debug install at install time:

INFO[0033] Installing kernel/initrd
INFO[0033] Reading OS Release
DEBU[0033] Concatenating extensions [/run/initramfs/live/Install/0-0-initrdExt.cpio] and initrd "/tmp/elemental_system158623787/@/.snapshots/1/snapshot/usr/lib/modules/6.12.0-160000.35-default/initrd"
ERRO[0033] Closing transaction due to a failure: installing bootloader: installing kernel+initrd: copying initrd '/tmp/elemental_system158623787/@/.snapshots/1/snapshot/usr/lib/modules/6.12.0-160000.35-default/initrd': stat /run/initramfs/live/Install/0-0-initrdExt.cpio: no such file or directory
[  243.306303][ T2088] EXT4-fs (sda3): unmounting filesystem e41514e2-03df-4660-adb3-cc64998c0971.

IIUC, this is happening because at install time we setup the recovery partition and run the addInstallationAssets boot config logic, which again attempts to copy the files from what is defined under initrdExtensions to /run/initramfs/live/Install/<index>-<entry-as-seen-in-initrdExtensions>. However, because the Deployment object at install time is populated from the /run/initramfs/live/Install/install.yaml file, which is already defined like so:

...
bootloader:
    ...
    initrdExtensions:
        - /run/initramfs/live/Install/0-initrdExt.cpio

the function adds an extra 0 index to the 0-initrdExt.cpio extension, which produces an invalid name that makes the underlying ConcatFiles function to fail with the mentioned error.

Please let me know whether I am doing something wrong, both when customising the image and operating in the installer boot environment, I am using an elemental3ctl binary built with this PR's changes.

Comment thread internal/cli/cmd/customize.go Outdated
@davidcassany

Copy link
Copy Markdown
Contributor Author

Apart from that, I hit an error when trying to test the changes. Below I tried to explain what I found, but the TL;DR is that it seems to be related to how we handle already defined initrd extensions during the installer's boot environment.

Oh damn, yes I under estimated the change to rename files with a prefix to prevent overlaps, this logic gets called twice and causes the glitch, my bad. I am looking at it.

If 'merge' or 'splitmerge' modes are set the ignition
configuration file is merged as part of the initrd
(as an initrd extension) and included into the image.

'merge' keeps non ignition configuration embedded in a
config partition. 'splitmerge' generates non ignition
configuration in a configuration directory separate from
the image.

This allows adding Ignition's user configuration to be merged
at runtime. Configuration which could be provided by the
platform (e.g. public cloud).

Signed-off-by: David Cassany <dcassany@suse.com>

WIP

Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
Use 'ignition' label only if there is the user ignition configuration
included. Otherwise it uses the 'CATALYST' label. This allows to attacth
an additional 'ignition' device at boot time to provide user Ignition
configuration.

Signed-off-by: David Cassany <dcassany@suse.com>
This commit fixes a regression introduced in 62693ea. The initrd
extension files should only be renamed in case of overlap, otherwise
the files are renamed twice at customize time and at install time
when feeding the recovery partition. The second rename is causing
a failure as at this stage the installation assests are not
expected to be changed anymore as they are already referenced in
the install.yaml.

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany
davidcassany force-pushed the stock_ignition_configuration branch from cf686ee to e206e8d Compare July 21, 2026 13:50
@davidcassany

Copy link
Copy Markdown
Contributor Author

@ipetrov117 the regression seen on ISO installation is fixed. Moreover I also extended the mode flag with two additional modes merge and splitmerge. This way the current behavior remains unchanged and it adds some more flexibility on how to define ignition configuration. We can follow up on a UX discussion what and how we want to expose base configuration to the user.

@ipetrov117 ipetrov117 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidcassany thanks, this looks great!

@davidcassany
davidcassany force-pushed the stock_ignition_configuration branch 2 times, most recently from 62aad9e to bb2ea12 Compare July 23, 2026 14:38
@davidcassany

Copy link
Copy Markdown
Contributor Author

As discussed I changed the implementation to always set ignition configuration as stock base configuration. So no further modes have been applied and two existing ones changed their behavior to always embed the ignition configuration into the initrd. This allows to extend and/or overwrite ignition configuration at run time by merging the user configuration on top.

@davidcassany
davidcassany force-pushed the stock_ignition_configuration branch from bb2ea12 to 37fdc48 Compare July 23, 2026 14:49
Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany
davidcassany force-pushed the stock_ignition_configuration branch from 37fdc48 to 1f9cf82 Compare July 23, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants