Skip to content

Wait for boot splash readiness before switch_root - #20555

Merged
dhh merged 2 commits into
quattrofrom
fix/boot-splash-switch-root-race
Nov 28, 2026
Merged

dhh merged 2 commits into
quattrofrom
fix/boot-splash-switch-root-race

Conversation

@dhh

@dhh dhh commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the omarchy-splash-hold.service boot failure (the splash has no display open) seen on fast unencrypted aarch64 boots (blocking omacom/omarchy-iso#599).

Root cause

Reproduced in an aarch64 KVM VM booting UEFI (AAVMF) + virtio-gpu-pci + systemd:

  1. On an unencrypted boot, encrypt does not call plymouth ask-for-password (which waits for /run/omarchy-splash/ready), so init reaches run_latehook() and executes switch_root while sway is still ~100 ms into startup.
  2. switch_root deletes the initramfs rootfs and moves /dev and /sys away mid-initialization:
    • xkbcommon fails to find /usr/share/xkeyboard-config-2
    • wlroots fails drm_dumb allocation (Cannot use DRM dumb buffers with non-primary DRM FD) and disables Virtual-1
    • sway fails to exec /usr/lib/omarchy-splash/ui-launch and open /dev/urandom, then disconnects and exits
  3. Because session.pid was still alive when run_latehook() checked it, omarchy-splash-hold.service was enabled anyway; ~1.5 s later in real root, hold found no open DRM display on sway and exited 1.

Changes

  • default/splash/session:
    • Touch /run/omarchy-splash/starting once a display has been picked (past wait_native 80), and remove /run/omarchy-splash/ready immediately when sway exits (avoiding a stale ready marker during exit or firmware-to-native restart).
  • etc/initcpio/hooks/omarchy-splash (run_latehook):
    • Before switch_root, if the splash has already picked a display ($run/starting) but is not yet ready ($run/ready), wait up to 5 s (in 0.1 s steps, typically ~0.1–0.3 s) for $run/ready while session is alive.
    • If the splash is still waiting in wait_native (no early KMS) or exited before becoming ready, tear it down via stop and return without scheduling omarchy-splash-stop.service / omarchy-splash-hold.service (avoiding stalling unencrypted no-early-KMS boots for 8 s).
  • default/splash/hold:
    • If the splash has no display open by the time hold runs (e.g. Escape pressed after switch_root, or simpledrm unbound by the native GPU driver in the real root), log whether session is still running to stderr, notify systemd-notify --ready, skip creating $adopt, and exit 0 instead of degrading the boot.
  • Tests:
    • Added run_latehook coverage in test/shell.d/boot-splash-session-test.sh (waits for starting -> ready, stops immediately if still waiting for a GPU, stops cleanly if session dies before ready).
    • Added empty-display hold coverage in test/shell.d/boot-splash-hold-test.sh.

Verification

  • All test/shell.d/boot-splash-*-test.sh shell tests pass.
  • Reproduced before and after in an aarch64 KVM VM (AAVMF, acpi=on, virtio-gpu-pci, switch_root -> systemd):
    • Before: sway crashed at 0.179 s during switch_root; omarchy-splash-hold.service failed with the splash has no display open.
    • After: 0 failed units; sway + quickshell reached direct scan-out at 0.300 s, omarchy-splash-hold.service held /dev/dri/card0 and created /run/omarchy-splash-hold/adopt, and omarchy-splash-stop.service shut the splash down cleanly (status=0/SUCCESS).

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR waits for the boot splash to finish starting before switch_root and lets hold exit successfully when no display remains.

  • The boot splash reaches switch_root only after it is ready or stopped.
  • The hold service succeeds when the splash has no display open.

Reviews (3) · Last reviewed commit: "Stop wait_native promptly on stopping an..." · Reviewed by Greptile

Comment thread etc/initcpio/hooks/omarchy-splash Resolved
Comment thread test/shell.d/boot-splash-hold-test.sh Resolved
@dhh
dhh merged commit 05fc23b into quattro Nov 28, 2026
5 checks passed
@dhh
dhh deleted the fix/boot-splash-switch-root-race branch November 28, 2026 11:32
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 28, 2026
* Wait for boot splash readiness before switch_root and avoid failing hold when gone

* Stop wait_native promptly on stopping and run hold test against fixture paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant