Skip to content

Worktree fix luks soft reboot#2219

Draft
prestist wants to merge 2 commits intocoreos:mainfrom
prestist:worktree-fix-luks-soft-reboot
Draft

Worktree fix luks soft reboot#2219
prestist wants to merge 2 commits intocoreos:mainfrom
prestist:worktree-fix-luks-soft-reboot

Conversation

@prestist
Copy link
Copy Markdown
Collaborator

@prestist prestist commented Apr 8, 2026

No description provided.

Copy link
Copy Markdown

@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 introduces logic to detect if the system is running on ostree and updates the crypttab generation to include the 'x-initrd.attach' option when necessary. I have identified an issue where the ostree marker file is incorrectly being checked within the target sysroot instead of the host's runtime directory. Additionally, I have suggested updating the detection logic to support an environment variable override for better testability and recommended updating the test case to verify the full crypttab output.

@prestist prestist force-pushed the worktree-fix-luks-soft-reboot branch from b7c58a7 to 7d58038 Compare April 8, 2026 20:30
prestist added 2 commits April 8, 2026 16:43
Add tests verifying x-initrd.attach option is added to crypttab entries
on ostree systems. This prevents systemd-cryptsetup-generator from
tearing down LUKS devices during soft-reboot.

Related: coreos#2216
On ostree systems, soft-reboot fails with LUKS because systemd tears down
the crypto device during shutdown. Unlike traditional systems where the
kernel root mount prevents this, ostree's /sysroot is a regular mount.

Add x-initrd.attach to crypttab entries on ostree systems (detected via
/run/ostree-booted or OSTREE_BOOTED=1 env var). This tells systemd-
cryptsetup-generator to skip adding Conflicts=umount.target, preventing
device teardown.

Non-ostree systems are unchanged.

Fixes: coreos#2216
@prestist prestist force-pushed the worktree-fix-luks-soft-reboot branch from 7d58038 to 774a042 Compare April 8, 2026 20:43
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.

1 participant