fix failure at second boot#2697
Open
hongxu-jia wants to merge 1 commit into
Open
Conversation
The issue occurs at unexpected shutdown (such as power-off, or ctrl + a
+x to exit qemu) after first boot, data was not completely saved to
disk.
------
Ignition has failed. Please ensure your config is valid. Note that only
Ignition spec v3.0.0+ configs are accepted.
A CLI validation tool to check this called ignition-validate can be
downloaded from GitHub:
https://github.com/coreos/ignition/releases
------
CoreOS uses boot args `ignition.firstboot' as flag for the first boot,
during first boot, ignition parse and apply user define config (add
user/passwd/ssh key), and remove the config file; then call script
/usr/libexec/coreos-ignition-firstboot-complete.
In script /usr/libexec/coreos-ignition-firstboot-complete, it remove
/boot/ignition.firstboot, the GRUB detect it and remove boot args
`ignition.firstboot' if /boot/ignition.firstboot does not exists at
second boot
If shundown at the time after ignition removes ignition user define config,
before script /usr/libexec/coreos-ignition-firstboot-complete removes
/boot/ignition.firstboot, the coming boot will be recognized as first
boot, but the ignition user define config is lost
Call sync to assure the remove operation on disk
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
jlebon
reviewed
Nov 9, 2023
Member
jlebon
left a comment
There was a problem hiding this comment.
Thanks, I think this makes sense overall. But actually, I think previously we wanted to move that logic to the initramfs. I still think that makes sense so that we greatly reduce the race window. It could pretty easily live in coreos-boot-edit.service nowadays.
I'm not suggesting you do that in this PR though. The code move is trivial, but it needs to be fully thought through first.
| /usr/lib/dracut/modules.d/50rdcore/rdcore zipl --boot-mount=/boot | ||
| fi | ||
|
|
||
| sync |
Member
There was a problem hiding this comment.
Can we also move this to right after the rm?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue occurs at unexpected shutdown (such as power-off, or ctrl + a +x to exit qemu) after first boot, data was not completely saved to disk.
Ignition has failed. Please ensure your config is valid. Note that only Ignition spec v3.0.0+ configs are accepted.
A CLI validation tool to check this called ignition-validate can be downloaded from GitHub:
https://github.com/coreos/ignition/releases
CoreOS uses boot args `ignition.firstboot' as flag for the first boot, during first boot, ignition parse and apply user define config (add user/passwd/ssh key), and remove the config file; then call script /usr/libexec/coreos-ignition-firstboot-complete.
In script /usr/libexec/coreos-ignition-firstboot-complete, it remove /boot/ignition.firstboot, the GRUB detect it and remove boot args `ignition.firstboot' if /boot/ignition.firstboot does not exists at second boot
If shundown at the time after ignition removes ignition user define config, before script /usr/libexec/coreos-ignition-firstboot-complete removes /boot/ignition.firstboot, the coming boot will be recognized as first boot, but the ignition user define config is lost
Call sync to assure the remove operation on disk