Worktree fix luks soft reboot#2219
Conversation
There was a problem hiding this comment.
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.
7d58038 to
774a042
Compare
|
This looks OK. But why is this CoreOS specific? Isn't Image Mode / bootc in the same boat here? |
|
@travier ah im sorry, yeah my description was a little too specific sounding, I was just giving examples. The changes also would fix it for bootc / Image Mode. I will update the description. Unless you were talking more about why I was conditionality pivoting for ostree systems only? |
|
I think my question is: What happens on Image Mode? If you take a bootc image and install it via Anaconda, does soft-reboot works? Is it anaconda that does the same workaround that we are adding here? Then adding it to Ignition makes sense as we use it instead of Anaconda. Otherwise if this does not work on Image Mode then we should probably figure out a fix that does not rely on Ignition. |
oooh that is a very fair concern, to be honest I am not sure; I can do some research but it is out of my initial knowledge scope. |
|
Alright so I did look into anaconda, its doing the same thing mostly. Its adding x-initrd.attach unconditionally for any LUKS device. @travier , In which case maybe we just drop our conditional. Makes it cleaner? |
Add x-initrd.attach option unconditionally to all LUKS crypttab entries. This prevents systemd-cryptsetup-generator from adding Conflicts=umount.target, which is necessary for soft-reboot to work correctly with LUKS.
774a042 to
01d9516
Compare
|
Thanks for finding rhinstaller/anaconda#6785, this helps with the context. Reading https://redhat.atlassian.net/browse/RHEL-112702 as well, this appear to be needed (wanted?) only for the root device? |
|
Are we writing a crypttab entry for the root device today? |
From my understanding there is no special case for root, so yes, if root is configured to be encrypted. ignition/docs/operator-notes.md Line 161 in 2446e1f ignition/internal/exec/stages/files/filesystemEntries.go Lines 38 to 98 in e3c445c |
travier
left a comment
There was a problem hiding this comment.
Thanks, code LGTM but if I understand correctlty, we should do that only for the root device and not for all mounts as those would be unmounted and re-mounted as needed on a soft reboot.
|
Another interesting element is that this will not fix soft reboot for existing systems, only new ones as Ignition only runs once: rhinstaller/anaconda#6785 (comment). I'll file a tracking issue so that we remember that. |
|
hmm looking at this more, I am questioning if this fix belongs in Ignition at all. The root LUKS device is set up by coreos-installer right? wdyt? should this be a coreos-installer change instead? |
|
The root LUKS device is setup by ignition on first boot via the transpose-fs logic that copies the rootfs content into ram, then sets up the LUKS device and then copies the rootfs content back. So I think this is the right place. Can you make a kola test for soft-reboot on LUKS in fedora-coreos-config? That should let us validate that this is the right fix. |
Add x-initrd.attach option unconditionally to all LUKS crypttab entries.
This prevents systemd-cryptsetup-generator from adding
Conflicts=umount.target, which is necessary for soft-reboot to work
correctly with LUKS.