fix(rpi): stop the kiosk login loop by pinning the vc4 display device - #6
Merged
Merged
Conversation
On a Pi, dtoverlay=vc4-kms-v3d registers two DRM devices: vc4, which owns the HDMI connectors, and v3d, a render-only core with no outputs. Their /dev/dri/card* numbering is not stable, and when v3d lands on card0 Xorg's modesetting driver binds to it, finds no screens and exits immediately. The console is unaffected - fbcon is bound to vc4 - so the machine boots, prints the banner, and then loops: startx was exec'd from .bash_profile, so a failed session ended the login shell, agetty logged the user straight back in, and the only explanation went to a log file inside a session that never lasted long enough to read it. - Add the vc4 OutputClass/PrimaryGPU rule to the Pi overlay, matching on the kernel driver name rather than a card number. Raspberry Pi OS ships the same rule; Arch Linux ARM does not. - Run startx as a child of the login shell instead of exec'ing it. A session that lived logs out as before; three failures inside a few seconds stop the retries and leave a shell on tty1 with the tail of the session and kiosk logs on screen. - Fall back to software rendering when the editor exits immediately three times, and detect a usable DRM node instead of just /dev/dri existing. - Assert the vc4 rule made it into the image at build time, and document the console fallback. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mej775L1dYS9Hk6JtvcHCJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a Pi, dtoverlay=vc4-kms-v3d registers two DRM devices: vc4, which owns
the HDMI connectors, and v3d, a render-only core with no outputs. Their
/dev/dri/card* numbering is not stable, and when v3d lands on card0 Xorg's
modesetting driver binds to it, finds no screens and exits immediately.
The console is unaffected - fbcon is bound to vc4 - so the machine boots,
prints the banner, and then loops: startx was exec'd from .bash_profile, so
a failed session ended the login shell, agetty logged the user straight back
in, and the only explanation went to a log file inside a session that never
lasted long enough to read it.
kernel driver name rather than a card number. Raspberry Pi OS ships the
same rule; Arch Linux ARM does not.
that lived logs out as before; three failures inside a few seconds stop the
retries and leave a shell on tty1 with the tail of the session and kiosk
logs on screen.
times, and detect a usable DRM node instead of just /dev/dri existing.
console fallback.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01Mej775L1dYS9Hk6JtvcHCJ