- Expédié
- 23 septembre 2026 à 19:26 UTC
- Auteur
- Kamo
- Commite
- f29e9f5
resume_configured() checked that `resume=` and `resume_offset=` were present on the running kernel's command line. Present, not correct — and the difference is a member's session. resume_offset is a physical block address. _ensure_swap rebuilds the swap file whenever the size it wants changes, and the sizing fix in the previous commit makes exactly that happen on every computer already running. The rebuilt file lands somewhere else, _ensure_resume writes the new offset into grub.d, and the RUNNING kernel goes on carrying the old one. Hibernating then writes the image at the new location and, at boot, the kernel looks for it at the old one, finds nothing, and comes up clean. The machine loses the desktop and reports success. That is the failure this whole class was written to prevent, and its own readiness check could not see it. So the check now compares the cmdline against the CURRENT target, as whole tokens — resume_offset=2193408 is not satisfied by resume_offset=21934080. A mismatch makes readiness false, which makes the watcher restart the machine once for the new wiring, which is the correct and already-tested repair. If the target cannot be worked out at all, this reports false rather than true. A computer that will not sleep is visible, complained about, and recoverable. A lost session is none of those. /proc/cmdline is now an attribute, like GRUB_CFG, because the test that claimed to cover this was stubbing resume_configured with its own copy of the logic and therefore testing nothing. Rewritten against the real function, plus the stale-offset and whole-token cases. 51 tests.
