History log of /freebsd/stand/lua/menu.lua (Results 76 – 100 of 110)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8d415029 20-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Extract menu handlers out into menu.handlers table

This is a bit cleaner than our former method of an if ... else chain of
handlers. Store handlers in the menu.handlers table so that they

stand/lua: Extract menu handlers out into menu.handlers table

This is a bit cleaner than our former method of an if ... else chain of
handlers. Store handlers in the menu.handlers table so that they may be
added to or removed dynamically.

All handlers take the current menu and selected entry as parameters, and
their return value indicates whether the menu processor should continue or
not. An omitted return value or 'true' will indicate that we should
continue, while returning 'false' will indicate that we should exit the
current menu.

The omitted return value behavior is due to continuing the loop being the
more common situation.

show more ...


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

stand/lua: Wrap tuple assignment earlier for readability


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

stand/lua: Cache swapped menu, and don't create locals for swapping

Building the swapped welcome menu (first two items swapped) is kind of a
sluggish, because it requires a full (recrusive) shallow

stand/lua: Cache swapped menu, and don't create locals for swapping

Building the swapped welcome menu (first two items swapped) is kind of a
sluggish, because it requires a full (recrusive) shallow copy of the welcome
menu. Cache the result of that and re-use it later, instead of building it
everytime.

While here, don't create temporary locals just for swapping. The following
is just as good:

x, y = y, x;

Reported by: Alexander Nasonov <alnsn@yandex.ru> (swapping)

show more ...


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

stand/lua: Add copyright notice in places

I've made some not-insignificant changes to config, menu, and password bits
of our lua scripts. Add a copyright notice to them to reflect.


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

stand/lua: Re-order locals after copyright notice; require comes first


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

stand/lua: Round up some more style.lua(9) concerns


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


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

stand/lua: Re-wrap menu.lua now that I've added indentation...


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

stand/lua: Swap single-/multi- user boot entries as needed


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

stand/lua: Store menu entries in an "entries" table

Instead of directly listing them in menu.welcome and menu.boot_options,
store them at menu.welcome.entries and welcome.boot_options.entries.

This

stand/lua: Store menu entries in an "entries" table

Instead of directly listing them in menu.welcome and menu.boot_options,
store them at menu.welcome.entries and welcome.boot_options.entries.

This will come into play later when we need to re-order the welcome menu if
boot_single is specified.

show more ...


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

stand/lua: Remove some unused local declarations

Menus are actually defined as entries in the 'menu' table. These local
declarations have not been used in the history of our in-tree lua scripts,
so

stand/lua: Remove some unused local declarations

Menus are actually defined as entries in the 'menu' table. These local
declarations have not been used in the history of our in-tree lua scripts,
so give them the boot.

show more ...


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

stand/lua: Menu style.lua(9) nits


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


# 24a1bd54 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Style pass

These are the style points that I'd like to try and maintain in our lua
scripts:
- Parentheses around conditionals
- Trailing semicolons, except on block terminators
- s:method

stand/lua: Style pass

These are the style points that I'd like to try and maintain in our lua
scripts:
- Parentheses around conditionals
- Trailing semicolons, except on block terminators
- s:method(...) instead of string.method(s, ...) where applicable

There's likely more, but that'll get hammered out as we continue.

show more ...


# bcf48a15 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Color non-default kernels blue


# 702b460d 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Correct interpretation of autoboot_delay

autoboot_delay=NO is documented to wait for input and *not* autoboot, which
is the exact opposite of the current behavior.

Additionally, autoboot

stand/lua: Correct interpretation of autoboot_delay

autoboot_delay=NO is documented to wait for input and *not* autoboot, which
is the exact opposite of the current behavior.

Additionally, autoboot_delay=-1 is documented to disallow the user from
interrupting the boot (i.e. autoboot immediately), which was not previously
honored.

This also fixes the case insensitive comparison to be truly case
insensitive. This is kind of nit-picky, but the previous version would only
accept "no" and "NO".

show more ...


# 3a0a07d0 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Enable menu autoboot; it seems to work


# afa61e1c 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence

We'll set it later if "Escape to loader prompt" is actually chosen, there's
no need to be setting it here.


# 5d1e2f83 17-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name

We have no need for the index yet, but add it anyways to keep signatures
consistent.


# 84f82e46 16-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Don't reload kernel config if we only have one kernel

Don't move this into config.reload because we may want to force reloads if
/boot changes out from under us later.

As a caution: chan

stand/lua: Don't reload kernel config if we only have one kernel

Don't move this into config.reload because we may want to force reloads if
/boot changes out from under us later.

As a caution: changing kernels in lualoader at the moment might not be
loading all of your modules (in my testing, at least) from loader.conf(5).
This is a known problem.

show more ...


# aefcaa7e 16-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Don't try to divide by 0; do nothing


# ef625845 16-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Allow MENU_RETURN items to have a func, fix escape to prompt


# 1504bce3 16-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys


# a7cf0562 16-Feb-2018 Kyle Evans <kevans@FreeBSD.org>

stand/lua: Create/use some MENU_ constants where applicable


12345