grub: core.img: Reboot if configfile fails #585
Merged
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.
If GRUB attempts to load a config file from a boot partition that is empty or otherwise broken, it will sit forever at a rescue console, which is not particularly helpful in EC2.
gptprio.next decrements tries_left on partitions not yet marked successful, so rebooting will usually result in the correct behavior of rolling back.
Some diagnostic output is printed before sleeping for 30 seconds to help aid future debugging. No additional output is printed if the configfile boots successfully.
This also drops search_fs_uuid from being built into core.img, as we haven't used that since af72caf.
x86_64's core.img size went from 129659 bytes to 130203 bytes with this change.
Tested with QEMU on x86_64 with shell enabled by booting Thar, running
signpost upgrade-to-inactive
without writing anything to the disk, and rebooting. GRUB printed the diagnostic message, slept 30 seconds, and rebooted, which booted into set A. I didn't test aarch64 yet.There's still an open question on if we want to upgrade (and downgrade?) the GRUB core.img on older AMIs by (ab)using migrations.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.