#
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 ...
|
#
e15abd1f |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Consistently declare local functions at module scope
Declare these adjacent to the local definitions at the top of the module, and make sure they're actually declared local to pollute glo
stand/lua: Consistently declare local functions at module scope
Declare these adjacent to the local definitions at the top of the module, and make sure they're actually declared local to pollute global namespace a little bit less.
show more ...
|
#
699578a6 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Insert helpful comment for drawer.branddefs
|
#
df74a61f |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Stick a copyright notice on drawer.lua
|
#
752b2d40 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Use 'graphic' instead of 'logo' for table depicting graphics
This is a more sensible name that offers less redundancy when referring to it (vs. logodef.logo). Switch to it while the getti
stand/lua: Use 'graphic' instead of 'logo' for table depicting graphics
This is a more sensible name that offers less redundancy when referring to it (vs. logodef.logo). Switch to it while the getting is good.
show more ...
|
#
29aa5794 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Refactor brands into drawer.branddefs
|
#
bb26c57d |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Refactor logos into drawer.logodefs table
This refactor makes it straightforward to add new logos for drawing and organizes logo definitions in a logical manner.
The graphic to be drawn
stand/lua: Refactor logos into drawer.logodefs table
This refactor makes it straightforward to add new logos for drawing and organizes logo definitions in a logical manner.
The graphic to be drawn for each logo may again be modified outside of drawer, but it must be done on a case-by-case basis as a modification to the loader_logo.
show more ...
|
#
02122e53 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Reduce exposure of the drawer module
As part of an effort to slowly reduce our exports overall to a set of stable properties/functions, go ahead and reduce what drawer exposes to others.
stand/lua: Reduce exposure of the drawer module
As part of an effort to slowly reduce our exports overall to a set of stable properties/functions, go ahead and reduce what drawer exposes to others.
The graphics should generally not be modified on their own, but their position could be modified if additional grahics also need to be drawn. Export position/shift information, but leave the actual graphic local to the module.
The next step will be to create a 'menudef' that gets exported instead, with each entry in the menudef table describing the graphic to be drawn along with specific positioning information.
show more ...
|
#
da56fe38 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Move drawer.menu_name_handlers further up
As a good candidate for modification, move this table further up in the module to improve visibility.
|
#
2413c411 |
| 20-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Add and use drawer.menu_name_handlers
Pull out specialized naming behavior into drawer.menu_name_handlers. This is currently only needed for the carousel entry, where naming is based on t
stand/lua: Add and use drawer.menu_name_handlers
Pull out specialized naming behavior into drawer.menu_name_handlers. This is currently only needed for the carousel entry, where naming is based on the current choice and the menu item purposefully does not store this state.
The setup was designed so that every type can have a special name handler, and the default action is to simply use the result of entry.name().
show more ...
|
#
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
|
#
2e716cec |
| 19-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Call menu_entries if it's a function
If we've fetched menu.entries and it turns out it's a function, call it to get the actual menu entries.
This will be used to swap multi-/single- user
stand/lua: Call menu_entries if it's a function
If we've fetched menu.entries and it turns out it's a function, call it to get the actual menu entries.
This will be used to swap multi-/single- user boot options if we're booting single user by default (boot_single="YES" in loader.conf(5)). It can also be used fairly easily for other non-standard situations.
show more ...
|
#
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 ...
|
#
ddb76e07 |
| 19-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Addres style.lua(9) concern
|
#
4a4fb4f8 |
| 19-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Allow menu items to be conditionally (in)visible
This will be used to conditionally show/hide the boot environment menu.
|
#
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 ...
|
#
a7cf0562 |
| 16-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Create/use some MENU_ constants where applicable
|
#
ada26c4a |
| 16-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Create a "carousel" menu entry type
This is a pre-cursor to boot environment support in lualoader. Create a new menu item type, "carousel_entry", that generally provides a callback to get
stand/lua: Create a "carousel" menu entry type
This is a pre-cursor to boot environment support in lualoader. Create a new menu item type, "carousel_entry", that generally provides a callback to get the list of items, a carousel_id for storing the current value, and the standard name/func functions that an entry has.
The difference between this and a normal menu item, functionally, is that selecting a carousel item will automatically rotate through available items and wrap back at the beginning when the list is exhausted.
The 'name' function takes the choice index, current choice, and the list of choices as parameters so that the menu item can decorate the name freely as desired.
The 'func' function takes the current choice as a parameter, so it can act accordingly.
The kernel menu item has been rewritten to use the carousel_entry type as both an example and initial test of its functionality before it is used for boot environment options.
show more ...
|
#
196ba166 |
| 16-Feb-2018 |
Kyle Evans <kevans@FreeBSD.org> |
stand/lua: Allow menu items to not have explicit aliases
This will generally be used for cases like "Back to main menu" that already have global aliases installed.
|
#
088b4f5f |
| 12-Feb-2018 |
Warner Losh <imp@FreeBSD.org> |
Add the lua scripts from the lua-bootloader SoC
These are the .lua files from from Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also contributed.
Obtain
Add the lua scripts from the lua-bootloader SoC
These are the .lua files from from Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also contributed.
Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code
Improve the SoC lua menu code to bring it in line with forth menu functionality
Submitted by: Zakary Nafziger Sponsored by: FreeBSD Foundation
Use loader.setenv and loader.unsetenv instead of loader.perform
Convert from include("/boot/foo.lua") to foo = require("foo"); to bring in line with latest lua module conventions.
Enforce a uniform style for the new .lua files: o hard tab indenation for 8 spaces o don't have if foo then bar; else bas; end on one line
MFC After: 1 month Relnotes: yes Differential Review: https://reviews.freebsd.org/D14295
show more ...
|