RFE: Define a hibernate-safe rpm-ostree deployment contract for Atomic Desktops #112
Labels
No labels
docs
kind
bug
kind
enhancement
kind
package-request
release
f40
release
f41
release
f42
release
f43
release
f44
release
f45
release/rawhide
upstream
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
atomic-desktops/tracker#112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Please define and implement a production-grade hibernate/resume safety contract for Fedora Atomic Desktops when an rpm-ostree deployment is pending.
This is not a request to enable hibernation by default on every laptop. It is a request to make opt-in hibernation safe, predictable, and architecturally correct on Fedora Atomic Desktops.
The main requirement is:
In other words, a system that hibernates from deployment A must either resume into deployment A, or the hibernate operation must be rejected before the system powers off. It must not resume or boot in an undefined way through deployment B.
Background
On a traditional mutable Fedora Workstation installation, hibernation can be configured manually with persistent swap, proper initramfs/resume configuration, and suitable hardware. I have used hibernation for years on Fedora Workstation and Ubuntu without issues.
On Fedora Atomic Desktops, the situation is different because rpm-ostree can stage a new deployment for the next boot while the currently running deployment remains active.
A typical problematic scenario is:
Hibernate/resume requires a strong compatibility guarantee between the saved memory image and the kernel/initramfs/deployment used to resume it. If the hibernation image was created by deployment A, resume must not silently continue through deployment B.
Why simple user notification is not enough
Hibernate is especially important on laptops and other personal systems exactly when the user is not actively operating the machine.
For example, the system may hibernate because the lid is closed, battery is low, the machine is placed into a bag, or the user expects the OS to preserve state while consuming no power.
Because of that, a runtime message such as:
is only acceptable for systems where hibernation is not configured, not supported, or not intentionally enabled.
For a system where the administrator/user has explicitly configured hibernation, the expected contract should be stronger:
In that case, the system should either:
The important part is that this should be handled by the platform, not left as an undocumented local workaround.
Desired invariant
Fedora Atomic Desktops should guarantee the following invariant:
A more operational form:
Requested behavior
Please define one official behavior for Atomic Desktops.
Preferred behavior: same-deployment resume guarantee
When hibernation is requested and a pending deployment exists:
Possible implementation approaches could include:
I am not asking for a specific implementation. I am asking for a defined and tested platform contract.
Fallback behavior: fail safely before poweroff
If Fedora Atomic cannot guarantee same-deployment resume, hibernation should fail before the machine powers off.
This failure should be explicit and visible through systemd/logind/journal diagnostics.
However, I do not think this should be the normal long-term behavior for a system where hibernation has been intentionally configured. If hibernation is configured, the better production-grade solution is to preserve hibernate safety by controlling the pending deployment state.
Suggested implementation areas
This likely needs coordination between several components:
Useful technical hooks may include:
Suggested acceptance criteria
Case 1: no pending deployment
systemctl hibernateor triggers hibernate from the desktop.Expected result:
Case 2: pending deployment exists
Expected result:
Either:
or:
The system must not silently attempt to resume the hibernation image through deployment B.
Case 3: after successful resume
Expected result:
Case 4: rollback/layered packages/kmods
Please also consider systems with:
The safety contract should not silently break in these cases.
Case 5: Secure Boot / kernel lockdown
If hibernation is not possible because of Secure Boot/kernel lockdown or other platform limitations, the system should expose that clearly.
This is separate from the rpm-ostree deployment safety issue.
Related hibernation storage concern
There is also a broader Linux/Fedora usability issue around hibernation storage.
Today, hibernation normally uses swap. In many modern Fedora setups, swap is either zram or general-purpose swap, which is not ideal for hibernation.
From an operational point of view, the most robust setup would be a dedicated hibernation swap partition or hibernation file that is used specifically for suspend-to-disk.
On my own systems, I have worked around this by using a dedicated swap partition for hibernation purposes and enabling it only around hibernate, then disabling it again after resume. Conceptually:
swapondedicated hibernation swap;swapoffthat dedicated hibernation swap.This works as a local workaround, but it is not a clean platform-level solution.
It would be useful if Fedora documented or supported a cleaner model for dedicated hibernation storage, especially for systems that normally use zram.
However, this is secondary. The main request in this issue is the Atomic Desktop rpm-ostree deployment/resume safety contract.
Non-goals
This request is not asking Fedora to:
This affects Fedora Atomic Desktops generally: Silverblue, Kinoite, Sway Atomic, Budgie Atomic, COSMIC Atomic, and other rpm-ostree based desktop variants.
Why this matters
Hibernate is a valid and important power-management feature for many laptop users.
Atomic Desktops should be able to support opt-in hibernation safely by defining a clear contract between:
The current situation appears to be unspecified. That makes hibernation on Atomic Desktops feel like a workaround rather than a production-grade feature.
I think the right goal is not "enable hibernate everywhere by default", but:
It does not, it will always resume from deployment A. Deployments are only made "effective" on shutdown via
ostree-finalize-staged.service. So if anything happens (power cut, hibernation, etc.), the system will boot the current deployment again.I don't think there is anything to do here. This is already the default.