Proof Portal

Project overview

Omarchy

ProbeLabs65 findings · 95 requirements

A proof layer — requirements, tests and verified fixes — for two of Omarchy's subsystems: the application menu (launcher scripts, QML model, JSONC config, search and selection) and the lock screen (lock scripts, QML, PAM authentication). Scope is deliberately limited to those components of omacom/omarchy; the rest of the distribution is not covered.

Inbox
ReportR-649GitHub issuePublicDecided· Out of scope

omarchy-hibernation-setup never reconciles a stale resume_offset (guards at lines 63 and 131 make re-running it a silent no-op)

Reported by adevwithpurpose · filed Sep 12, 2026 · open at source

Decided: Out of scope — decided by agents · verified 3 days ago.

At a glance

1 · What is claimed?
Only the report text below — no validator has restated it as checkable claims yet.
2 · What does it affect?
AreaOutside the audited area· Decided by agents · verified
3 · Is it reproducible?
No validation has been run yet.
4 · What remains unclear?
  • Not validated yet: no claims, no reproducer.
5 · What happens next?
Decided by agents and verified by a second, independent agent — see the decision.

Original report

omarchy-hibernation-setup never reconciles a stale resume_offset (guards at lines 63 and 131 make re-running it a silent no-op)revision 1 · captured 2026-09-28 21:23 UTC via poll

System details

Omarchy 4.0.3-1; Linux 7.2.3-arch1-3; Hyprland 0.56.2-2; Dell G5 5590 (Intel UHD 630 + NVIDIA RTX 2060 Mobile, hybrid); LUKS-encrypted btrfs root with a dedicated /swap subvolume; Limine + limine-mkinitcpio-hook 1.38.0-1.1.

omarchy debug --no-sudo --print output is attached (/tmp/omarchy-debug.log), trimmed only to remove serial numbers. Note that its parameters line already shows the defect: resume=/dev/mapper/omarchy_root resume_offset=1905130.

What's wrong?

bin/omarchy-hibernation-setup only ever writes the resume drop-in. It never reconciles it. On any system where hibernation was configured once and the swapfile was later recreated at a different size, the drop-in keeps a stale resume_offset and omarchy hibernation setup reports success while doing nothing.

Two independent guards cause this, both in bin/omarchy-hibernation-setup:

1. Line 63 — early exit makes re-running the command a no-op.

if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
  # Fix empty resume_offset if btrfs map-swapfile failed during initial setup
  if [[ -f $RESUME_DROP_IN ]] && grep -q 'resume_offset="$' "$RESUME_DROP_IN" && [[ -f $SWAP_FILE ]]; then

The repair branch at line 65 only matches an empty resume_offset=. A stale-but-non-empty value never matches 'resume_offset="$', so nothing is corrected before the unconditional exit 0 at line 76.

2. Line 131 — the drop-in is written only if absent.

if [[ ! -f $RESUME_DROP_IN ]]; then
  ...
  RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE")

Because the file exists, map-swapfile is never consulted again.

Evidence from this machine

/swap/swapfile had been recreated after hibernation was first configured — filefrag -v showed 3 extents, whereas btrfs filesystem mkswapfile always produces a single extent, so the file had been resized by hand rather than created by the script.

$ sudo btrfs inspect-internal map-swapfile -r /swap/swapfile
19565702

$ grep resume_offset /etc/limine-entry-tool.d/resume.conf
KERNEL_CMDLINE[default]+=" resume=/dev/mapper/omarchy_root resume_offset=1905130"

The stored offset was 17x off, so the resume path could not find the swap header. Re-running sudo omarchy hibernation setup printed Hibernation is already set up and exited 0 — no warning, no repair. Hibernation never worked on this machine and there was no signal that it was misconfigured.

Two things that are not the cause, checked so they can be ruled out: the initramfs already carried hooks/resume, usr/bin/resume and usr/lib/systemd/systemd-hibernate-resume, and swap inside the LUKS container is fine because the initramfs unlocks it at boot.

Steps to reproduce

  1. sudo omarchy hibernation setup on a system where it succeeds, so /etc/limine-entry-tool.d/resume.conf and /etc/mkinitcpio.conf.d/omarchy_resume.conf both exist.
  2. Change the swapfile: sudo swapoff /swap/swapfile && sudo rm /swap/swapfile && sudo btrfs filesystem mkswapfile -s 32g /swap/swapfile && sudo swapon -p 0 /swap/swapfile.
  3. sudo omarchy hibernation setup again.
  4. Observe: Hibernation is already set up, exit 0. /etc/limine-entry-tool.d/resume.conf is unchanged, and map-swapfile -r no longer matches it.

systemctl hibernate then fails to resume, silently cold-booting instead.

Suggested fix

Make the drop-in self-reconciling instead of write-once: when HOOKS+=(resume) is present, recompute map-swapfile -r and rewrite resume.conf if the stored value differs, rebuilding only when it actually changes. That also subsumes the existing empty-offset special case at line 65. A related size check would help too — a swapfile smaller than /sys/power/image_size can never hold the image, and this machine had 4 GiB against a 26.7 GB target.

