History log of /freebsd-12.1/stand/lua/core.lua (Results 1 – 25 of 52)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0
# 23601245 15-Sep-2019 Kyle Evans <[email protected]>

MFC r352194: lualoader: Revert to ASCII menu frame for serial console

The box drawing characters we use aren't necessarily safe with a serial
console; for instance, in the report by npn@, these were

MFC r352194: lualoader: Revert to ASCII menu frame for serial console

The box drawing characters we use aren't necessarily safe with a serial
console; for instance, in the report by npn@, these were causing his xterm
to send back a sequence that lua picked up as input and halted the boot.
This is less than ideal.

Fallback to ASCII frames for console with 'comconsole' in it. This is a
partial revert r338108 by imp@ -- instead of removing the menu entirely and
disabling color/cursor sequences, just reverting the default frame to ASCII
is enough to not break in this setup.

show more ...


Revision tags: release/11.3.0, release/12.0.0
# 4c6e112e 01-Nov-2018 Kyle Evans <[email protected]>

MFC r339849: lualoader: Fix try_include error handling

The previous iteration of try_include attempted to be 'friendly' and error()
out if we hit an error that wasn't ENOENT. This was semi-OK, but f

MFC r339849: lualoader: Fix try_include error handling

The previous iteration of try_include attempted to be 'friendly' and error()
out if we hit an error that wasn't ENOENT. This was semi-OK, but fragile as
it relied on pattern matching the error message.

Move the responsibility for handling failure to the caller. Following
a common lua pattern, we'll return the return value of the underlying
require() on success, or false and an error message.

Approved by: re (gjb)

show more ...


# 1613f091 07-Oct-2018 Kyle Evans <[email protected]>

lualoader: Honor boot_* variables at lua init

For non-UEFI systems, boot.config(5) may have -s or -v specified for
single-user and verbose boot respectively. These were not being properly
taken into

lualoader: Honor boot_* variables at lua init

For non-UEFI systems, boot.config(5) may have -s or -v specified for
single-user and verbose boot respectively. These were not being properly
taken into account and reflected in the "Boot Options" submenu. When we
initialize core.lua, we'll record boot_single and boot_verbose as we do ACPI
and consider these the system defaults.

Reported by: David Wolfskill <[email protected]>
Approved by: re (kib)

show more ...


# a5003419 03-Sep-2018 Kyle Evans <[email protected]>

lualoader: Handle comma-separated kernels as well

The format for kernels is documented as being space-delimited, but
forthloader was more lenient on this and so people began to depend on it.

A late

lualoader: Handle comma-separated kernels as well

The format for kernels is documented as being space-delimited, but
forthloader was more lenient on this and so people began to depend on it.

A later pass will be made to document all of the fun features that forthloader
allowed that may not be immediately obvious.

Reported by: mmacy
Approved by: re (kib)

show more ...


# b83a355d 21-Aug-2018 Kyle Evans <[email protected]>

lualoader: Just compare expression directly


# 116c5314 20-Aug-2018 Warner Losh <[email protected]>

Serial console menus for lua.

Remove a bunch of special cases for UEFI and serial consoles. We do
want to do curses and menu things here. This makes us match what we do
in FORTH, with the possible

Serial console menus for lua.

Remove a bunch of special cases for UEFI and serial consoles. We do
want to do curses and menu things here. This makes us match what we do
in FORTH, with the possible exception of boxes around menus.

Differential Revision: https://reviews.freebsd.org/D16816

show more ...


Revision tags: release/11.2.0
# 892b3a52 26-Mar-2018 Kyle Evans <[email protected]>

lualoader: Actually re-raise error in try_include

It was previously only printed, but we do actually want to raise it as a
full blown error so that things don't look OK when they've actually gone
wr

lualoader: Actually re-raise error in try_include

It was previously only printed, but we do actually want to raise it as a
full blown error so that things don't look OK when they've actually gone
wrong.

The second parameter to error, level, is set to 2 here so that the error
message reflects the position of the try_include caller, rather than the
try_include itself. Example:

LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a
nil value (global 'cxcint').

show more ...


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

lualoader: Implement try_include and use it for including the local module

This provides a way to optionally include a module without having to wrap it
in filesystem checks. try_include is a little

lualoader: Implement try_include and use it for including the local module

This provides a way to optionally include a module without having to wrap it
in filesystem checks. try_include is a little more robust, using the lua
search path instead of forcing us to explicitly consider all of the places
we could want to include a module. Errors are still generally raised from
trying to load the module, but ENOENT will not get raised unless we're doing
a verbose load.

This will also be used to split out logo/brand graphics into their own files
so that we can safely scale up the number of graphics included without
worrying about the extra memory consumption- opting to lazily load graphics
instead.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D14658

show more ...


# 5f8cfbe1 21-Mar-2018 Kyle Evans <[email protected]>

UEFI: Ditch console mode setting, choose optimal GOP mode later in boot

boot1 is too early to be deciding a good resolution. Console modes don't map
cleanly/predictably to actual screen resolutions,

UEFI: Ditch console mode setting, choose optimal GOP mode later in boot

boot1 is too early to be deciding a good resolution. Console modes don't map
cleanly/predictably to actual screen resolutions, and GOP does not reflect
the actual screen resolution after a console mode change. Rip it out.

Add an efi-autoresizecons command to loader to choose an optimal screen
resolution based on the current environment. We'll explicitly execute this
later, preferably before we draw anything of value but after we load config
and pick up any tunables we may need to decide where we're going.

This method also allows us to actually pass the correct framebuffer
information on to the kernel.

