History log of /src/stand/lua/core.lua (Results 1 – 25 of 265)
Revision Date Author Comments
# e6d579be 09-Mar-2026 Craig Leres <leres@FreeBSD.org>

core.lua: follow symlinks when looking for bootable kernels

PR: 293654
Reviewed by: kevans
Approved by: kevans
Differential Revision: https://reviews.freebsd.org/D55713


# e30086ab 07-Jan-2026 Kyle Evans <kevans@FreeBSD.org>

lualoader: fix pruning of non-existent default kernel

Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually

lualoader: fix pruning of non-existent default kernel

Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work. Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).

There's room to improve the error messages here, but for now let's just
make it actually work correctly.

PR: 292232
Fixes: d04415c520b03 ("loader: lua: remove the default kernel [...]")

show more ...


# ebc32e74 28-Sep-2025 Warner Losh <imp@FreeBSD.org>

core.lua: Consistently check for single user

While boot_single:lower() should always be in {yes,no}, it might not
be. In one place we check == yes, and another ~= no. Make both places ~=
no for cons

core.lua: Consistently check for single user

While boot_single:lower() should always be in {yes,no}, it might not
be. In one place we check == yes, and another ~= no. Make both places ~=
no for consistency. We generally try to test != default.

Sponsored by: Netflix

show more ...


# d0d54158 06-Jun-2025 Kyle Evans <kevans@FreeBSD.org>

lualoader: rename loop variable to cleanup luacheck

This shadows an `i` used for indexing earlier in the function, and we
don't care that much about the name.


# 48b05b8f 14-Dec-2024 Kyle Evans <kevans@FreeBSD.org>

loader: set boot_safe when safe mode is selected

This may be used to disable or limit functionality of some services
when safe mode is selected. The particular value of boot_safe should not
be consi

loader: set boot_safe when safe mode is selected

This may be used to disable or limit functionality of some services
when safe mode is selected. The particular value of boot_safe should not
be considered significant, only its presence in the environment.

Reviewed by: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D32172

show more ...


# c2ba66d4 02-Nov-2024 Warner Losh <imp@FreeBSD.org>

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.

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

show more ...


# f4a69a93 18-Sep-2024 Colin Percival <cperciva@FreeBSD.org>

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 sa

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

show more ...


# a2fd7ae8 29-Jul-2024 Warner Losh <imp@FreeBSD.org>

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

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

show more ...


# 522a65a8 29-Jul-2024 Warner Losh <imp@FreeBSD.org>

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
stub

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

show more ...


# ab97d42a 29-Feb-2024 Warner Losh <imp@FreeBSD.org>

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:

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

show more ...


# d04415c5 13-Dec-2023 Kyle Evans <kevans@FreeBSD.org>

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

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
Differential Revision: https://reviews.freebsd.org/D42967

show more ...


# e183039f 08-Dec-2023 Kyle Evans <kevans@FreeBSD.org>

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

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

show more ...


# 1631382c 08-Dec-2023 Kyle Evans <kevans@FreeBSD.org>

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

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
Differential Revision: https://reviews.freebsd.org/D42695

show more ...


# 67d2bd97 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

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.

S

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

show more ...


# 21795c37 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

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.

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

show more ...


# 0abe05ae 21-Nov-2023 Warner Losh <imp@FreeBSD.org>

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

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

show more ...


# e0f3dc82 20-Nov-2023 R. Christian McDonald <rcm@FreeBSD.org>

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

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

show more ...


# 9636a145 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line lua tag

Remove /^--\n--\s*\$FreeBSD\$.*$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

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

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

show more ...


# 5c73b3e0 17-Feb-2022 Colin Percival <cperciva@FreeBSD.org>

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 pl

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

show more ...


# c4dc9072 13-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

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: Beck

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

show more ...


# 5d8c062f 14-Feb-2021 Toomas Soome <tsoome@FreeBSD.org>

loader_lua: consider userboot console as serial

We use ascii box chars with serial console because we do not know
if terminal can draw unixode box chars. Same problem is about userboot
console.

MFC

loader_lua: consider userboot console as serial

We use ascii box chars with serial console because we do not know
if terminal can draw unixode box chars. Same problem is about userboot
console.

MFC after: 5 days

show more ...


# e25ee296 24-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up render

stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

Reviewed-by: cem
MFC-after: 4 days
Differential Revision: https://reviews.freebsd.org/D27542

show more ...


# 3630506b 21-Dec-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: implement framebuffer console

Draw console on efi.
Add vbe framebuffer for BIOS loader (vbe off, vbe on, vbe list,
vbe set xxx).
autoload font (/boot/fonts) based on resolution and font size

loader: implement framebuffer console

Draw console on efi.
Add vbe framebuffer for BIOS loader (vbe off, vbe on, vbe list,
vbe set xxx).
autoload font (/boot/fonts) based on resolution and font size.
Add command loadfont (set font by file) and
variable screen.font (set font by size). Pass loaded font to kernel.

Export variables:
screen.height
screen.width
screen.depth

Add gfx primitives to draw the screen and put png image on the screen.
Rework menu draw to iterate list of consoles to enamble device specific
output.

Probably something else I forgot...

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27420

show more ...


# 94510c29 01-Oct-2020 Kyle Evans <kevans@FreeBSD.org>

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.


1234567891011