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.
Adds a new
late_resume
parameter, which moves the trigger point frominit_early
toinit_premount
.This allows cryptsetup and LVM to initialize before the system attempts to resume, making encrypted or otherwise non-trival-to-access swap partitions accessible.
In addition it will use allow using
resume=UUID=*
to specify the resume device, as any partitions that aren't directly on disk don't have aPARTUUID
.Which this option is safe in theory and I have been using it without issue for a few months, it is important to note that configurations that cause writes to the device before triggering resume run the risk of system instability and data loss.
I have purposefully used
init_premount
section to trigger before filesystems are mounted as the kernel shouldn't make any metadata changes (save for possibly LVM access times) before mounting filesystems.I have also made sure to include warnings in the configuration docs and the output of ugrd when this option is enabled to make sure users understand the implications (including a link to the kernel docs that detail the risks).
I'm not sure whether the warning is overkill, as I believe this option is safe to use under normal encrypted swap and lvm setups, but to cater to potentially non-standard setups I think it's important to have.