Skip to content

lualoader: Added a menu option for unmuting logs.#387

Open
b-aaz wants to merge 1 commit into
ghostbsd:stable/15from
b-aaz:loader_boot_mute
Open

lualoader: Added a menu option for unmuting logs.#387
b-aaz wants to merge 1 commit into
ghostbsd:stable/15from
b-aaz:loader_boot_mute

Conversation

@b-aaz

@b-aaz b-aaz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Added a menu option for toggling the boot_menu kenv variable so that the user can easily toggle boot_menu off to see the kernel messages. Useful for debugging, etc.

Also moved the core.recordDefaults() out of the end of core.lua and put it on top of menu.lua . When the function ran at the end of core.lua, it did not capture the variables defined in loader configuration files. This is a small bug in base.

This feature came up on discussions and I thought it would be useful to have. The patch is also included in the unionfs ISO I have shared for testing.

Summary by Sourcery

Add support for toggling kernel boot log muting from the loader menu and ensure default boot options are captured correctly from configuration.

New Features:

  • Expose a boot menu option to toggle kernel log muting by controlling the boot_mute environment variable.

Bug Fixes:

  • Ensure default boot options are recorded after loader configuration files are processed so their values are correctly captured.

Enhancements:

  • Introduce core.setMute and integrate mute state into the shared default boot options mechanism.

Added a menu option for toggling the `boot_menu` kenv variable so that
the user can easily toggle `boot_menu` off to see the kernel messages.
Useful for debugging, etc.

Also moved the `core.recordDefaults()` out of the end of core.lua and put
it on top of menu.lua . When the function ran at the end of core.lua, it
did not capture the variables defined in loader configuration files.
This is a small bug in base.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
@b-aaz b-aaz requested review from a team as code owners June 14, 2026 18:19
@sourcery-ai

sourcery-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds support for tracking and toggling the loader’s boot_mute setting alongside other boot options, exposes a new "Mute logs" boot menu entry, and fixes when defaults are recorded so configuration-file variables are captured correctly.

Sequence diagram for toggling boot_mute via the new Mute logs menu entry

sequenceDiagram
    actor User
    participant Menu as menu.boot_options
    participant Core as core
    participant Loader as loader

    User->>Menu: select Mute_logs_entry
    Menu->>Core: setMute(mute)
    alt mute is nil
        Core->>Core: [toggle core.mute]
    end
    alt core.mute is true
        Core->>Loader: setenv(boot_mute, YES)
    else core.mute is false
        Core->>Loader: unsetenv(boot_mute)
    end
    Core->>Core: core.mute = mute
Loading

File-Level Changes

Change Details Files
Record loader defaults after configuration is loaded so kenv-based settings are captured correctly.
  • Convert the local recordDefaults function into a public core.recordDefaults method so it can be invoked externally.
  • Include boot_mute in the recorded defaults by reading the loader.getenv("boot_mute") value and computing default_mute.
  • Have core.recordDefaults call core.setDefaults instead of directly mutating individual settings so all defaults flow through the same path.
  • Remove the old recordDefaults() call from the end of core.lua and invoke core.recordDefaults() from menu.lua so defaults are captured after loader configuration files are processed.
stand/lua/core.lua
stand/lua/menu.lua
Add mute/unmute support as a first-class boot option and menu entry.
  • Introduce a default_mute state variable and extend core.setDefaults() to apply it using core.setMute.
  • Implement core.setMute(mute) to toggle core.mute, set or unset the boot_mute kenv, and support nil to mean "toggle".
  • Add a new boot menu entry under menu.boot_options to display and toggle the mute logs option, with keyboard aliases 'l' and 'L', using core.mute as the current state.
stand/lua/core.lua
stand/lua/menu.lua

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

@github-actions

Copy link
Copy Markdown

Thank you for taking the time to contribute to FreeBSD!
There is an issue that needs to be fixed:

  • Real email address is neededbb1c025

Please review CONTRIBUTING.md, then update and push your branch again.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Moving core.recordDefaults() out of core.lua and only invoking it from menu.lua means any other consumer of core.setDefaults() that doesn’t load menu.lua will now see default_* values (especially default_mute) coming from the hardcoded initializers rather than the environment; consider either keeping an initial call inside core.lua (after config is loaded) or having setDefaults() lazily call recordDefaults() if defaults haven’t been initialized.
  • The new default_mute = true initializer will be used whenever core.setDefaults() is called before recordDefaults() has run, which may unexpectedly enable boot_mute; consider defaulting this to false or explicitly guarding setDefaults() to only use environment-derived values.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Moving `core.recordDefaults()` out of `core.lua` and only invoking it from `menu.lua` means any other consumer of `core.setDefaults()` that doesn’t load `menu.lua` will now see `default_*` values (especially `default_mute`) coming from the hardcoded initializers rather than the environment; consider either keeping an initial call inside `core.lua` (after config is loaded) or having `setDefaults()` lazily call `recordDefaults()` if defaults haven’t been initialized.
- The new `default_mute = true` initializer will be used whenever `core.setDefaults()` is called before `recordDefaults()` has run, which may unexpectedly enable `boot_mute`; consider defaulting this to `false` or explicitly guarding `setDefaults()` to only use environment-derived values.

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 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Verbose should set boot_mute. I did add that a month our 2 ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants