History log of /freebsd-13.1/stand/lua/cli.lua (Results 1 – 24 of 24)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.4.0, release/13.1.0, release/12.3.0
# 25b4b24e 28-Jul-2021 Warner Losh <[email protected]>

lua loader: Add disable-device to disable a device.

disable-device fooX will set hint.foo.X.disabled=1 as a way to easily
disable a device attaching during boot.

Reviewed by: tsoome
Sponsored by:

lua loader: Add disable-device to disable a device.

disable-device fooX will set hint.foo.X.disabled=1 as a way to easily
disable a device attaching during boot.

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31297

(cherry picked from commit 07c4b78d0a1d26b6441cf3e52b917f20c932b9d0)

show more ...


Revision tags: release/13.0.0
# 29842cb3 17-Dec-2020 Kyle Evans <[email protected]>

lualoader: fix lua-lint run

luacheck rightfully complains that i is unused in the show-module-options
loop at the end (it was used for some debugging in the process).

We've added a new pager module

lualoader: fix lua-lint run

luacheck rightfully complains that i is unused in the show-module-options
loop at the end (it was used for some debugging in the process).

We've added a new pager module that's compiled in, so declare that as an
acceptable global.

show more ...


# 7ed84fa1 17-Dec-2020 Kyle Evans <[email protected]>

lualoader: cli: provide a show-module-options loader command

This effectively dumps everything lualoader knows about to the console using
the libsa pager; that particular lua interface was added in

lualoader: cli: provide a show-module-options loader command

This effectively dumps everything lualoader knows about to the console using
the libsa pager; that particular lua interface was added in r368591.

A pager stub implementation has been added that just dumps the output as-is
as a compat shim for older loader binaries that do not have lpager. This
stub should be moved into a more appropriate .lua file if we add anything
else that needs the pager.

show more ...


# 4634bb1f 12-Dec-2020 Kyle Evans <[email protected]>

lualoader: provide module-manipulation commands

Specifically, we have:
- enable-module
- disable-module
- toggle-module

These can be used to add/remove modules to be loaded or force modules to be
l

lualoader: provide module-manipulation commands

Specifically, we have:
- enable-module
- disable-module
- toggle-module

These can be used to add/remove modules to be loaded or force modules to be
loaded in spite of modules_blacklist. In the typical case, a user is
expected to use them to recover an issue happening due to a module directive
they've added to their loader.conf or because they discover that they've
under-specified what to load.

MFC after: 1 week

show more ...


Revision tags: release/12.2.0
# 94510c29 01-Oct-2020 Kyle Evans <[email protected]>

lualoader: clear up some luacheck warnings

- One (1) unused argument
- One (1) trailing whitespace
- Two (2) "non-standard global" (curenv, rewind)

tools/boot/lua-lint.sh is once again happy.


Revision tags: release/11.4.0
# 3fe0ac6a 30-Apr-2020 Kyle Evans <[email protected]>

lualoader: config: improve readConfFiles, rename to readConf

The previous interface was pretty bad, and required the caller to get some
implementation details correct that it really shouldn't need t

lualoader: config: improve readConfFiles, rename to readConf

The previous interface was pretty bad, and required the caller to get some
implementation details correct that it really shouldn't need to (e.g.
loader_conf_files handling) and pass in an empty table for it to use.

The new and much improved interface, readConf, is much less of a hack;
hiding these implementation details and just doing the right thing.
config.lua will now use it to process /boot/defaults/loader.conf and the
subsequent loader_conf_files from there, and read-conf will also use it.

This improvement submitted by Olivier (cited below), loader_conf_files
handling from the original patch was changed to just clobber it before
processing and not bother restoring it after the fact following r360505
where it's now guaranteed to evade the loader environment.