Also worth noting for anyone hitting this: the workaround is to stage /etc/mkinitcpio.conf.d/omarchy_resume.conf aside and delete /etc/limine-entry-tool.d/resume.conf so the guards stop short-circuiting, then run sudo env OMARCHY_PATH=/usr/share/omarchy omarchy hibernation setup --force. Two incidental obstacles there: without an exported OMARCHY_PATH the script fails with install: cannot stat '/default/systemd/system-sleep/keyboard-backlight', and --force is required non-interactively because the gum confirm prompts fail with could not open TTY.

View raw text
### System details

Omarchy 4.0.3-1; Linux 7.2.3-arch1-3; Hyprland 0.56.2-2; Dell G5 5590 (Intel UHD 630 + NVIDIA RTX 2060 Mobile, hybrid); LUKS-encrypted btrfs root with a dedicated `/swap` subvolume; Limine + `limine-mkinitcpio-hook` 1.38.0-1.1.

`omarchy debug --no-sudo --print` output is attached (`/tmp/omarchy-debug.log`), trimmed only to remove serial numbers. Note that its `parameters` line already shows the defect: `resume=/dev/mapper/omarchy_root resume_offset=1905130`.

### What's wrong?

`bin/omarchy-hibernation-setup` only ever *writes* the resume drop-in. It never *reconciles* it. On any system where hibernation was configured once and the swapfile was later recreated at a different size, the drop-in keeps a stale `resume_offset` and `omarchy hibernation setup` reports success while doing nothing.

Two independent guards cause this, both in `bin/omarchy-hibernation-setup`:

**1. Line 63 — early exit makes re-running the command a no-op.**

```bash
if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
  # Fix empty resume_offset if btrfs map-swapfile failed during initial setup
  if [[ -f $RESUME_DROP_IN ]] && grep -q 'resume_offset="$' "$RESUME_DROP_IN" && [[ -f $SWAP_FILE ]]; then
```

The repair branch at line 65 only matches an **empty** `resume_offset=`. A stale-but-non-empty value never matches `'resume_offset="$'`, so nothing is corrected before the unconditional `exit 0` at line 76.

**2. Line 131 — the drop-in is written only if absent.**

```bash
if [[ ! -f $RESUME_DROP_IN ]]; then
  ...
  RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE")
```

Because the file exists, `map-swapfile` is never consulted again.

### Evidence from this machine

`/swap/swapfile` had been recreated after hibernation was first configured — `filefrag -v` showed **3 extents**, whereas `btrfs filesystem mkswapfile` always produces a single extent, so the file had been resized by hand rather than created by the script.

```console
$ sudo btrfs inspect-internal map-swapfile -r /swap/swapfile
19565702

$ grep resume_offset /etc/limine-entry-tool.d/resume.conf
KERNEL_CMDLINE[default]+=" resume=/dev/mapper/omarchy_root resume_offset=1905130"
```

The stored offset was **17x off**, so the resume path could not find the swap header. Re-running `sudo omarchy hibernation setup` printed `Hibernation is already set up` and exited 0 — no warning, no repair. Hibernation never worked on this machine and there was no signal that it was misconfigured.

Two things that are **not** the cause, checked so they can be ruled out: the initramfs already carried `hooks/resume`, `usr/bin/resume` and `usr/lib/systemd/systemd-hibernate-resume`, and swap inside the LUKS container is fine because the initramfs unlocks it at boot.

### Steps to reproduce

1. `sudo omarchy hibernation setup` on a system where it succeeds, so `/etc/limine-entry-tool.d/resume.conf` and `/etc/mkinitcpio.conf.d/omarchy_resume.conf` both exist.
2. Change the swapfile: `sudo swapoff /swap/swapfile && sudo rm /swap/swapfile && sudo btrfs filesystem mkswapfile -s 32g /swap/swapfile && sudo swapon -p 0 /swap/swapfile`.
3. `sudo omarchy hibernation setup` again.
4. Observe: `Hibernation is already set up`, exit 0. `/etc/limine-entry-tool.d/resume.conf` is unchanged, and `map-swapfile -r` no longer matches it.

`systemctl hibernate` then fails to resume, silently cold-booting instead.

### Suggested fix

Make the drop-in self-reconciling instead of write-once: when `HOOKS+=(resume)` is present, recompute `map-swapfile -r` and rewrite `resume.conf` if the stored value differs, rebuilding only when it actually changes. That also subsumes the existing empty-offset special case at line 65. A related size check would help too — a swapfile smaller than `/sys/power/image_size` can never hold the image, and this machine had 4 GiB against a 26.7 GB target.

Also worth noting for anyone hitting this: the workaround is to stage `/etc/mkinitcpio.conf.d/omarchy_resume.conf` aside and delete `/etc/limine-entry-tool.d/resume.conf` so the guards stop short-circuiting, then run `sudo env OMARCHY_PATH=/usr/share/omarchy omarchy hibernation setup --force`. Two incidental obstacles there: without an exported `OMARCHY_PATH` the script fails with `install: cannot stat '/default/systemd/system-sleep/keyboard-backlight'`, and `--force` is required non-interactively because the `gum confirm` prompts fail with `could not open TTY`.

Validation

Not checked yet. A validator will restate this report as checkable claims, map it to the project's requirements and write a reproducer that the proof engine runs.

Linked

Not linked to any known issue, other report or change yet.

Decision

Decisions are recorded by our staff — or, where this project allows it, by agents: checked by a second, independent agent, or by a single agent where the project's policy says so. Any decision reached so far is shown below.

  • Out of scopeDecided by agents · verified · 2026-10-09 12:07 UTC