Commit graph

343 commits

Author SHA1 Message Date
Warner Losh
708c8a926a loader: Use Cyan instead of Blue for some menu items
BLUE often translates to DARK BLUE. On BLACK this is hard to
read. Instead, use CYAN which looks good on both black and white
backgrounds.

Discussed with: kevans
Sponsored by: Netflix

(cherry picked from commit baa7e9cd3083ccaed8f26e9ad786ff9657ab85fc)
2024-12-28 11:14:58 -07:00
Warner Losh
28e212c740 loader: Fix 0 vs 1 confusion for column numbers
In two places we use '0' for a column number. However, the upper left
hand corner of the screen is 1, 1. Fix those two confusions. Also, fix
a comment that flipped the coordinates in a comment (I'm used to the
vt100 convention where it's row, column (eg y, x)) and didn't notice
the rest of the code uses x, y.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D46777

(cherry picked from commit 604919c47fa4092db08dadd282851afc9cba0a90)
2024-12-28 11:14:41 -07:00
Warner Losh
940984f4c1 loader: Use printc instead of print to fit in 24,80
print automatically adds a newline, while printc does not. Use printc in
preference to print for managing the autoboot message. This means we can
use line 24 safely on a 24x80 terminal, restoring some functionality
that was lost in 101afbc6ee2f0.

Note: we still set the default curosor position to 25,1 in screen.lua,
but real VT100s (and successors) will treat any row larger than the
pnumber of rows in a cursor motion command to be the last physical row
(this is so you can move to 9999,9999 and do a cursor location query to
get the size of the screen). Keeping that as is looks better on a
typical VGA console.

Fixes: 101afbc6ee2f0
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision:	https://reviews.freebsd.org/D46771

(cherry picked from commit 3fb656f8ef21332d96de8097521aaa51ddeb649d)
2024-12-28 11:14:27 -07:00
Warner Losh
7f2d1cac4e loader/menu: tweak for added line
I added a line to the menu, but didn't adjust so things were a
line off. Make the necessary adjustments.

Fixes: 7cb65be96d47
Sponsored by: Netflix
MFC After: 3 days

(cherry picked from commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c)
2024-12-28 11:12:26 -07:00
Graham Percival
666d4c2bbd manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459

(cherry picked from commit 229381deb270e8e240d20b572c63234a61cbd977)
2024-11-04 12:13:50 -04:00
Warner Losh
f2103edaf5 loader: Fix boot menu on BIOS
Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.

PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D47403

(cherry picked from commit c2ba66d4d01f23303352bfe3cbd50ff5d9a05947)
2024-11-03 17:51:24 -07:00
Colin Percival
a651978fc4 loader: Load platform entropy even without menu
In 5c73b3e0a3 calls to core.loadEntropy were added to core.boot
and core.autoboot; but neither of those is invoked if we disable
the "beastie" menu.  Add a core.loadEntropy call to the no-menu
path.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Amazon
Fixes:	5c73b3e0a3 ("Add support for getting early entropy from UEFI")
Differential Revision:	https://reviews.freebsd.org/D46637

(cherry picked from commit 74a28cf6e7f66c7c12fd25ee8231eeedf756bf08)
2024-09-29 08:24:53 -07:00
Colin Percival
0a8ff19896 loader: Make EFI entropy size configurable
Add a new loader variable entropy_efi_seed_size which defaults to 2048;
if not defined (e.g. if the /boot/lua/ is updated but /boot/defaults/
isn't) the same 2048 default will be used.

Reviewed by:	Val Packett
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46632

(cherry picked from commit f4a69a933cd645e384b337db5ef2ccf41a1ddd5b)
2024-09-29 08:24:52 -07:00
Warner Losh
59bfc69490 stand: Add "Loader needs updating" to the first menu item"
When the boot loader version is too old, add a warning to the boot menu
to maybe catch people's attention.

Use the correct loader code that adds an inactive highlighted menu item
indicating that an update is needed.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D45890

(cherry picked from commit 0eac99f76ec31270f902cc2a0ff5ae4b5b606a65)
(cherry picked from commit 7cb65be96d47cbe0b740266bc633d272fc4c5e6b)
2024-08-01 08:49:54 -06:00
Warner Losh
53a4bf76c5 stand: Print a warning of the loader is too old
If the loader is < 3.0, print a warning that it's too old and needs to
be upgraded.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45889

(cherry picked from commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c)
2024-08-01 08:49:54 -06:00
Warner Losh
7ffa3b0f69 Revert "loader/lua: Remove workaround for command_error"
This reverts commit 552f3072af54820cf1805f712e2567bc1b7f046d.

loader.command_error was added just after 11.2, but appears to not have
been back ported to 11.x. 11.0 was the first lua loader release, so keep
this compat shim until we sort out what to do.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45883

(cherry picked from commit 809edb3636a5494ad7d3dfff910e0aab89d83442)
2024-08-01 08:49:54 -06:00
Warner Losh
598b9677b3 Revert "loader/lua: Remove compat shim for loader.lua_path"
This reverts commit ab97d42addae97a389c6f22d6bba62ed954bb8e7.

There's too many people in the field with FreeBSD 12.0 loader.efi that
stubbed their toe on upgrading to 14.1 since they'd not updated
loader.efi. While we sort out that mess, add back this workaround.  Can
revisit after 14.2 maybe.

MFC After: 		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45882

(cherry picked from commit 522a65a8d97a0d6b634266f1b4a89aa8f374279c)
2024-08-01 08:49:54 -06:00
Warner Losh
90ca43b5dc Revert "loader/lua: Remove pager shim"
This reverts commit 8b9178cd0d35ff2beafebdd51c8c44ba2b5aeb0f.

Really old loader.efi files persist in the field. Revert this to support
it. We need to support this through at least 14.2 now, alas.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45881

(cherry picked from commit b38a82c77ab90eace53c56151b191efd1f4a8439)
2024-08-01 08:49:54 -06:00
Warner Losh
64355a9cb3 loader/lua: Remove workaround for command_error
loader.command_error was available prior to stable/12 branching. No need
to check if it is available or not.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D44144

(cherry picked from commit 552f3072af54820cf1805f712e2567bc1b7f046d)
2024-04-16 13:54:29 -06:00
Warner Losh
216c56ff1d loader/lua: Remove compat shim for loader.lua_path
loader.lua_path was committed before stable/13 was branched, and merged
in to for 12.2. Remove workaround for it not being present.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D44143

(cherry picked from commit ab97d42addae97a389c6f22d6bba62ed954bb8e7)
2024-04-16 13:54:28 -06:00
Warner Losh
71969b965b loader/lua: Remove pager shim
Just after 12.2 and before the stable/13 branch, kevans added lpager.c
to provide a pager interface for commands written in lua.  It was merged
into 12.3. Now that 12.2 is long since EOL, we can remove the pager shim
here. Nobody needs that old loader + new lua scripts.  Plus only one
command is affected.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D44142

(cherry picked from commit 8b9178cd0d35ff2beafebdd51c8c44ba2b5aeb0f)
2024-04-16 13:54:28 -06:00
Warner Losh
5e85090731 loader: Add loader.exit
Add loader.exit(status). While one can get alomst this behavior with
loader.perform("quit"), quit doesn't allow a value to be returned to the
firmware. The interpretation of 'status' is firmware specific. This can
be used when autobooting doesn't work in scripts, for example, to allow
the firmware to try something else...

Sponsored by:		Netflix

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44094

(cherry picked from commit 9398a495eb305d5bf240bc998ee2f6128d75f4ca)
2024-04-16 13:54:28 -06:00
Warner Losh
19388dd2ad loader: Move drawer.lua over to gfx table.
Drawer.lua is the only bit of lua code in the base that uses any of the
functons moved from the loader table to the gfx table. Move the main
code to using the gfx dispatch. Add compat code for running on old
loaders that creates the newer-style gfx table with the term_* functions
we call in it populated. This will even work on the super old versions
of the loader that don't have them (we'll still skip using them).

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D43908

(cherry picked from commit 0fd98b8a7691b4f11e1bfbcb53a3a7c68d7c1fb7)
2024-04-16 13:54:24 -06:00
Warner Losh
32c08f4925 loader: Move gfx functions to gfx.lua.8
Now that the fb_* and term_* functions are available in the gfx table,
move the documentation to gfx.lua.8. Add information about backwards
compatibility.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D43907

(cherry picked from commit a8f8c53761c4b0436c9d546ebe046003f1b3d88f)
2024-04-16 13:54:24 -06:00
Warner Losh
cfe4f061a7 loader: Document the lua loader table.
Document all the public functions from the "loader" table.

Sponsored by:		Netflix
Reviewed by:		pauamma_gundo.com, tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D43701

(cherry picked from commit 621dae89f3c70b86bef255a621a76bf553f733ff)
2024-04-16 13:54:22 -06:00
Stéphane Rochoy
a25531db0f stand/lua: always allow overriding with local config files
Loader now also read configuration files listed in local_loader_conf_files.
Files listed here are the last ones read. And /boot/loader.conf.local was
moved from loader_conf_files to local_loader_conf_files leaving only
loader.conf and device.hints in loader_conf_files by default.

The idea is to ensure local_loader_conf_files, i.e., /boot/loader.conf.local,
can always be used to override other user defined settings.

So the sequencing is now as follow:

 1. Bootstrap:
     /boot/defaults/loader.conf

 2. Read loader_conf_files files:
     /boot/device.hints
     /boot/loader.conf

 3. Read loader_conf_dirs files:
     /boot/loader.conf.d/*.conf

 4. And finally, rread local_loader_conf_files files:
     /boot/loader.conf.local

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759

[[ The commit, revert, recommit has been squashed down to record the merge  ]]
(cherry picked from commit c475e61f66fe8fe939e18ec7821c2340569f3271)
(cherry picked from commit 5fdf01dbeef1f64f8c446561498d662702451ac1)
(cherry picked from commit d3d0b735571d9562812ce5b343a6e91f7a795dbe)
2024-04-16 13:54:21 -06:00
Stéphane Rochoy
3eb3a802a3 stand/lua: per-product conf if requested via product_vars
If product_vars is set, it must be a space separated list of environment
variable names to walk through to guess the product. Each time a product can be
guessed (i.e., the corresponding variable is defined), prepend
/boot/loader.conf.d/PRODUCT/ to loader_conf_dirs.

It can be typically used as follow:

    smbios.system.planar.maker="PLANAR_MAKER"
    smbios.system.planar.product="PLANAR_PRODUCT"
    smbios.system.product="PRODUCT"
    uboot.m_product="M_PRODUCT"
    product_vars="smbios.system.planar.maker smbios.system.planar.product smbios.system.product uboot.m_product"

to read files found in the following directories, in that order:

    /boot/loader.conf.d/PLANAR_MAKER
    /boot/loader.conf.d/PLANAR_PRODUCT
    /boot/loader.conf.d/PRODUCT
    /boot/loader.conf.d/M_PRODUCT

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759

[[ The commit, revert, commit has been squashed dpwn ]]
(cherry picked from commit c343eedc6db381ac76e489f8ae0304898b71c5db)
(cherry picked from commit 994865caf250ea2a59b7b842e44680931e8b19f6)
(cherry picked from commit 754cac4b283eb024a3a6a194130199c860e32ebf)
2024-04-16 13:54:21 -06:00
Kyle Evans
77d298ea3f loader: lua: assume late ACPI detection if the feature isn't enabled
While we're here, enable the feature in the places we detect ACPI.  This
lets us side-step the existing issues and provide a path forward for
folks upgrading from previous releases that haven't updated their ESP
yet.

Let's also fix core.setACPI: the hint already indicates that the
user's disabled it more consistently than loader.acpi_disabled_by_user.
Even more, the latter is wrong because we set it by default if we did
not detect ACPI.  The ACPI hint remains even when we're setting defaults
because ACPI loaded into the kernel will make some noise if it's not
hinted off, even when we didn't detect it.

imp notes that this will result in some relatively harmless noise on
platforms that don't support ACPI but aren't using the UEFI loader, as
we would enable the ACPI module for loading on them and then loader
would not be able to find it.  These are non-fatal, but should probably
be fixed by just declaring support for EARLY_ACPI in those loaders since
we know they won't have ACPI early on -- punting on this for the time
being, though, in favor of providing a safer upgrade path sooner.

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

(cherry picked from commit e183039f0882009c455c3b59fe1ab58a4fd25a5e)
2024-04-15 20:32:05 -06:00
Warner Losh
5029119797 stand: Retire setting hw.ata.wc: it doesn't exist.
hw.ata.wc was disconnected as part ot the 2013 cam-ification of ata. No
need to continue setting it. It's been unused in FreeBSD 10.x and newer.

Sponsored by:		Netflix

(cherry picked from commit 67d2bd974d34d918255307321107273562f11dde)
2024-04-15 20:32:05 -06:00
Warner Losh
5417db3a97 stand: Retire setting hw.eisa_slots.
When the eisa code was removed in 2017, prior to the stable/12 branch,
setting hw.eisa_slots became a nop. The oldest supported branch doesn't
have eisa at all. The need to set it manually on boot disappeared
largely by 2000...

Sponsored by:		Netflix

(cherry picked from commit 21795c374aceb685dbdb1bd18c7a5c41c3cf0baf)
2024-04-15 20:32:05 -06:00
Warner Losh
9408d0ba3d stand: bandaide for acpi
Old binaries do not set acpi.rsdp early enough. So when we boot with an
older loader.efi from an ESP that's not been updated, we assume there's
no ACPI on this system. This is unwise. Put a band-aide on this until we
can implement a proper 'feature' variable that the binary reports so we
can do conditionals for things like this in the future.

This is at best a rapid-response stop-gap.

Glanced at by: kevans
Sponsored by:		Netflix

(cherry picked from commit 0abe05aeac29d99786401b9078e97dcead35f7f3)
2024-04-15 20:32:04 -06:00
R. Christian McDonald
16c09de801 loader: improve lua ACPI detection and handling
This is a follow-up patch to https://reviews.freebsd.org/D42459
that modifies the loader lua to use the correct loader variables
for determining ACPI availability.

This also fixes a bug where ACPI can be inadvertently disabled when
setting System Defaults at the loader menu.

Reviewed by:	imp, kevans
Approved by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42483

(cherry picked from commit e0f3dc82727f236b0bea495d8a4d6e6dc630854d)
2024-04-15 20:32:04 -06:00
Stephen J. Kiernan
b5cd844a56 loader: add target for dirdeps build
Update dependencies for the loader variations used for each
architecture.

Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D39741

(cherry picked from commit 2008043f386721d58158e37e0d7e50df8095942d)
2024-04-15 20:32:03 -06:00
Kyle Evans
15b946de99 loader: lua: remove the default kernel if it doesn't exist
The `kernel` env var provides the default kernel, usually "kernel".  It
may be the case that the user doesn't have a "kernel" kernel, just
"kernel.*" kernels, but have left `kernel` to the default because we
autodetect entries by default anyways.

If we're doing autodetection, take note of whether the default kernel
exists or not and remove it from the list if it doesn't and we had found
any other kernels.  We avoid it in the #kernels == 1 case because
something fishy has likely happened and we should just trust the
configuration.

Reviewed by:	imp, manu

(cherry picked from commit d04415c520b031fb8eb93cb252e4acee66149c87)
2024-01-02 22:47:21 -06:00
Kyle Evans
566ac8bc76 loader: provide a features table for binary compatibility advertisement
liblua now provides a loader.has_feature() function to probe the loader
binary for features advertised.  name => desc mappings are provided in
loader.features to get a list of all of the features loader *can*
support.  core.hasFeature is provided as a shim to loader.has_feature
so that individual consumers don't need to think about the logic of the
loader module not providing has_feature; we know that means the feature
isn't enabled.

The first consumer of this will be EARLY_ACPI to advertise that the
loader binary probes for ACPI presence before the interpreter has
started, so that we know whether we can trust the presence of acpi.rsdp
as relatively authoritative.  In general, it's intended to be used to
avoid breaking new scripts on older loaders within reason.

This will be used in lua as `core.hasFeature("EARLY_ACPI")`, while the
C bits of loader will `feature_enable(FEATURE_EARLY_ACPI)`.

Reviewed by:	imp

(cherry picked from commit 1631382cf2820245cc72965498ff174bb548dd63)
2024-01-02 22:47:21 -06:00
Kyle Evans
6b2f0a3c31 stand: lua: module names should permit more
The module entries should generally allow whatever is allowed as an
env_var in the pattern table.  Notably, we're missing periods which
would allow proper entries for .dtb files in loader.conf that don't need
to specify a module_name entry for it.

%d in this expression is actually redundant as %w is actually
"all alphanumerics," but I've included it for now to match the env_var
entry.  We should really remove it from both.

Reported by:	"aribi" on the forums via allanjude@

(cherry picked from commit 5bc1e0c2285e73fe8455bb6c72b2b40e33f5477e)
2023-09-11 17:01:52 -05:00
Warner Losh
9636a14538 Remove $FreeBSD$: two-line lua tag
Remove /^--\n--\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:30 -06:00
Warner Losh
fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Kyle Evans
3cb2f5f369 lualoader: add support for .lua configuration files
If a file is specified in loader_conf_files that ends in '.lua', lualoader
will now load and execute that file. These may be used in place of a
traditional loader.conf to use more complicated logic, where some values
may be set based on others or based on the environment that the C bits has
left us with.

Lua scripts are run in a limited environment. In particular, it does not get
access to any modules or, in-fact, anything except environment variable.

A config.buildenv hook has been added so that a local module can add
whatever it may need to to the environment.

When a global var is set in the lua script, it does not immediately alter
the loader environment. Instead, the script's environment is initially
empty and processed only if the whole script executes successfully.
Effectively, a lua configuration file either takes effect or it does not,
an error will not leave it in a half-baked state.

Reviewed by:	bcr (manpages), imp
Differential Revision:	https://reviews.freebsd.org/D28450
2023-05-10 23:10:53 -05:00
Cyrus Rahman
0ab68e9272 loader: lua: disable autoboot timer after password entry
In the lua loader, if one sets a password in loader.conf, the
autoboot_delay timer will start before the menu is displayed.  One can
interrupt the autoboot and bring up the menu by entering a keyboard
character before the timer expires.

If this is done a prompt for the password is displayed.  Entering the
password will bring up the menu, but the timer will again start and
another keyboard character must be entered or autoboot will abort the
menu and boot the system.

PR:		265472
Reviewed by:	kevans
MFC after:	3 days
2023-04-15 21:39:56 -05:00
Cyrus Rahman
d7584aa09f loader: lua: unload the kernel when changing BEs
Usually the kernel is loaded later, but there are circumstances where it
could have been loaded earlier than changing BEs.  Unload anything that
is already there so that we know we're using artifacts from the proper
environment.

PR:		265471
Reviewed by:	kevans
MFC after:	3 days
2023-04-15 21:39:52 -05:00
Warner Losh
e9eee0f256 lua: Export loaded modules env vars via environment
To make auditing and debugging easier, export foo_load=XXX foo_name=yyy
etc to the loader env that we export to the kernel.

Original by:		dhw
Sponsored by:		Netflix
Discussed with:		kevans
Differential Revsion:	https://reviews.freebsd.org/D38466
2023-02-09 11:56:20 -07:00
Jessica Clarke
9b17aa2740 lualoader: Add loader_menu_multi_user_prompt config variable
This allows the "Multi user" in "[B]oot Multi user" to be substituted
with another string, for example with "Installer" in installer media.
Note that this is lua-only at the moment, since loader.4th's menu.rc
defines the alternate name as Boot [M]ulti User, unlike lualoader which
leaves it as [B]oot Multi user. Ideally loader.4th would adopt the newer
and simpler lualoader behaviour and then it could gain support for this
option, but loader.4th is on the way out and isn't used by any official
installer media so this is not a significant concern.

Reviewed by:	kevans, rpokala
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36418
2022-09-02 20:30:40 +01:00
Colin Percival
5c73b3e0a3 Add support for getting early entropy from UEFI
UEFI provides a protocol for accessing randomness. This is a good way
to gather early entropy, especially when there's no driver for the RNG
on the platform (as is the case on the Marvell Armada8k (MACCHIATObin)
for now).

If the entropy_efi_seed option is enabled in loader.conf (default: YES)
obtain 2048 bytes of entropy from UEFI and pass is to the kernel as a
"module" of name "efi_rng_seed" and type "boot_entropy_platform"; if
present, ingest it into the kernel RNG.

Submitted by:	Greg V
Reviewed by:	markm, kevans
Approved by:	csprng (markm)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D20780
2022-02-17 13:01:11 -08:00
Emmanuel Vadot
c4dc907254 loader: lua: test that /boot exists first
Otherwise on fs like tftp where no directory listing is possible we fail
on the .dir method.

Reviewed by:	imp, kevans
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33414
2021-12-16 11:50:45 +01:00
Katsuyuki Miyoshi
bb4c691299 lualoader: fix the autoboot_delay countdown message
When the timer drops from double to single digits, a spare 'e' is left
on the end of the line as we don't overwrite it. Include an extra space
at the end to account for this and overwrite the leftover character.

PR:		259429
MFC after:	3 days
Reviewed by:	emaste
2021-10-26 11:24:29 -05:00
Kyle Evans
ed107537b4 lualoader: use more concise verbiage for autoboot
The behavior remains the same, but lualoader now uses the more concise
verbiage that forthloader used.  This is particularly important because
the previous line would exceed the right boundary of the menu and run
straight into space that would typically be allowed for the logo.

This makes it slightly easier to port logos from forthloader to
lualoader.
2021-09-09 02:01:50 -05:00
Kyle Evans
e19d9a9b6e lualoader: allow brands to specify a shift
Some brands will want to specify a shift to make sure they're properly
centered; let it happen.
2021-09-09 02:01:50 -05:00
Kyle Evans
763bcebe0b lualoader: remove shadowed local from graphics:drawitem()
for loop vars are local already and distinct from this earlier
declaration; remove it.
2021-09-09 02:01:50 -05:00
Warner Losh
6b51baf6a8 cli.lua.8: make the command match the code
It's disable-device, not device-disable

Spotted by:		jrtc27
Sponsored by:		Netflix
2021-07-28 20:54:14 -06:00
Warner Losh
07c4b78d0a 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
2021-07-28 16:53:00 -06:00
Toomas Soome
4ba91fa073 loader: do not output empty menu title
As we output spaces around the menu title, we should also check,
if the title is actually empty string.

PR:		255299
Submitted by:	Jose Luis Duran
Reported by:	Jose Luis Duran
MFC after:	1 week
2021-04-21 14:50:23 +03:00
Warner Losh
556e66b7b0 luaboot: visible must be a function
Visible needs to be a function. Looks like I tested the wrong thing.
2021-03-31 22:35:52 -06:00