Repository navigation
Hibernation
Note
No machine running this OS hibernates. Closing a laptop's lid suspends it, and it stays suspended until it is opened or its battery runs out; a battery that reaches critical while the machine is awake powers it off. The command palette's Hibernate command does not show, because logind reports that the machine cannot hibernate.
The kernel is locked down, and a locked-down kernel refuses to hibernate in any mode. A hibernation image is the whole of kernel memory written to disk and read back on the next boot. Lockdown exists to keep root from changing the running kernel, and an image root could edit before a resume would undo that. Nothing in mainline Linux authenticates the image well enough for lockdown to allow it.
The image used to hibernate laptops that booted through UEFI and had a TPM.
Every boot formatted the swap partition as LUKS2 with a new key, sealed the
key to the TPM's PCRs 4, 7 and 12, and forgot it. Closing the lid on battery
suspended the laptop and hibernated it after three hours, and the initrd
resumed by unsealing the key. The project had to pick that or lockdown, and
picked lockdown, so hibernate.nix, its VM test and the TPM-sealed swap are
gone. Swap is encrypted with a random per-boot key on every machine, as
Where the OS lives describes.
It needs a kernel that authenticates the image, for example by encrypting and signing it with a key sealed to the TPM, so that lockdown could allow a resume. Patches for that have been proposed to the kernel, but none has been merged.
Generated from docs/ in the repository at every change; edit the pages there, since an edit made here is overwritten.
- LosOS Desktop
- Building
- When something goes wrong
- Reporting a problem
-
The system
- Everything systemd, and the exceptions
- Virtual machine desktop
- Peripherals in machines of their own
- The network machine
- The files machine
- The portal machine
- Where the OS lives
- Hibernation
- Hardware and NVIDIA
- Boot loader and boot screen
- Secure Boot
- The installer
- The Windows installer
- Trying it in quickemu
- First-boot setup
- Signing in
- Security keys and smart cards
- More than one person
- Company accounts
- Releases and GHCR
- The memory allocator
- The security report
- Kernel hardening
- Schizo mode
- VPN
-
Desktop and apps
- GTK and Qt on a phone
- One icon theme
- Danube
- System-wide ad blocking
- The terminal
- Ask derisk
- The Store
- The Agent
- Active users and the choice screens
- LosOS boxes
- Windows app support
- The gaming machine
- Focus mode
- Android app support
- macOS app support
- arm64 macOS machines
- App windows
- Backups to a LosOS box
- Screenshots
- Building blocks
- Phones
- History and gaps