Skip to content

Conversation

@cgwalters
Copy link
Collaborator

Clean up systemd credentials handling

Create a new credentials module that consolidates systemd credential
injection functionality.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters walters@verbum.org


ephemeral: Use SMBIOS credentials for systemd units

Fix ephemeral mode to use SMBIOS credentials (systemd.extra-unit.*) instead
of writing systemd units directly to /run/source-image/etc/systemd/system/.
This addresses ConditionFirstBoot issues on Fedora CoreOS where directly
written units trigger systemd preset cleanup.

The libvirt mode already uses SMBIOS credentials successfully. This change
aligns ephemeral mode with that proven approach.

Fixes: #106

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters walters@verbum.org


Create a new credentials module that consolidates systemd credential
injection functionality.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant improvement, refactoring the ephemeral mode to use SMBIOS credentials for systemd units instead of writing them to the guest filesystem. This aligns it with the libvirt mode and addresses potential issues with ConditionFirstBoot. The consolidation of logic into a new credentials module is also a great step for maintainability. The changes are well-executed and align with the PR's goals. I have one minor suggestion to improve code clarity.

@HuijingHei
Copy link

Cool, to-disk works now, will do more testing about image tomorrow, thank you for the quickly fixing!
$ bcvk to-disk --format=qcow2 --disk-size 20G --filesystem xfs localhost/test:latest fcos.qcow2

@cgwalters cgwalters enabled auto-merge (rebase) October 30, 2025 15:05
Copy link

@HuijingHei HuijingHei left a comment

Choose a reason for hiding this comment

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

LGTM

@cgwalters
Copy link
Collaborator Author

OK this doesn't work on stream9 because there's no support for systemd.extra-unit.* there...in ephemeral we have "choices", from appending to the initramfs or arbitrarily adding a new generator into /usr/lib/systemd/system-generator...there might be something else I'm missing.

Fix ephemeral mode to use SMBIOS credentials (systemd.extra-unit.*) instead
of writing systemd units directly to `/run/source-image/etc/systemd/system/`.
This addresses ConditionFirstBoot issues on Fedora CoreOS where directly
written units trigger systemd preset cleanup.

The libvirt mode already uses SMBIOS credentials successfully. This change
aligns ephemeral mode with that proven approach.

Fixes: bootc-dev#106

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the extra-unit-ephemeral branch from af46809 to 3f1e614 Compare October 30, 2025 22:07
@cgwalters
Copy link
Collaborator Author

Well I just hacked it for now in to-disk

@cgwalters cgwalters merged commit e0a14a6 into bootc-dev:main Nov 3, 2025
2 of 3 checks passed
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.

ephemeral: change systemd units to handle ConditionFirstBoot

3 participants