<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/stand/lua, branch release/12.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>cli.lua.8: make the command match the code</title>
<updated>2021-09-12T16:33:13+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2021-07-29T02:53:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b9e45d6034f155dc5eba31dbe4b596685d111ad8'/>
<id>b9e45d6034f155dc5eba31dbe4b596685d111ad8</id>
<content type='text'>
It's disable-device, not device-disable

Spotted by:		jrtc27
Sponsored by:		Netflix

(cherry picked from commit 6b51baf6a8de7241a4e1b0c8436d70299cd55270)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's disable-device, not device-disable

Spotted by:		jrtc27
Sponsored by:		Netflix

(cherry picked from commit 6b51baf6a8de7241a4e1b0c8436d70299cd55270)
</pre>
</div>
</content>
</entry>
<entry>
<title>lua loader: Add disable-device to disable a device.</title>
<updated>2021-09-12T16:33:12+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2021-07-28T22:52:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=27eae824152767df7b581f488228fd584b1081a4'/>
<id>27eae824152767df7b581f488228fd584b1081a4</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: use more concise verbiage for autoboot</title>
<updated>2021-09-12T05:39:36+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-09-08T21:34:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=81719aafa86d9aa9ee5efc49689a16547ab7f2af'/>
<id>81719aafa86d9aa9ee5efc49689a16547ab7f2af</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: allow brands to specify a shift</title>
<updated>2021-09-12T05:39:33+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-09-08T21:33:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a0a8e7a89e096bd2567894a06a749e3f3cf658a9'/>
<id>a0a8e7a89e096bd2567894a06a749e3f3cf658a9</id>
<content type='text'>
Some brands will want to specify a shift to make sure they're properly
centered; let it happen.

(cherry picked from commit e19d9a9b6e44e15087a140a26ab3e24b07f6ba56)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some brands will want to specify a shift to make sure they're properly
centered; let it happen.

(cherry picked from commit e19d9a9b6e44e15087a140a26ab3e24b07f6ba56)
</pre>
</div>
</content>
</entry>
<entry>
<title>loader: do not output empty menu title</title>
<updated>2021-09-12T05:39:19+00:00</updated>
<author>
<name>Toomas Soome</name>
<email>tsoome@FreeBSD.org</email>
</author>
<published>2021-04-21T11:42:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18'/>
<id>ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18</id>
<content type='text'>
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 commit 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 commit 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69)
</pre>
</div>
</content>
</entry>
<entry>
<title>loader: insert spaces around menu title</title>
<updated>2021-09-12T05:39:16+00:00</updated>
<author>
<name>Toomas Soome</name>
<email>tsoome@FreeBSD.org</email>
</author>
<published>2021-03-23T05:04:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cdd8bfecd2ffa37ef7508177e0ba9fe87db0251f'/>
<id>cdd8bfecd2ffa37ef7508177e0ba9fe87db0251f</id>
<content type='text'>
Small visual nit, make menu title more clean

(cherry picked from commit 62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small visual nit, make menu title more clean

(cherry picked from commit 62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5)
</pre>
</div>
</content>
</entry>
<entry>
<title>loader_lua: consider userboot console as serial</title>
<updated>2021-09-12T05:39:12+00:00</updated>
<author>
<name>Toomas Soome</name>
<email>tsoome@FreeBSD.org</email>
</author>
<published>2021-02-14T08:28:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=59f99ecf87c6d7446d658aeb70aee0c4c7a9818b'/>
<id>59f99ecf87c6d7446d658aeb70aee0c4c7a9818b</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: position hyphens at the beginning of character classes</title>
<updated>2021-02-03T06:58:24+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-01-31T15:51:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eefddc38243d53a6df41f72c17c65b17d8c46e9c'/>
<id>eefddc38243d53a6df41f72c17c65b17d8c46e9c</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>stand: lua: enhance lfs.dir() to speed up kernels_autodetect</title>
<updated>2021-02-03T06:58:18+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-01-24T01:32:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=32b391d4a99c8c3a52ea1d2c0c82ee3208b77a19'/>
<id>32b391d4a99c8c3a52ea1d2c0c82ee3208b77a19</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: improve loader.conf var processing</title>
<updated>2021-01-31T01:16:12+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-01-24T19:25:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e8a03eb0c4e1fcb94d58d833ab060bef34646470'/>
<id>e8a03eb0c4e1fcb94d58d833ab060bef34646470</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
</feed>
