Repository navigation
Install filesystem tools and enable fusefs at first boot - #18
Conversation
The exFAT and FUSE filesystem packages are moving off the ISO to keep it lighter (ghostbsd/issues#316). Setup now installs them with pkg, showing its output on the progress bar like software-station, and loads fusefs now and at every boot. A failed package does not stop the setup. Leaving the network page without a connection warns that these packages will not be installed.
Reviewer's GuideData structuresDefine the filesystem package set that first-boot setup will install.
APIAdd helpers to enable FUSE persistently and start package installation while exposing its output.
Expose a default-route connectivity check for setup to use before proceeding offline.
Uses of the APIIntegrate FUSE enablement and per-package installation into first-boot setup, continuing after individual failures.
UIWarn users that filesystem packages will not be installed when continuing without a network connection.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Linked issuesChecked at commit cda962f #316 Move exFAT/FUSE filesystem tools from ISO to setup-station-init · 1 of 2 met
|
There was a problem hiding this comment.
Hey - I've found 8 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="88" />
<code_context>
+ for package in filesystem_packages:
+ msg = f"{get_text('Installing')} {package}"
+ GLib.idle_add(update_progress, progress_bar, fraction, msg)
+ pkg = install_package(package)
+ for line in pkg.stdout:
+ GLib.idle_add(update_progress, progress_bar, fraction, line.rstrip())
</code_context>
<issue_to_address>
**Setup remains incomplete**
When starting a `pkg install` process raises an exception, `install_package()` lets the exception escape `setup_system()`, so the setup worker exits before `disable_initial_setup()` and the setup UI never completes.
Catch process-start exceptions in the package loop and handle them so first-boot setup can finish.
Also at `setup_station/system_calls.py:528`.
</issue_to_address>
### Comment 2
<location path="setup_station/setup_system.py" line_range="91-95" />
<code_context>
+ pkg = install_package(package)
+ for line in pkg.stdout:
+ GLib.idle_add(update_progress, progress_bar, fraction, line.rstrip())
+ if pkg.wait() != 0:
+ print(f"Failed to install {package}")
+ fraction += increment
+
+ # Step 7/8: Disabling first boot setup
+ GLib.idle_add(update_progress, progress_bar, 7/8, get_text("Disabling first boot setup"))
disable_initial_setup()
</code_context>
<issue_to_address>
**Failed tools are never installed**
When a package installation fails during first-boot setup, `setup_system()` logs a nonzero package exit and still calls `disable_initial_setup()`, so the failed filesystem tool is not installed and setup does not retry it.
Keep setup from completing until failed package installations have been retried or otherwise handled.
Also at `setup_station/interface_controller.py:206`.
</issue_to_address>
### Comment 3
<location path="setup_station/setup_system.py" line_range="78-79" />
<code_context>
+ GLib.idle_add(update_progress, progress_bar, 5/8, get_text("Enabling FUSE file systems"))
+ try:
+ enable_fusefs()
+ except RuntimeError as e:
+ print(e)
+ sleep(1)
+
</code_context>
<issue_to_address>
**Setup reports success without FUSE**
When persisting or loading the FUSE module fails, `setup_system()` catches the `enable_fusefs()` error and continues installing filesystem tools, then reports setup complete even though FUSE is unavailable.
Do not report setup completion or install FUSE-dependent tools as successful when enabling FUSE fails.
Also at `setup_station/system_calls.py:511-512`.
</issue_to_address>
### Comment 4
<location path="setup_station/network_setup.py" line_range="188" />
<code_context>
+ def is_connected(cls) -> bool:
+ """Return True when a wired or WiFi card is connected."""
+ cards = network_dictionary()['cards']
+ return any(card['state']['connection'] == 'Connected' for card in cards.values())
+
@classmethod
</code_context>
<issue_to_address>
**Local links bypass warning**
When a card is connected locally but cannot reach the internet or package repositories, `is_connected()` treats the card’s `Connected` state as network access, so the Next-button handler skips the warning and package installation later fails without advance notice that the filesystem tools were not installed.
Check for usable internet or repository access before treating the network as available.
Also at `setup_station/interface_controller.py:206`.
</issue_to_address>
### Comment 5
<location path="setup_station/setup_system.py" line_range="89" />
<code_context>
+ msg = f"{get_text('Installing')} {package}"
+ GLib.idle_add(update_progress, progress_bar, fraction, msg)
+ pkg = install_package(package)
+ for line in pkg.stdout:
+ GLib.idle_add(update_progress, progress_bar, fraction, line.rstrip())
+ if pkg.wait() != 0:
</code_context>
<issue_to_address>
**Package fetch can stall setup**
When a package repository or network connection stalls while `pkg install` is running, `pkg.stdout` iteration waits for each package process to close stdout, with no timeout or cancellation; a stalled repository or network leaves first-boot setup waiting indefinitely before `disable_initial_setup()` and the login screen are reached.
Add a bounded timeout or cancellation path that terminates the package process and lets setup continue to cleanup.
</issue_to_address>
### Comment 6
<location path="setup_station/network_setup.py" line_range="187-188" />
<code_context>
+ @classmethod
+ def is_connected(cls) -> bool:
+ """Return True when a wired or WiFi card is connected."""
+ cards = network_dictionary()['cards']
+ return any(card['state']['connection'] == 'Connected' for card in cards.values())
+
@classmethod
</code_context>
<issue_to_address>
**Network query blocks offline continuation**
When the network-manager query fails after the network page has loaded, `network_dictionary()` exceptions propagate from `is_connected()` through the Next-button handler, so a transient network-manager failure prevents navigation and the offline confirmation never appears.
Handle query failures as an unknown or disconnected state and let the user continue through the offline confirmation.
</issue_to_address>
### Comment 7
<location path="setup_station/interface_controller.py" line_range="152-156" />
<code_context>
+ modal=True,
+ message_type=Gtk.MessageType.WARNING,
+ buttons=Gtk.ButtonsType.NONE,
+ text=get_text("No network connection")
+ )
+ dialog.format_secondary_text(
+ get_text("Without a network connection, the file system tools "
+ "for exFAT, NTFS, ext2/3/4 and HFS+ will not be installed.")
+ )
+ dialog.add_button(get_text('Back'), Gtk.ResponseType.CANCEL)
</code_context>
<issue_to_address>
**New setup messages stay English**
When a non-English locale is active, `get_text` calls `gettext.gettext` for these new warning and progress messages, but their msgids are absent from the translation catalogs, so users with a non-English locale see them in English.
Add the new msgids to the translation template and update the locale catalogs.
Also at `setup_station/setup_system.py:75`, `setup_station/setup_system.py:86`.
</issue_to_address>
### Comment 8
<location path="setup_station/system_calls.py" line_range="511" />
<code_context>
+ RuntimeError: If the module cannot be enabled
+ """
+ try:
+ run(['sysrc', 'kld_list+=fusefs'], check=True)
+ run(['kldload', '-n', 'fusefs'], check=True)
+ except Exception as e:
</code_context>
<issue_to_address>
**FUSE is not enabled after reboot**
When `kld_list` already contains one or more modules, `sysrc` appends `fusefs` directly to the existing `kld_list` value, so a nonempty list such as `zfs` becomes `zf sfusefs` without a separator (for example, `zfsfusefs`). The current `kldload` still succeeds, but the malformed entry prevents FUSE from loading at a later boot.
Append a leading space with `kld_list+=" fusefs"` or update the list while preserving its separators.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 7 findings to address first, and first boot installs filesystem packages and persists fusefs in the system’s boot configuration; if that is wrong, reverting the installer will not remove the packages or setting. These changes are bounded and can be repaired by uninstalling the packages and removing the boot entry.
Blocking findings: setup_station/setup_system.py:88, setup_station/setup_system.py:95, setup_station/setup_system.py:79, setup_station/network_setup.py:188, setup_station/setup_system.py:89, and 2 more
A card holding an address does not mean the system can reach the package repository. Use the default route instead, the same test software-station uses, so the offline warning shows when it should.
The exFAT and FUSE filesystem packages are moving off the ISO to keep it lighter (ghostbsd/issues#316). Setup now installs them with pkg, showing its output on the progress bar like software-station, and loads fusefs now and at every boot. A failed package does not stop the setup.
Leaving the network page without a connection warns that these packages will not be installed.
Close: ghostbsd/issues#316
Summary by Sourcery
Install filesystem tools during first-boot setup and enable persistent FUSE support, with network awareness and resilient installation handling.
New Features:
Enhancements: