Skip to content

Conversation

xcrsz
Copy link
Contributor

@xcrsz xcrsz commented Oct 2, 2025

Add text-based boot splash screen system

Implement a comprehensive splash screen system that provides visual
feedback during GhostBSD live system initialization and desktop loading.

Features:

  • Continuous progress bar from 0-100% across boot phases
  • init.sh.in handles 0-95% during system initialization
  • ghostbsd-extended-boot continues 95-100% for desktop finalization
  • ASCII logo display with animated progress indicators
  • PCX image splash support in boot loader (requires PCX v5, 640x480)

Changes:

  • init.sh.in: Added splash display logic with progress tracking for
    system analysis, ZFS pool creation, and image decompression phases
  • splash-setup.sh: Created scripts for extended boot, interactive boot,
    console logo, and service monitoring
  • autologin.sh: Integrated splash scripts into autologin flow for all
    desktop variants (MATE, XFCE, Plasma, Gershwin)
  • finalize.sh: Added PCX splash configuration for boot loader phase
  • plasma.sh: Fixed to use interactive splash functions
  • setuser.sh: Added splash configuration directories for live users

The splash system gracefully degrades to verbose mode when:

  • /tmp/.verbose_boot flag is present
  • Terminal is not interactive (non-TTY)

Tested on: MATE, XFCE, Gershwin desktop variants

Summary by Sourcery

Add a comprehensive text-based boot splash subsystem and enhance the build workflow with colored logging, smarter resource checks, and improved error handling

New Features:

  • Introduce text-based boot splash system with ASCII logo, animated progress bar, and PCX loader image support
  • Add interactive, extended, and console splash scripts integrated into init, bootloader, and autologin flows
  • Enable graceful fallback to verbose boot mode when /tmp/.verbose_boot is set or in non-interactive terminals

Bug Fixes:

  • Fix plasma desktop script to invoke the new interactive splash functions

Enhancements:

  • Implement color-capable logging in build and gitpkg scripts for clearer output
  • Enforce 8GB RAM minimum and add smart ZFS ARC tuning with automatic restoration during builds
  • Improve error handling for package installation with login.conf fixes and quiet boot loader configuration
  • Add custom loader menu and quiet boot settings for a silent, menu-driven boot experience

Documentation:

  • Update README with splash screen features, updated build requirements, and process enhancements

@xcrsz xcrsz requested review from a team as code owners October 2, 2025 15:45
Copy link
Contributor

sourcery-ai bot commented Oct 2, 2025

Reviewer's Guide

This PR introduces a text-based boot splash system integrated into the GhostBSD build and live-boot flow, adds ANSI-colored, NO_COLOR/FORCE_COLOR–aware logging, enhances ZFS tuning and build prerequisites, and updates desktop and autologin scripts to invoke new splash routines.

Sequence diagram for splash script invocation during live boot

sequenceDiagram
    participant BootLoader
    participant InitScript
    participant ExtendedBootScript
    participant DesktopEnv
    actor User
    BootLoader->>User: Display PCX splash (if available)
    BootLoader->>InitScript: Start system initialization
    InitScript->>User: Show ASCII logo and progress bar (0-95%)
    InitScript->>ExtendedBootScript: Invoke for desktop finalization (95-100%)
    ExtendedBootScript->>User: Show ASCII logo and progress bar (final phase)
    ExtendedBootScript->>DesktopEnv: Start desktop environment
    User->>InitScript: Press ESC to reveal verbose messages (optional)
    User->>ExtendedBootScript: Press ESC to reveal verbose messages (optional)
Loading

File-Level Changes

Change Details Files
Enhance build.sh with color logging and smarter ZFS tuning
  • Add ANSI color support respecting NO_COLOR and FORCE_COLOR
  • Raise minimum RAM to 8GB and disk space to 20GB checks
  • Refactor ZFS ARC save/tune/restore logic for auto/conservative/aggressive modes
  • Inject splash image copy step into ghostbsd_config
build.sh
Create unified splash-screen setup script
  • Add common_config/splash-setup.sh with functions to generate logo and scripts
  • Implement init.sh.in logic for early boot progress (0–95%)
  • Generate ghostbsd-extended-boot, ghostbsd-interactive-boot, ghostbsd-ascii-logo, and placeholder service
common_config/splash-setup.sh
init.sh.in
Integrate interactive splash into autologin and user setup
  • Extend autologin.sh with community_setup_autologin_interactive variants
  • Add ghostbsd_setup_liveuser_interactive and related functions in setuser.sh
  • Ensure .config/fish config runs splash scripts on TTY0
common_config/autologin.sh
common_config/setuser.sh
Update desktop config to invoke splash routines
  • Source splash-setup.sh in each desktop_config/*.sh
  • Replace legacy autologin calls with interactive splash functions
  • Maintain final_setup invocation after splash hooks
desktop_config/xfce.sh
desktop_config/mate.sh
desktop_config/plasma.sh
desktop_config/gershwin.sh
Enhance finalize.sh with boot loader tweaks
  • Add setup_quiet_boot to suppress kernel messages
  • Stub setup_loader_splash and create custom boot menu in setup_boot_menu
  • Preserve PCX splash loader support (95–100% desktop finalization)
common_config/finalize.sh
boot/loader.conf
Revise documentation for splash and build requirements
  • Document interactive splash features and ESC-to-verbose option
  • Highlight new 8GB RAM and 20GB disk prerequisites
  • Note ZFS ARC tuning, color logging, and login.conf fixes
README.md

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • This PR bundles a huge set of unrelated changes (color logging, ZFS tuning, splash screen, autologin tweaks, etc.); please split it into smaller, focused PRs to make review and testing more manageable.
  • The new common_config/splash-setup.sh script is very large and complex—consider refactoring it into smaller, well-named modules or functions to improve readability and maintainability.
  • The gitpkg.sh fallback logic references hard-coded local paths (e.g. /usr/home/ericbsd/...); make these developer-specific paths configurable or remove them so the script works on other machines.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- This PR bundles a huge set of unrelated changes (color logging, ZFS tuning, splash screen, autologin tweaks, etc.); please split it into smaller, focused PRs to make review and testing more manageable.
- The new common_config/splash-setup.sh script is very large and complex—consider refactoring it into smaller, well-named modules or functions to improve readability and maintainability.
- The gitpkg.sh fallback logic references hard-coded local paths (e.g. `/usr/home/ericbsd/...`); make these developer-specific paths configurable or remove them so the script works on other machines.

## Individual Comments

### Comment 1
<location> `common_config/gitpkg.sh:60-62` </location>
<code_context>
+    log "INFO: Cloning with ${timeout}s timeout..."
+    
+    # Run git clone with timeout
+    if timeout "$timeout" sh -c "$git_cmd" 2>&1 | while IFS= read -r line; do
+        # Show progress for verbose output
+        case "$line" in
+            *"Cloning into"*|*"remote: Counting"*|*"Receiving objects"*)
+                echo "  $line"
</code_context>

<issue_to_address>
**issue (bug_risk):** The use of 'timeout' with 'sh -c' and piped output may not propagate the exit code of 'git clone' reliably.

Piping the output in this way can obscure the actual exit code from 'git clone', which may lead to incorrect error handling. To avoid this, capture the exit code immediately after running the command or use a subshell to preserve it.
</issue_to_address>

### Comment 2
<location> `common_config/gitpkg.sh:100-102` </location>
<code_context>
-      cp -R /usr/home/ericbsd/projects/ghostbsd/pc-sysinstall "${release}/pc-sysinstall"
+
+    # Check network connectivity
+    if ! check_network; then
+      log "WARNING: No network connectivity, checking for local copy"
+      if [ -d "/usr/home/ericbsd/projects/ghostbsd/pc-sysinstall" ]; then
+        log "INFO: Using local copy"
+        cp -R /usr/home/ericbsd/projects/ghostbsd/pc-sysinstall "${release}/pc-sysinstall"
</code_context>

<issue_to_address>
**suggestion:** Hardcoded fallback paths may not be portable or configurable for other environments.

This path should be configurable or clearly documented to avoid issues in other environments.
</issue_to_address>

### Comment 3
<location> `common_config/autologin.sh:203-140` </location>
<code_context>
+  printf "set tty (tty)
</code_context>

<issue_to_address>
**issue (bug_risk):** The fish config for autologin runs 'startx' twice in some cases.

Both branches of the conditional run 'startx', and it is also called after the conditional, leading to two executions. Please update the logic so 'startx' runs only once per session.
</issue_to_address>

### Comment 4
<location> `common_config/finalize.sh:24-25` </location>
<code_context>
+  echo 'kern.log_console_output=0' >> "${release}/etc/sysctl.conf"
+  
+  # Add quiet boot options to loader.conf if not already present
+  if ! grep -q "boot_verbose" "${release}/boot/loader.conf" 2>/dev/null; then
+    cat >> "${release}/boot/loader.conf" << 'EOF'
+
+# Quiet boot options
</code_context>

<issue_to_address>
**issue (bug_risk):** Appending to loader.conf without checking for existing keys may cause duplicate entries.

If keys like 'boot_verbose' or 'autoboot_delay' are already present, appending may create duplicates or conflicts. Please update existing keys or remove duplicates to maintain consistent boot settings.
</issue_to_address>

### Comment 5
<location> `common_config/splash-setup.sh:25-26` </location>
<code_context>
+
+setup_interactive_splash()
+{
+  echo "Current working directory: $(pwd)"
+  echo "cwd variable: ${cwd}"
+  
+  # Splash configuration - no bootloader logo modifications
</code_context>

<issue_to_address>
**nitpick:** Debugging output in setup_interactive_splash may be left over from development.

If these echo statements are not needed in production, please remove them to keep logs and output clean.
</issue_to_address>

### Comment 6
<location> `README.md:11` </location>
<code_context>
 ## Features
 * Build GhostBSD from packages
-* Multiple desktop environments (Mate, XFCE, Gershwin, Plasma, and more)
+* Multiple desktop environments (Mate, XFCE, Gershwin, and Kde Plasma 6)
 * Hybrid DVD/USB image
 * Configurable ZFS memory management for build optimization
</code_context>

<issue_to_address>
**suggestion (typo):** Correct 'Kde' to 'KDE' for consistency.

Use 'KDE Plasma 6' to align with standard naming conventions.

```suggestion
* Multiple desktop environments (Mate, XFCE, Gershwin, and KDE Plasma 6)
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ericbsd ericbsd changed the base branch from master to new-boot-process October 6, 2025 23:08
ericbsd and others added 2 commits October 7, 2025 20:29
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@ericbsd ericbsd merged commit be3810c into ghostbsd:new-boot-process Oct 7, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Development Management Oct 7, 2025
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.

2 participants