Skip to content

Install filesystem tools and enable fusefs at first boot - #18

Merged
ericbsd merged 2 commits into
masterfrom
first-boot-fs-packages
Nov 10, 2026
Merged

ericbsd merged 2 commits into
masterfrom
first-boot-fs-packages

Conversation

@ericbsd

@ericbsd ericbsd commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Install exFAT, NTFS, ext2/3/4, and HFS+ filesystem tools during first-boot setup.
  • Enable FUSE filesystem support immediately and persist it across reboots.
  • Warn users without a network connection that filesystem tools will not be installed, while allowing setup to continue.

Enhancements:

  • Display package installation output and progress during setup without aborting setup when an individual package fails.

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.
@ericbsd ericbsd self-assigned this Nov 10, 2026
@ericbsd
ericbsd requested review from a team as code owners November 10, 2026 00:27
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Data structures

Define the filesystem package set that first-boot setup will install.

  • setup_station/system_calls.py L3-16

API

Add helpers to enable FUSE persistently and start package installation while exposing its output.

  • setup_station/system_calls.py L503-536

Expose a default-route connectivity check for setup to use before proceeding offline.

  • setup_station/network_setup.py L8, L185-189

Uses of the API

Integrate FUSE enablement and per-package installation into first-boot setup, continuing after individual failures.

  • setup_station/setup_system.py L42-59, L64-100

UI

Warn users that filesystem packages will not be installed when continuing without a network connection.

  • setup_station/interface_controller.py L144-163, L206-207

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit cda962f

#316 Move exFAT/FUSE filesystem tools from ISO to setup-station-init · 1 of 2 met

# Requirement Status Notes
1 On a new installation, setup-station-init installs the listed packages at first boot. ✅ Met The six packages are listed in filesystem_packages and installed in setup_system before first-boot setup is disabled.
2 The ISO built from ghostbsd-build no longer includes the listed packages. ❌ Not addressed The diff contains no change to the ghostbsd-build ISO package list.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread setup_station/setup_system.py Resolved
Comment thread setup_station/setup_system.py Resolved
Comment thread setup_station/setup_system.py Resolved
Comment thread setup_station/network_setup.py Resolved
Comment thread setup_station/setup_system.py Resolved
Comment thread setup_station/network_setup.py Resolved
Comment thread setup_station/interface_controller.py Resolved
Comment thread setup_station/system_calls.py Resolved
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.
@ericbsd
ericbsd merged commit 81537a5 into master Nov 10, 2026
1 check passed
@ericbsd
ericbsd deleted the first-boot-fs-packages branch November 10, 2026 02:35
@github-project-automation github-project-automation Bot moved this from In Review to Done in Development Tracker Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Move exFAT/FUSE filesystem tools from ISO to setup-station-init

1 participant