History log of /freebsd/stand/lua/core.lua (Results 51 – 75 of 85)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 9ed6f9ef 23-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

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 <kevans@FreeBSD.org>

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 <kevans@FreeBSD.org>

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 <kevans@FreeBSD.org>

Add SPDX tags to lua files


# e2df27e3 22-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

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 <kevans@FreeBSD.org>

lualoader: Consistently use double quotes


# e37f4622 22-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

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 <kevans@FreeBSD.org>

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


# 7efc058f 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Add boot environment support

This looks a little bit differently than the forth version for the time
being, just to get off the ground- rather than a paging system, it's
implemented as a

lualoader: Add boot environment support

This looks a little bit differently than the forth version for the time
being, just to get off the ground- rather than a paging system, it's
implemented as a simple carousel like the kernel selector.

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

show more ...


# 3f4eb56b 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Don't autodetect kernels if 'kernels' is explicitly set


# 1d38e553 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Return only argstr if with_kernel not requested


# 49550489 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Drop explicit boolean tests; b or not b


# 9f71d421 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Drop excessive parenthesizing

This was also a convenience convention (for me) that is not very lua-tic.
Drop it.

I've maintained some parentheses where I'd prefer them, for example,
'if

lualoader: Drop excessive parenthesizing

This was also a convenience convention (for me) that is not very lua-tic.
Drop it.

I've maintained some parentheses where I'd prefer them, for example,
'if x or y or (z and w) then', but these situations are far and few between.

show more ...


# aedd6be5 21-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Drop terminating semicolons

This was previously chosen out of convenience, as we had a mixed style and
needed to be consistent. I started learning Lua on Friday, so I switched
everything

lualoader: Drop terminating semicolons

This was previously chosen out of convenience, as we had a mixed style and
needed to be consistent. I started learning Lua on Friday, so I switched
everything over. It is not a very lua-nic convention, though, so drop it.

Excessive parenthesizing around conditionals is next on the chopping block.

show more ...


# 6d3bcc06 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Intercept the 'autoboot' cli command


# f0cb3b6b 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Intercept boot cli command

This should be functional and roughly equivalent to the Forth version.

Stop doing a loadelf() on menu exit now that we can DTRT with boot
invocations. autoboot

lualoader: Intercept boot cli command

This should be functional and roughly equivalent to the Forth version.

Stop doing a loadelf() on menu exit now that we can DTRT with boot
invocations. autoboot interception will follow not long after.

show more ...


# 6d4ed94d 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Prepare for interception of "boot" CLI cmd

core.boot and core.autoboot may both take arguments; add a helper to cleanly
append an argstring to the given loader command.

Also provide a po

lualoader: Prepare for interception of "boot" CLI cmd

core.boot and core.autoboot may both take arguments; add a helper to cleanly
append an argstring to the given loader command.

Also provide a popFrontTable() that we'll use pop the command name off of an
argv table. We don't have the table library included, and including it is
non-trivial, so we'll implement this one function that we need in lua for
the time being.

show more ...


# c1ab36f5 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

lualoader: Ignore ACPI bits on !i386


# b5746545 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Consistently organize modules

We follow pretty closely the following structure of a module:

1. Copyright notice
2. Module requires
3. Module local declarations
4. Module local definition

stand/lua: Consistently organize modules

We follow pretty closely the following structure of a module:

1. Copyright notice
2. Module requires
3. Module local declarations
4. Module local definitions
5. Module exports
6. return

Re-organize the one-offs (config/drawer) and denote the start of module
exports with a comment.

show more ...


# 6f412147 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Don't set ACPI off just because we can't detect it.

This should unbreak EFI/!i386 cases.

Reported by: Peter Lei <peter.lei@ieee.org>


# 5c1b5165 19-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Change boot menu items' names when swapped

[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for t

stand/lua: Change boot menu items' names when swapped

[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for this
purpose for ultimate flexibility if we change our minds later. When we're
booting single user, make a shallow copy of the menu that we'd normally
display and swap the items and their name functions to use alternate_name
instead. Toggling single user in the options menu and going back to the main
menu will now correctly reflect the current boot setting with the first two
menu options and "[Enter]" will always be on the right one.

This shallow copy technique has the chance of being quite slow since it's
done on every redraw, but in my testing it does not seem to make any obvious
difference.

shallowCopyTable could likely belong better in a general-purpose utility
module, but this (and the key constnats) are the only candidates we have at
the moment so we'll drop it into our core stuff for the moment and consider
re-organization at a later date.

show more ...


# e07fc39c 19-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Add core.isSingleUserBoot


# b140d14b 19-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Rename bootserial for clarity


# fa4a2394 19-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Defer kernel/module loading until boot or menu escape

Loading the kernel and modules can be really slow. Loading before the menu
draws and every time one changes kernel/boot environment i

stand/lua: Defer kernel/module loading until boot or menu escape

Loading the kernel and modules can be really slow. Loading before the menu
draws and every time one changes kernel/boot environment is even more
painful.

Defer loading until we either boot, auto-boot, or escape to loader prompt.
We still need to deal with configuration changes as the boot environment
changes, but this is generally much quicker.

This commit strips all ELF loading out of config.load/config.reload so that
these are purely for configuration. config.loadelf has been created to deal
with kernel/module loads. Unloading logic has been ripped out, as we won't
need to deal with it in the menu anymore.

Discussed in part with: allanjude

show more ...


# a108046f 18-Feb-2018 Conrad Meyer <cem@FreeBSD.org>

lua loader: Auto detect eligible list of kernels to boot

Reviewed by: imp, kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14419


1234