aboutsummaryrefslogtreecommitdiff
path: root/stand/lua
Commit message (Collapse)AuthorAgeFilesLines
* loader: Use Cyan instead of Blue for some menu itemsWarner Losh2024-12-281-2/+2
| | | | | | | | | | | BLUE often translates to DARK BLUE. On BLACK this is hard to read. Instead, use CYAN which looks good on both black and white backgrounds. Discussed with: kevans Sponsored by: Netflix (cherry picked from commit baa7e9cd3083ccaed8f26e9ad786ff9657ab85fc)
* loader: Fix 0 vs 1 confusion for column numbersWarner Losh2024-12-282-3/+3
| | | | | | | | | | | | | In two places we use '0' for a column number. However, the upper left hand corner of the screen is 1, 1. Fix those two confusions. Also, fix a comment that flipped the coordinates in a comment (I'm used to the vt100 convention where it's row, column (eg y, x)) and didn't notice the rest of the code uses x, y. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D46777 (cherry picked from commit 604919c47fa4092db08dadd282851afc9cba0a90)
* loader: Use printc instead of print to fit in 24,80Warner Losh2024-12-281-3/+7
| | | | | | | | | | | | | | | | | | | | | print automatically adds a newline, while printc does not. Use printc in preference to print for managing the autoboot message. This means we can use line 24 safely on a 24x80 terminal, restoring some functionality that was lost in 101afbc6ee2f0. Note: we still set the default curosor position to 25,1 in screen.lua, but real VT100s (and successors) will treat any row larger than the pnumber of rows in a cursor motion command to be the last physical row (this is so you can move to 9999,9999 and do a cursor location query to get the size of the screen). Keeping that as is looks better on a typical VGA console. Fixes: 101afbc6ee2f0 Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D46771 (cherry picked from commit 3fb656f8ef21332d96de8097521aaa51ddeb649d)
* loader/menu: tweak for added lineWarner Losh2024-12-282-2/+2
| | | | | | | | | | | I added a line to the menu, but didn't adjust so things were a line off. Make the necessary adjustments. Fixes: 7cb65be96d47 Sponsored by: Netflix MFC After: 3 days (cherry picked from commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c)
* stand: Add "Loader needs updating" to the first menu item"Warner Losh2024-08-011-0/+13
| | | | | | | | | | | | | | | When the boot loader version is too old, add a warning to the boot menu to maybe catch people's attention. Use the correct loader code that adds an inactive highlighted menu item indicating that an update is needed. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45890 (cherry picked from commit 0eac99f76ec31270f902cc2a0ff5ae4b5b606a65) (cherry picked from commit 7cb65be96d47cbe0b740266bc633d272fc4c5e6b)
* stand: Print a warning of the loader is too oldWarner Losh2024-08-012-0/+25
| | | | | | | | | | | 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 (cherry picked from commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c)
* loader: lua: remove the default kernel if it doesn't existKyle Evans2024-01-031-4/+24
| | | | | | | | | | | | | | | | | | 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 (cherry picked from commit d04415c520b031fb8eb93cb252e4acee66149c87)
* loader: provide a features table for binary compatibility advertisementKyle Evans2024-01-032-1/+17
| | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 1631382cf2820245cc72965498ff174bb548dd63)
* stand: lua: module names should permit moreKyle Evans2023-09-111-1/+4
| | | | | | | | | | | | | | | The module entries should generally allow whatever is allowed as an env_var in the pattern table. Notably, we're missing periods which would allow proper entries for .dtb files in loader.conf that don't need to specify a module_name entry for it. %d in this expression is actually redundant as %w is actually "all alphanumerics," but I've included it for now to match the env_var entry. We should really remove it from both. Reported by: "aribi" on the forums via allanjude@ (cherry picked from commit 5bc1e0c2285e73fe8455bb6c72b2b40e33f5477e)
* Remove $FreeBSD$: two-line lua tagWarner Losh2023-08-2315-30/+0
| | | | | | | Remove /^--\n--\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit 9636a14538f5)
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-239-18/+0
| | | | | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit fa9896e082a1)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-2524-24/+24
| | | | | | | | | | | 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 (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* loader: lua: disable autoboot timer after password entryCyrus Rahman2023-04-201-0/+1
| | | | | | | | | | | | | | | | | | In the lua loader, if one sets a password in loader.conf, the autoboot_delay timer will start before the menu is displayed. One can interrupt the autoboot and bring up the menu by entering a keyboard character before the timer expires. If this is done a prompt for the password is displayed. Entering the password will bring up the menu, but the timer will again start and another keyboard character must be entered or autoboot will abort the menu and boot the system. PR: 265472 Reviewed by: kevans MFC after: 3 days (cherry picked from commit 0ab68e9272b573becdb42edf2b4419cb7ab04707)
* loader: lua: unload the kernel when changing BEsCyrus Rahman2023-04-201-0/+3
| | | | | | | | | | | | | Usually the kernel is loaded later, but there are circumstances where it could have been loaded earlier than changing BEs. Unload anything that is already there so that we know we're using artifacts from the proper environment. PR: 265471 Reviewed by: kevans MFC after: 3 days (cherry picked from commit d7584aa09fcf8d96544e5bfb3ea78f50d7720c0c)
* lualoader: Add loader_menu_multi_user_prompt config variableJessica Clarke2023-01-241-4/+13
| | | | | | | | | | | | | | | | | This allows the "Multi user" in "[B]oot Multi user" to be substituted with another string, for example with "Installer" in installer media. Note that this is lua-only at the moment, since loader.4th's menu.rc defines the alternate name as Boot [M]ulti User, unlike lualoader which leaves it as [B]oot Multi user. Ideally loader.4th would adopt the newer and simpler lualoader behaviour and then it could gain support for this option, but loader.4th is on the way out and isn't used by any official installer media so this is not a significant concern. Reviewed by: kevans, rpokala MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36418 (cherry picked from commit 9b17aa27406f3716383e71c6687d53599a8f8d8a)
* luaboot: visible must be a functionWarner Losh2023-01-242-1/+6
| | | | | | Visible needs to be a function. Looks like I tested the wrong thing. (cherry picked from commit 556e66b7b0763d36ddf5af98d06a1a13090bb729)
* loader: create a generic vendor sub-menu place holderWarner Losh2023-01-242-10/+78
| | | | | | | | | | | | | | Add a dummy vendor menu entry on the main welcome menu. Vendors can override this in their local.lua file to create whatever sub-menu they need for their products. Also fix the adding a 'welcome' entry as well based on a suggestion from Kyle. Silly option menu code also from Kyle. They seem to work for me, but any transcription error is likely mine. Reviewed by: kevans@ (the vendor stuff) (cherry picked from commit e7ccd5b4187d15cd91697f1f4e12cf40e3ce86c3)
* Add support for getting early entropy from UEFIColin Percival2022-03-111-0/+10
| | | | | | | | | | | | | | | | | 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) Differential Revision: https://reviews.freebsd.org/D20780
* lualoader: fix the autoboot_delay countdown messageKatsuyuki Miyoshi2022-03-091-1/+1
| | | | | | | | | | When the timer drops from double to single digits, a spare 'e' is left on the end of the line as we don't overwrite it. Include an extra space at the end to account for this and overwrite the leftover character. PR: 259429 (cherry picked from commit bb4c691299c5d699cea29e18fef96bda1cef13da)
* loader: lua: test that /boot exists firstEmmanuel Vadot2022-01-131-0/+7
| | | | | | | | | | | | 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 (cherry picked from commit c4dc907254a4275d8f3ecd9a6b615c6e2a2438e9)
* cli.lua.8: make the command match the codeWarner Losh2021-09-121-2/+2
| | | | | | | | | It's disable-device, not device-disable Spotted by: jrtc27 Sponsored by: Netflix (cherry picked from commit 6b51baf6a8de7241a4e1b0c8436d70299cd55270)
* lua loader: Add disable-device to disable a device.Warner Losh2021-09-122-2/+23
| | | | | | | | | | | disable-device fooX will set hint.foo.X.disabled=1 as a way to easily disable a device attaching during boot. Reviewed by: tsoome Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31297 (cherry picked from commit 07c4b78d0a1d26b6441cf3e52b917f20c932b9d0)
* lualoader: use more concise verbiage for autobootKyle Evans2021-09-121-2/+1
| | | | | | | | | | | | The behavior remains the same, but lualoader now uses the more concise verbiage that forthloader used. This is particularly important because the previous line would exceed the right boundary of the menu and run straight into space that would typically be allowed for the logo. This makes it slightly easier to port logos from forthloader to lualoader. (cherry picked from commit ed107537b43cabf7a18e73a17856a9d9e170c6e9)
* lualoader: allow brands to specify a shiftKyle Evans2021-09-121-0/+5
| | | | | | | Some brands will want to specify a shift to make sure they're properly centered; let it happen. (cherry picked from commit e19d9a9b6e44e15087a140a26ab3e24b07f6ba56)
* lualoader: remove shadowed local from graphics:drawitem()Kyle Evans2021-09-121-1/+0
| | | | | | | for loop vars are local already and distinct from this earlier declaration; remove it. (cherry picked from commit 763bcebe0b6d5e53e5c8940a677de662e5652b6d)
* loader: do not output empty menu titleToomas Soome2021-04-281-1/+4
| | | | | | | | | | | As we output spaces around the menu title, we should also check, if the title is actually empty string. PR: 255299 Submitted by: Jose Luis Duran Reported by: Jose Luis Duran (cherry picked from 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69)
* loader: insert spaces around menu titleToomas Soome2021-04-031-2/+2
| | | | | | Small visual nit, make menu title more clean (cherry picked from 62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5)
* loader_lua: consider userboot console as serialToomas Soome2021-02-211-1/+4
| | | | | | | | 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. (cherry picked from commit 5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8)
* loader: remove BORDER_PIXELSToomas Soome2021-02-151-1/+1
| | | | | | | | | | BORDER_PIXELS is left over from picking up the source from illumos port. Since FreeBSD VT does not use border in terminal size calculation, there is no reason why should loader use it. MFC after: 1 week (cherry picke from commit 96bef2053a87c8d01ce08ea88857e4657489c8e7)
* lualoader: position hyphens at the beginning of character classesKyle Evans2021-02-031-4/+4
| | | | | | | | | | According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction between ranges and classes is not defined and hyphens must be specified at either the beginning or the end of a set if they are not escaped. Move all such occurrences to the beginning. (cherry picked from commit b24872cf7b13314669ed2136c0262bb2eb007695)
* stand: lua: enhance lfs.dir() to speed up kernels_autodetectKyle Evans2021-02-031-2/+6
| | | | | | | | | | | | | | 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. (cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb)
* lualoader: improve loader.conf var processingKyle Evans2021-01-291-22/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lualoader was previously not processing \ as escapes; this commit fixes that and does better error checking on the value as well. Additionally, loader.conf had some odd restrictions on values that make little sense. Previously, lines like: kernel=foo Would simply be discarded with a malformed line complaint you might not see unless you disable beastie. lualoader tries to process these as well as it can and manipulates the environment, while forthloader did minimal processing and constructed a `set` command to do the heavy lifting instead. The lua approach was re-envisioned from building a `set` command so that we can appropriately reset the environment when, for example, boot environments change. Lift the previous restrictions to allow unquoted values on the right hand side of an expression. Note that an unquoted value is effectively: [A-Za-z0-9-][A-Za-z0-9-_.]* This commit also stops trying to weirdly limit what it can handle in a quoted value. Previously it only allowed spaces, alphanumeric, and punctuation, which is kind of weird. Change it here to grab as much as it can between two sets of quotes, then let processEnvVar() do the needful and complain if it finds something malformed looking. My extremely sophisticated test suite is as follows: <<EOF X_01_simple_string="simple" X_02_escaped_string="s\imple" X_03_unquoted_val=3 X_04_unquoted_strval=simple_test X_05_subval="${X_03_unquoted_val}" X_06_escaped_subval="\${X_03_unquoted_val}" X_07_embedded="truth${X_03_unquoted_val}" X_08_escaped_embedded="truth\${X_03_unquoted_val}" X_09_unknown="${unknown_val}" X_10_unknown_embedded="truth${unknown_val}" X_11_crunchy="crunch$unknown_val crunch" X_12_crunchy="crunch${unknown_val}crunch" Y_01_badquote="te"lol" Y_02_eolesc="lol\" Y_02_noteolesc="lol\\" Y_03_eolvar="lol$" Y_03_noteolvar="lol\$" Y_04_badvar="lol${" exec="echo Done!" EOF Future work may provide a stub loader module in userland so that we can formally test the loader scripts rather than sketchy setups like the above in conjunction with the lua-* tools in ^/tools/boot. (cherry picked from commit 576562856efbec31520aca6a1f72f2b11298e9a7)
* lualoader: use floor division to get correct typeKyle Evans2021-01-151-1/+1
| | | | | | | | | | | | | | | | | This fixes the positioning of the "Welcome to FreeBSD" heading, which was misplaced after the recent update to Lua 5.4. The issue was previously masked by a compatibility knob in Lua 5.3 that would cause float-tagged numbers to render faithfully without the decimal component. Lua 5.4 dropped that and ensures that it always prints a decimal component, even if it has to append a ".0" to the value. Standard division produces a "float", floor division (//) can be used to guarantee an integer. Floating point operations have been completely ripped out of the liblua compiled for the bootloader, so this is a nop. This is decidedly better than trying to hack out the float tag entirely. Reported-by: mjg, probably others MFC-after: 3 days
* loader: implement framebuffer consoleToomas Soome2021-01-024-7/+73
| | | | | | | | | | | | | | | | | | | | | | | 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
* lualoader: add loader_conf_dirs support (loader.conf.d)Kyle Evans2020-12-311-0/+24
| | | | | | | | | | | | | | | | | | loader_conf_dirs is the supporting mechanism for the included /boot/loader.conf.d directory. When lualoader finishes processing all of the loader_conf_files it finds after walking /boot/defaults/loader.conf, it will now check any and all loader_conf_dirs and process files ending in ".conf" as if they were a loader.conf. Note that loader_conf_files may be specified in a loader.conf.d config file, but loader_conf_dirs may *not*. It will only be processed as specified in /boot/defaults/loader.conf and any loader_conf_files that were loaded from there. Reviewed by: allanjude, freqlabs, rpokala, tsoome Includes suggestion from: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25608
* lualoader: fix lua-lint runKyle Evans2020-12-171-1/+1
| | | | | | | | | | | luacheck rightfully complains that i is unused in the show-module-options loop at the end (it was used for some debugging in the process). We've added a new pager module that's compiled in, so declare that as an acceptable global. Notes: svn path=/head/; revision=368729
* lualoader: cli: provide a show-module-options loader commandKyle Evans2020-12-174-2/+91
| | | | | | | | | | | | | This effectively dumps everything lualoader knows about to the console using the libsa pager; that particular lua interface was added in r368591. A pager stub implementation has been added that just dumps the output as-is as a compat shim for older loader binaries that do not have lpager. This stub should be moved into a more appropriate .lua file if we add anything else that needs the pager. Notes: svn path=/head/; revision=368728
* lualoader: config: fix module enabled checkKyle Evans2020-12-121-1/+1
| | | | | | | | A last minute rewrite left this logically wrong; if it's present in modules_blacklist, then we do not load it. Notes: svn path=/head/; revision=368579
* lualoader: provide module-manipulation commandsKyle Evans2020-12-124-10/+129
| | | | | | | | | | | | | | | | | | Specifically, we have: - enable-module - disable-module - toggle-module These can be used to add/remove modules to be loaded or force modules to be loaded in spite of modules_blacklist. In the typical case, a user is expected to use them to recover an issue happening due to a module directive they've added to their loader.conf or because they discover that they've under-specified what to load. MFC after: 1 week Notes: svn path=/head/; revision=368575
* lualoader: improve the design of the brand-/logo- mechanismKyle Evans2020-10-047-138/+171
| | | | | | | | | | | | | | | | | | | | | | | | In the previous world order, any brand/logo was forced to pull in the drawer and call drawer.add{Brand,Logo} with the name their brand/logo is taking and a table describing it. In the new world order, these files just need to return a table that maps out graphics types to a table of the exact same format as what was previously being passed back into the drawer. The appeal here is not needing to grab a reference back to the drawer module and having a cleaner data-driven looking format for these. The format has been renamed to 'gfx-*' prefixes and each one can provide a logo and a brand. drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as there's no overhead to them and it's not yet worth the break in compatibility with any pre-existing brands and logos. Reviewed by: freqlabs MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24966 Notes: svn path=/head/; revision=366435
* lualoader: clear up some luacheck warningsKyle Evans2020-10-013-4/+4
| | | | | | | | | | | - One (1) unused argument - One (1) trailing whitespace - Two (2) "non-standard global" (curenv, rewind) tools/boot/lua-lint.sh is once again happy. Notes: svn path=/head/; revision=366314
* Report the kernel console on the boot screenWarner Losh2020-09-282-0/+45
| | | | | | | | | | | | | | | | | | | | | | | Report what console the boot loader is telling the kernel to use: o Dual (Serial Primary) o Dual (Video Primary) o Serial o Video This allows the user to interrupt the boot and tweak the cosnole, if needed, in a trivial way. Useful for installs where the default selected may not be quite what you want, or when you are running a dual setup and need to toggle over to the other console being primary. The 'c'/'C' keys will do the cycling through the consoles. Note: you'll still have to drop into the loader to set details about serial consoles. And this doesn't change the console the loader is using. Reviewed by: kevans@ MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D26573 Notes: svn path=/head/; revision=366228
* loader: zfs should support bootonce an nextbootToomas Soome2020-09-211-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootonce feature is temporary, one time boot, activated by "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag. By default, the bootonce setting is reset on attempt to boot and the next boot will use previously active BE. By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will be set permanently active. bootonce dataset name is recorded in boot pool labels, bootenv area. in case of nextboot, the nextboot_enable boolean variable is recorded in freebsd:nvstore nvlist, also stored in boot pool label bootenv area. On boot, the loader will process /boot/nextboot.conf if nextboot_enable is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf processing on next boot. bootonce and nextboot features are usable in both UEFI and BIOS boot. To use bootonce/nextboot features, the boot loader needs to be updated on disk; if loader.efi is stored on ESP, then ESP needs to be updated and for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated (gpart or other tools). At this time, only lua loader is updated. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25512 Notes: svn path=/head/; revision=365938
* zfs: add an option to the bootloader to rewind the ZFS checkpointMariusz Zaborski2020-08-182-3/+74
| | | | | | | | | | | | | | | | | | The checkpoints are another way of keeping the state of ZFS. During the rewind, the pool has to be exported. This makes checkpoints unusable when using ZFS as root. Add the option to rewind the ZFS checkpoint at the boot time. If checkpoint exists, a new option for rewinding a checkpoint will appear in the bootloader menu. We fully support boot environments. If the rewind option is selected, the boot loader will show a list of boot environments that existed before the checkpoint. Reviewed by: tsoome, allanjude, kevans (ok with high-level overview) Differential Revision: https://reviews.freebsd.org/D24920 Notes: svn path=/head/; revision=364355
* lualoader: improve drawer error handlingKyle Evans2020-06-011-0/+8
| | | | | | | | | | | | | | | At least one user has landed in a scenario where logo files appear to be misnamed, and we failed to find them. Our fallback for missing logodefs is orb/orbbw, based on the color status. In a scenario where we can't locate the logos, though, this is not ideal. Add in one more layer of fallback to properly just don't draw any logo if the fan has been jam packed with foreign material. PR: 246046 MFC after: 3 days Notes: svn path=/head/; revision=361709
* lualoader: config: improve readConfFiles, rename to readConfKyle Evans2020-04-303-46/+47
| | | | | | | | | | | | | | | | | | | | | | The previous interface was pretty bad, and required the caller to get some implementation details correct that it really shouldn't need to (e.g. loader_conf_files handling) and pass in an empty table for it to use. The new and much improved interface, readConf, is much less of a hack; hiding these implementation details and just doing the right thing. config.lua will now use it to process /boot/defaults/loader.conf and the subsequent loader_conf_files from there, and read-conf will also use it. This improvement submitted by Olivier (cited below), loader_conf_files handling from the original patch was changed to just clobber it before processing and not bother restoring it after the fact following r360505 where it's now guaranteed to evade the loader environment. PR: 244640 Submitted by: Olivier Certner (olivier freebsd free fr> Notes: svn path=/head/; revision=360506
* lualoader: config: add a table for restricted environment varsKyle Evans2020-04-301-5/+33
| | | | | | | | | | | | | | | | | This new table should be used for transient values that don't need to end up in the loader environment. Generally, these will be things that are internal details that really aren't needed or interesting outside of the config module (e.g. if we changed how ${module}_* directives work, they might use this instead). To start, populate it with loader_conf_files. Any specific value of loader_conf_files isn't all that interesting; if we're going to export it, we should really instead export a loader_conf_files that indicates all of the configuration files we processed. This will be used to reduce bookkeeping overhead in a future commit that cleans up readConfFiles. Notes: svn path=/head/; revision=360505
* config.lua(8): catch up to recently added hooksKyle Evans2020-04-281-2/+4
| | | | | | | | | While we're here, let's stylize these as functions instead of just raw text. A future change may allow arbitrary data arguments to be passed some of these, and the distinction is useful. Notes: svn path=/head/; revision=360427
* config.lua(8): "may should" is not proper grammarKyle Evans2020-04-281-1/+1
| | | | | | | | Reported by: rpokala X-MFC-With: r360421 Notes: svn path=/head/; revision=360425