<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/stand/lua/config.lua, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F13</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F13'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-09-11T22:02:38Z</updated>
<entry>
<title>stand: lua: module names should permit more</title>
<updated>2023-09-11T22:02:38Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2023-09-05T02:21:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=babfcc0aa66256ffa5142a621ee9eba67d564efb'/>
<id>urn:sha1:babfcc0aa66256ffa5142a621ee9eba67d564efb</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line lua tag</title>
<updated>2023-08-23T17:43:33Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:32:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a7385d2a904a5e7d8cde296faf9f0b399f318cdb'/>
<id>urn:sha1:a7385d2a904a5e7d8cde296faf9f0b399f318cdb</id>
<content type='text'>
Remove /^--\n--\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 9636a14538f5)
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-07-25T15:13:49Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=caa41f641755c935b036e17440a3b49329c904ed'/>
<id>urn:sha1:caa41f641755c935b036e17440a3b49329c904ed</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>lualoader: position hyphens at the beginning of character classes</title>
<updated>2021-02-03T06:55:51Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-01-31T15:51:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e3cd8246c756e568956da1ad8e90e1983d9af89f'/>
<id>urn:sha1:e3cd8246c756e568956da1ad8e90e1983d9af89f</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>lualoader: improve loader.conf var processing</title>
<updated>2021-01-29T05:26:30Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-01-24T19:25:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=633f82126b28d6c44beae579a7f71eb85ca1453c'/>
<id>urn:sha1:633f82126b28d6c44beae579a7f71eb85ca1453c</id>
<content type='text'>
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:

&lt;&lt;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)
</content>
</entry>
<entry>
<title>lualoader: add loader_conf_dirs support (loader.conf.d)</title>
<updated>2020-12-31T16:37:05Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-07-10T01:50:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=72cf7db3aaf17db412183886f19320e5074dc8b7'/>
<id>urn:sha1:72cf7db3aaf17db412183886f19320e5074dc8b7</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>lualoader: cli: provide a show-module-options loader command</title>
<updated>2020-12-17T18:24:36Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-12-17T18:24:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7ed84fa14b00cdacfe9b43019cba7a14b33af352'/>
<id>urn:sha1:7ed84fa14b00cdacfe9b43019cba7a14b33af352</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>lualoader: config: fix module enabled check</title>
<updated>2020-12-12T14:53:34Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-12-12T14:53:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=10aeb6cdab8fb09e2cc3ee2d8b2c68c395481c23'/>
<id>urn:sha1:10aeb6cdab8fb09e2cc3ee2d8b2c68c395481c23</id>
<content type='text'>
A last minute rewrite left this logically wrong; if it's present in
modules_blacklist, then we do not load it.
</content>
</entry>
<entry>
<title>lualoader: provide module-manipulation commands</title>
<updated>2020-12-12T05:57:42Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-12-12T05:57:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4634bb1f4052ff5f1c0a423fd8cce11396ca7fd2'/>
<id>urn:sha1:4634bb1f4052ff5f1c0a423fd8cce11396ca7fd2</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>loader: zfs should support bootonce an nextboot</title>
<updated>2020-09-21T09:01:10Z</updated>
<author>
<name>Toomas Soome</name>
<email>tsoome@FreeBSD.org</email>
</author>
<published>2020-09-21T09:01:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e307eb94ae520d98dc1d346a0c53667a41beab5d'/>
<id>urn:sha1:e307eb94ae520d98dc1d346a0c53667a41beab5d</id>
<content type='text'>
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
</content>
</entry>
</feed>