UGA autoresizing is not implemented because it doesn't have the kind of mode
enumeration that GOP does. If an interested person with relevant hardware
could get in contact, we can take a look at implementing UGA autoresize.

This effectively "fixes" the breakage caused by r327058, but doesn't
actually set the resolution correctly until the interpreter calls
efi-autoresizcons. The lualoader version of this has been included for
reference; the forth equivalent will follow.

Reviewed by: imp (with some hestitation), manu
Differential Revision: https://reviews.freebsd.org/D14788

show more ...


# aea262bf 21-Mar-2018 Kyle Evans <[email protected]>

lualoader: Add primitive hook module, use it to untangle bogus reference

See: comments in the hook module about intended usage, as well as the
introduced use for config.reloaded.

Use the newly intr

lualoader: Add primitive hook module, use it to untangle bogus reference

See: comments in the hook module about intended usage, as well as the
introduced use for config.reloaded.

Use the newly introduced hook module to define a "config.reloaded" hook.
This is currently used to register core's clearKernelCache as a reload hook
to avoid a circular dependency and fix this functionality- it didn't
actually work out, and it isn't immediately obvious how it slipped into src.

Other hook types will be introduced into the core lualoader as useful hook
points are identified.

show more ...


# 35b0c718 09-Mar-2018 Kyle Evans <[email protected]>

lualoader: Cache kernel list

With autodetection turned on, hitting the filesystem everytime we need to
calculate choices for the kernel carousel is kind of slow. Cache once on the
first listing and

lualoader: Cache kernel list

With autodetection turned on, hitting the filesystem everytime we need to
calculate choices for the kernel carousel is kind of slow. Cache once on the
first listing and reload it anytime the config is reloaded in case any of
the loader.conf(5) changes that affect this (kernel, kernels,
kernels_autodetect) have changed. This also picks up the case where we've
changed currdev and the autodetected kernels could change.

show more ...


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

lualoader: Only loadelf before boot/autoboot if no kernel loaded

Back when I "fixed" the loading of kernel/modules to be deferred until
booting, I inadvertently broke the ability to manually load a

lualoader: Only loadelf before boot/autoboot if no kernel loaded

Back when I "fixed" the loading of kernel/modules to be deferred until
booting, I inadvertently broke the ability to manually load a set of kernels
and modules in case of something bad having happened. lualoader would
instead happily load whatever is specified in loader.conf(5) and go about
the boot, leading to a panic loop as you try to rediscover a way to stop the
panicky efirt module from loading and fail miserably.

Reported by: me, sadly

show more ...


# 230061c5 28-Feb-2018 Kyle Evans <[email protected]>

lualoader: Add note that \027 is a decimal representation

We've included an extra '0' in there (which might get removed later, but
it's maintained for the moment for legacy purposes) which oftentime

lualoader: Add note that \027 is a decimal representation

We've included an extra '0' in there (which might get removed later, but
it's maintained for the moment for legacy purposes) which oftentimes
indicate that the following number should be treated as octal. This is not
the case, so note that to prevent future confusion (of myself and others).

show more ...


# 2bb86aef 27-Feb-2018 Kyle Evans <[email protected]>

lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI


# 9937e979 26-Feb-2018 Kyle Evans <[email protected]>

lualoader: Re-work menu skipping bits

This is motivated by a want to reduce heap usage if the menu is being
skipped. Currently, the menu module must be loaded regardless of whether
it's being skippe

lualoader: Re-work menu skipping bits

This is motivated by a want to reduce heap usage if the menu is being
skipped. Currently, the menu module must be loaded regardless of whether
it's being skipped or not, which adds a cool ~50-100KB worth of memory
usage.

Move the menu skip logic out to core (and remove a debug print), then check
in loader.lua if we should be skipping the menu and avoid loading the menu
module entirely if so. This keeps our memory usage below ~115KB for a boot
with the menu stripped.

Also worth noting: with this change, we no longer explicitly invoke autoboot
if we're skipping the menu. Instead, we let the standard loader behavior
apply: try to autoboot if we need to, then drop to a loader prompt if not or
if the autoboot sequence is interrupted. The only thing we still handle
before dropping to the loader autoboot sequence is loadelf(), so that we can
still apply any of our kernel loading behavior.

show more ...


# 04af4229 26-Feb-2018 Kyle Evans <[email protected]>

lualoader: More argument name expansion, part 2

screen also has some instances, but it also has other cleanup to go with it.
Because of this, I will be committing the screen changes separately.


# 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 ...


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

lualoader: shallowCopyTable => deepCopyTable

I called it a shallow copy, but it wasn't really a shallow copy at all.


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

Add copyright notice to core.lua

I've also made some not-insignificant changes/additions to this file, to
include the added constants, ACPI changes, boot environment listing, and
some utility functi

Add copyright notice to core.lua

I've also made some not-insignificant changes/additions to this file, to
include the added constants, ACPI changes, boot environment listing, and
some utility functions.

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 ...


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

lualoader: Consistently use double quotes


# 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 ...


# 3889e6cd 21-Feb-2018 Kyle Evans <[email protected]>

lualoader: Make kernel autodetection contingent on loader.conf(5) var

Instead of based it off of whether 'kernels' was specified, base it off of a
new variable: kernels_autodetect. If set to yes, we

lualoader: Make kernel autodetection contingent on loader.conf(5) var

Instead of based it off of whether 'kernels' was specified, base it off of a
new variable: kernels_autodetect. If set to yes, we'll run the autodetection
bits and add any detected kernels to the already existing list *after* both
'kernel' and 'kernels'.

show more ...


123