PR: 244640
Submitted by: Olivier Certner (olivier freebsd free fr>

show more ...


# cc038071 28-Apr-2020 Kyle Evans <[email protected]>

lualoader: cli: clobber loader_conf_files before proceeding

This makes sure that config.readConfFiles doesn't see a stale
loader_conf_files from before, in case the newly loaded file doesn't set it.

lualoader: cli: clobber loader_conf_files before proceeding

This makes sure that config.readConfFiles doesn't see a stale
loader_conf_files from before, in case the newly loaded file doesn't set it.

MFC after: 3 days

show more ...


# e40d2a04 28-Apr-2020 Kyle Evans <[email protected]>

lualoader: cli: add read-conf

This is a straightforward match to the command used by many in forthloader;
it uses the newly-exported config.readConfFiles() to make sure that any
loader_conf_files ge

lualoader: cli: add read-conf

This is a straightforward match to the command used by many in forthloader;
it uses the newly-exported config.readConfFiles() to make sure that any
loader_conf_files gets done as appropriate.

PR: 244640
Submitted by: Olivier Certner <olivier freebsd free fr>
MFC after: 3 days

show more ...


Revision tags: release/12.1.0
# af876563 14-Sep-2019 Kyle Evans <[email protected]>

lualoader: Add reload-conf loader command

This command will trigger a reload of the configuration from disk. This is
useful if you've changed currdev from recovery media to local disk as much
as I h

lualoader: Add reload-conf loader command

This command will trigger a reload of the configuration from disk. This is
useful if you've changed currdev from recovery media to local disk as much
as I have over the past ~2 hours and are tired of the extra keystrokes.

This is really just a glorified shortcut, but reload-conf is likely easier
to remember for other people and does save some keystrokes when reloading
the configuration. It is also resilient to the underlying config method
changing interface, but this is unlikely to happen.

MFC after: 1 week

show more ...


Revision tags: release/11.3.0, release/12.0.0
# 83f7a74c 02-Nov-2018 Kyle Evans <[email protected]>

lualoader: Implement boot-conf

MFC after: 3 days


Revision tags: release/11.2.0
# 4b3c64f7 09-May-2018 Kyle Evans <[email protected]>

Remove "All Rights Reserved" on files that I hold sole copyright on

See r333391 for more detail; in summary: it holds no weight and may be
removed.


# f6e00525 07-Mar-2018 Kyle Evans <[email protected]>

lualoader: Return status in cli_execute_unparsed properly

cli_execute was changed to return the status, cascade that to
cli_execute_unparsed.

This fixes a lot of false "Failed to execute" errors fo

lualoader: Return status in cli_execute_unparsed properly

cli_execute was changed to return the status, cascade that to
cli_execute_unparsed.

This fixes a lot of false "Failed to execute" errors following r330620; no
failures actually occurred, but [module]_error would've then promptly
executed (and also "failed")

show more ...


# ca3b8c9f 07-Mar-2018 Kyle Evans <[email protected]>

lualoader: Fix name, cli.execute_unparsed -> cli_execute_unparsed


# 697f127d 07-Mar-2018 Kyle Evans <[email protected]>

lualoader: Expose loader.parse and add cli_execute_unparsed

This will be used for scenarios where the command to execute is coming in
via the environment (from, for example, loader.conf(5)) and is t

lualoader: Expose loader.parse and add cli_execute_unparsed

This will be used for scenarios where the command to execute is coming in
via the environment (from, for example, loader.conf(5)) and is thus not
necessarily trusted.

cli_execute_unparsed will immediately be used for handling
module_{before,after,error} as well as menu_timeout_command. We still want
to offer these variables the ability to execute Lua-intercepted loader
commands, but we don't want them to be able to execute arbitrary Lua.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14580

show more ...


# c6d9f133 04-Mar-2018 Kyle Evans <[email protected]>

lualoader: Return meaningful value in cli_execute

loader.command(...) will return whatever the executed function returns, so
follow suit and return whatever loader.command() returned or whatever the

lualoader: Return meaningful value in cli_execute

loader.command(...) will return whatever the executed function returns, so
follow suit and return whatever loader.command() returned or whatever the
Lua function returns.

show more ...


# 22ae8ae1 25-Feb-2018 Kyle Evans <[email protected]>

lualoader: Explain deviation from naming guidelines

cli_execute is likely the only exception that we should make, due to it
being a global. We don't really need other globals, so this won't really e

lualoader: Explain deviation from naming guidelines

cli_execute is likely the only exception that we should make, due to it
being a global. We don't really need other globals, so this won't really end
up an epidemic.

show more ...


# 322a2ddd 24-Feb-2018 Kyle Evans <[email protected]>

lualoader: Clean up naming conventions a little bit

We mostly use camel case for function names, but some local functions got
mixed in using internal underscores. Doubles down on camel case.


# 9ed6f9ef 23-Feb-2018 Kyle Evans <[email protected]>

lualoader: Use "local function x()" instead of "local x = function()"

The latter is good, but the former is more elegant and clear about what 'x'
is. Adopt it, preferably only using the latter kind

lualoader: Use "local function x()" instead of "local x = function()"

The latter is good, but the former is more elegant and clear about what 'x'
is. Adopt it, preferably only using the latter kind of notation where needed
as values for tables.

show more ...


# 72e39d71 23-Feb-2018 Kyle Evans <[email protected]>

Add SPDX tags to lua files


# e2df27e3 22-Feb-2018 Kyle Evans <[email protected]>

lualoader: Address some 'luacheck' concerns

luacheck pointed out an assortment of issues, ranging from non-standard
globals being created as well as unused parameters, variables, and redundant
assig

lualoader: Address some 'luacheck' concerns

luacheck pointed out an assortment of issues, ranging from non-standard
globals being created as well as unused parameters, variables, and redundant
assignments.

Using '_' as a placeholder for values unused (whether it be parameters
unused or return values unused, assuming multiple return values) feels clean
and gets the point across, so I've adopted it. It also helps flag candidates
for cleanup later in some of the lambdas I've created, giving me an easy way
to re-evaluate later if we're still not using some of these features.

show more ...


# 2e4dad82 22-Feb-2018 Kyle Evans <[email protected]>

lualoader: Attach cli command functions to cli module

Instead of the global namespace, let's attach these to the cli module. Other
users, including the "local" module, can attach functions to the cl

lualoader: Attach cli command functions to cli module

Instead of the global namespace, let's attach these to the cli module. Other
users, including the "local" module, can attach functions to the cli module
at will to add other cli commands and things will still Just Work.

This distills down the candidates for functions that may be invoked via the
cli to a minimal set (boot, autoboot, arguments), rather than any function
that happens to live in the global lua namespace.

show more ...


# eca5ca66 22-Feb-2018 Kyle Evans <[email protected]>

lualoader: Pull argument extraction for cli functions into cli.arguments

This will be the translation layer for varargs -> cmd_name, argv for cli
commands. We reserve the right to break exactly what

lualoader: Pull argument extraction for cli functions into cli.arguments

This will be the translation layer for varargs -> cmd_name, argv for cli
commands. We reserve the right to break exactly what the varargs inclulde,
but this gives us a stable way to pull the arguments out of varargs.

show more ...


# 3e6c7d54 22-Feb-2018 Kyle Evans <[email protected]>

lualoader: Unbreak 'boot [kernel]' by including config


# e37f4622 22-Feb-2018 Kyle Evans <[email protected]>

lualoader: Split cli bits out into a cli module

This module will, in the not-so-distant future, grow functionality for
reducing boilerplate in functions that implement cli commands. It will
likely a

lualoader: Split cli bits out into a cli module

This module will, in the not-so-distant future, grow functionality for
reducing boilerplate in functions that implement cli commands. It will
likely also house most in-tree cli commands.

show more ...