Repository navigation
Conversation
initial_setup disabled itself as soon as startx returned, which happens whether or not setup completed. A crashed X or a machine powered off partway through left the service disabled with nothing configured. The decision moves into setup-station, which only reaches it after the other steps have run. remove_ghostbsd_autologin goes with it. It looked for the ghostbsd user in gettytab and ttys, but the installer had already rewritten both to root by the time it ran, so neither sed matched and installed systems kept a root autologin on ttyv0. The mate image now autologins through lightdm, so there is nothing left for it to undo. disable_initial_setup clears both locations, since the installer writes /etc/rc.conf.d/initial_setup while older installs set the variable in /etc/rc.conf. The step 5 label changes with the behaviour, so its msgid needs re-extracting.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR prevents incomplete installations from disabling first-boot setup by moving that decision to setup-station’s final step, where it clears both current and legacy enablement locations; it also removes obsolete GhostBSD autologin cleanup and updates the step messaging. Sequence diagram for final first-boot setup disablementsequenceDiagram
participant SetupStation
participant InstallerSteps
participant SystemCalls
participant Filesystem
participant Sysrc
SetupStation->>InstallerSteps: run installation steps
InstallerSteps-->>SetupStation: steps complete
SetupStation->>SystemCalls: disable_initial_setup()
SystemCalls->>Filesystem: remove /etc/rc.conf.d/initial_setup
SystemCalls->>Sysrc: sysrc -qx initial_setup_enable
Sysrc-->>SystemCalls: clear legacy rc.conf setting
SystemCalls-->>SetupStation: first-boot setup disabled
Flow diagram for deferred first-boot setup disablementflowchart TD
A[Machine boots] --> B[initial_setup runs]
B --> C[setup-station runs installation steps]
C --> D[disable_initial_setup]
D --> E[Clear current and legacy enablement]
E --> F[Setup complete]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="setup_station/setup_system.py" line_range="72-73" />
<code_context>
- GLib.idle_add(update_progress, progress_bar, 5/6, get_text("Removing system setup autologin"))
- remove_ghostbsd_autologin()
+ # Step 5/6: Disabling first boot setup
+ GLib.idle_add(update_progress, progress_bar, 5/6, get_text("Disabling first boot setup"))
+ disable_initial_setup()
sleep(1)
</code_context>
<issue_to_address>
**issue:** The new progress label is not present in the checked-in POT or translation catalogs, which still contain only "Removing system setup autologin". Non-English installations therefore fall back to the English string "Disabling first boot setup" instead of receiving an extracted/translated message.
**Triggers:** When setup-station runs with a non-English locale.
**Suggested fix:** Re-run the translation extraction/update command and include the new msgid in the POT and PO files.
</issue_to_address>
### Comment 2
<location path="setup_station/system_calls.py" line_range="523" />
<code_context>
- run(['sed', '-i', '', '/ttyv0/s/ghostbsd/Pc/g', '/etc/ttys'], check=True)
+ # The variable is absent from rc.conf on current installs, and sysrc
+ # exits non-zero in that case, so this is deliberately unchecked.
+ run(['sysrc', '-qx', 'initial_setup_enable'])
except Exception as e:
- raise RuntimeError(f"Failed to remove ghostbsd autologin configuration: {e}") from e
</code_context>
<issue_to_address>
**issue (bug_risk):** The return status of `sysrc -qx initial_setup_enable` is ignored, so a permission, filesystem, or other sysrc failure is treated as success and the old `/etc/rc.conf` setting remains enabled. `disable_initial_setup` then returns without raising even though the service will run again on the next boot.
**Triggers:** When sysrc exits nonzero for a reason other than the intentionally absent variable.
**Suggested fix:** Distinguish the expected 'variable absent' status from operational failures and raise on the latter, or verify the variable was removed after the command.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and the change persistently disables the initial-setup service by deleting its configuration, and reverting the code will not restore that configuration on systems already processed. It also replaces the prior cleanup of GhostBSD autologin entries, so those entries may remain and permit automatic login; correcting either outcome requires manual system repair rather than a normal code revert.
Blocking findings: setup_station/setup_system.py:73, setup_station/system_calls.py:523
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- Updated translation files with new `POT-Creation-Date`. - Adjusted references in `setup_system.py` for better consistency. - Changed "Removing system setup autologin" to "Disabling first boot setup" for clarity. - Added support to configure hardware clock mode, allowing users to choose between UTC or local time. Enhanced system timezone handling by symlinking `/etc/localtime` instead of copying zoneinfo files.
initial_setup disabled itself as soon as startx returned, which happens whether or not setup completed. A crashed X or a machine powered off partway through left the service disabled with nothing configured. The decision moves into setup-station, which only reaches it after the other steps have run.
remove_ghostbsd_autologin goes with it. It looked for the ghostbsd user in gettytab and ttys, but the installer had already rewritten both to root by the time it ran, so neither sed matched and installed systems kept a root autologin on ttyv0. The mate image now autologins through lightdm, so there is nothing left for it to undo.
disable_initial_setup clears both locations, since the installer writes /etc/rc.conf.d/initial_setup while older installs set the variable in /etc/rc.conf.
The step 5 label changes with the behaviour, so its msgid needs re-extracting.
Summary by Sourcery
Disable the first-boot setup service only after setup-station completes its configuration steps.
Bug Fixes:
Enhancements:
Chores: