Repository navigation
Conversation
firstboot asked its questions with a plain read, so a board booted without a keyboard or with only a serial console sat at the package mirror prompt forever and never reached sshd or login. Skip the questions when stdin is not a terminal. At boot (rc_quiet set by faststart/quietstart) also skip when every active console in kern.console is a serial one; a video console (ttyv*) keeps the prompts. Running "service firstboot start" by hand is unaffected, so the questions can still be answered later over ssh or serial. Each answer is now read with a timeout, firstboot_timeout (default 300 seconds). If it expires, or input ends, firstboot stops without writing /etc/fbreceipt, so it runs again on the next boot. AI-Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Holt <[email protected]>
Reviewer's GuideImplementationReview firstboot’s boot-time console checks, prompt timeouts and receipt handling together with its sshd ordering requirement, since these changes determine whether setup blocks boot and when it can be answered.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
firstboot ran between DAEMON and LOGIN, before sshd, so while its questions waited at the console (up to firstboot_timeout per answer) nobody could log in over the network. Board images enable sshd and DHCP, so a headless board was unreachable for that time. Require sshd so that it is already running when firstboot asks its questions; the questions can then also be answered by logging in and running "service firstboot start". firstboot still finishes before init starts the console getty. sshd does nothing when not enabled. AI-Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Holt <[email protected]>
|
Claude finished @laffer1's task in 30s —— View job Review of PR #645 (
|
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.
Problem
rc.d/firstbootasks its questions with a plainread. On a headless board, or one with no keyboard, boot stops at the package-mirror prompt and never reaches sshd or login. The aarch64 RPI snapshot image did exactly this in QEMU.Change
[ -t 0 ]).kern.consoleis serial. A video console (ttyv*) keeps the prompts. This check applies only whenrc_quietis set (faststart/quietstart), so runningservice firstboot startby hand over ssh or serial still asks the questions.read -t ${firstboot_timeout}, default 300 s, which can be set in rc.conf. On a timeout or end of input, firstboot prints a warning and stops without writing/etc/fbreceipt, so it runs again on the next boot.sshd, so sshd is already running while the questions wait at the console. Someone can ssh in (board images enable sshd and DHCP) and runservice firstboot start. firstboot still finishes before init starts the console getty. When sshd isn't enabled, it does nothing.rcorderorder:LOGIN … sshd … cron sendmail jail firstboot bgfsck securelevel.Testing
sh -npasses.kern.console:uartorttyu0only → skip;login:on ttyu0. Before this change the same image waited forever.Starting sshd.andStarting cron.before the FirstBoot prompt. QEMU raspi3b has no network device here, so I didn't test an actual ssh login.🤖 Generated with Claude Code
Summary by Sourcery
Make firstboot safe for unattended boots while preserving interactive configuration when a usable console or remote session is available.
New Features:
Bug Fixes: