lualoader: Added a menu option for unmuting logs.#387
Conversation
Reviewer's GuideAdds 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 entrysequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thank you for taking the time to contribute to FreeBSD!
Please review CONTRIBUTING.md, then update and push your branch again. |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Moving
core.recordDefaults()out ofcore.luaand only invoking it frommenu.luameans any other consumer ofcore.setDefaults()that doesn’t loadmenu.luawill now seedefault_*values (especiallydefault_mute) coming from the hardcoded initializers rather than the environment; consider either keeping an initial call insidecore.lua(after config is loaded) or havingsetDefaults()lazily callrecordDefaults()if defaults haven’t been initialized. - The new
default_mute = trueinitializer will be used whenevercore.setDefaults()is called beforerecordDefaults()has run, which may unexpectedly enableboot_mute; consider defaulting this tofalseor explicitly guardingsetDefaults()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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Verbose should set boot_mute. I did add that a month our 2 ago. |
Added a dedicated 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>
I missed that line because this patch was originally made against an older branch. There are some issues with grouping two
So for example if a user toggles Verbose on and then off, These are tiny issues, though I think they make the UX a tad bit better ... |
Added a menu option for toggling the
boot_menukenv variable so that the user can easily toggleboot_menuoff 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:
Bug Fixes:
Enhancements: