Skip to content

Stop boots from freezing after a correct disk password - #20909

Merged
emirb merged 1 commit into
quattrofrom
fix/splash-lost-answer
Nov 30, 2026
Merged

emirb merged 1 commit into
quattrofrom
fix/splash-lost-answer

Conversation

@emirb

@emirb emirb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

What changes

A boot can freeze after a correct disk password. The splash stays up with the bar at 65%, and nothing but a power cycle gets out. CI hit it three times on 30 November, on x86_64 and aarch64 (for example run 46405938465). It comes with the new boot splash (#20404), which 4.6.0-rc1 does not have.

plymouth ask-for-password reads the unlock's answer from a pipe with a one-second limit. The initramfs's busybox 1.36.1 drops what it has read when that limit runs out. An answer that arrives at that moment loses its request number. The rest matches no request, so the boot waits forever.

answer now puts one byte in front of the answer. ask-for-password reads only that byte with the limit, then reads the rest without one. A single byte cannot be cut short. Writing the answer to a file was ruled out: it needed more code, and the writer could then block on the pipe.

Verification

The real scripts ran under that busybox, with answers 0.97 to 1.00 s into the wait. Before, 120 of 2,400 answers were lost. Now none of 2,400 are. With a 0.4 s unlock, none of 400 were lost either way. An unlock returns in 2.4 ms, against 2.6 ms.

In a VM with encrypted 4.6.0rc2, 6 of 6 boots with the change came up: two normal, two after a wrong password, and two with Escape first.

One VM boot without the change froze with a logger in its initramfs. cryptsetup had ended, and ask-for-password still waited for its answer.

test/shell.d/boot-splash-answer-test.sh is new. It fails without the change and passes with it.

Not verified: real hardware, and that all three CI freezes have this cause. Those runs have no log from the initramfs.

Screenshots

The frozen boot in CI. Every capture from 78 s to 189 s is the same:

The splash frozen with its bar at 65%

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues remain.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Prevents the disk-unlock answer from being cut short by a timed read.

  • Boot unlock replies no longer get lost at the read timeout.

No new actionable issues found. This review checked source code; it did not run tests.

Diagram

sequenceDiagram
  participant A as answer
  participant F as Result pipe
  participant P as plymouth
  A->>F: Write dot, request ID, and exit status
  P->>F: Read one byte with timeout
  F-->>P: Dot
  P->>F: Read remaining line without timeout
  F-->>P: Request ID and exit status
  P->>P: Match request ID and return status
Loading

Reviews (2) · Last reviewed commit: "Stop boots from freezing after a correct..." · Reviewed by Greptile

Comment thread test/shell.d/boot-splash-answer-test.sh Resolved
Comment thread test/shell.d/boot-splash-answer-test.sh Resolved
`plymouth ask-for-password` reads the unlock's answer from a pipe with a
one-second limit. The initramfs's busybox 1.36.1 drops what it has read
when that limit runs out, so an answer that arrives at that moment loses
its request number. The rest of it matches no request, and the boot waits
forever with the bar at 65%.

Put one byte in front of the answer and time only that byte, then read
the rest without a limit. A single byte cannot be cut short.

With the real scripts under that busybox, and answers 0.97 to 1.00 s into
the wait, 120 of 2,400 were lost before and none of 2,400 now. An unlock
returns in 2.4 ms, against 2.6 ms.
@emirb
emirb force-pushed the fix/splash-lost-answer branch from 651ab11 to 67c0c9b Compare November 30, 2026 12:38
@emirb
emirb merged commit a515d8b into quattro Nov 30, 2026
5 checks passed
@emirb
emirb deleted the fix/splash-lost-answer branch November 30, 2026 13:03
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 30, 2026
`plymouth ask-for-password` reads the unlock's answer from a pipe with a
one-second limit. The initramfs's busybox 1.36.1 drops what it has read
when that limit runs out, so an answer that arrives at that moment loses
its request number. The rest of it matches no request, and the boot waits
forever with the bar at 65%.

Put one byte in front of the answer and time only that byte, then read
the rest without a limit. A single byte cannot be cut short.

With the real scripts under that busybox, and answers 0.97 to 1.00 s into
the wait, 120 of 2,400 were lost before and none of 2,400 now. An unlock
returns in 2.4 ms, against 2.6 ms.
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