Summary: | Lua-based loader(8) does not pick up /boot/loader.rc.local | ||
---|---|---|---|
Product: | Base System | Reporter: | Alexey Dokuchaev <danfe> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed Works As Intended | ||
Severity: | Affects Some People | CC: | emaste, eric, freebsd, grahamperrin, imp, kevans |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Alexey Dokuchaev
2019-01-18 11:10:27 UTC
(In reply to Alexey Dokuchaev from comment #0) Hi, Indeed, because reading loader.rc.local is a little bit of a rabbit hole. We could try to have some limited support by trying to process loader.rc.local as a series of loader commands, but the file is historically parsed as 4th so we can't claim to completely support it. The loader-independent way to do this is probably best done with the `exec` loader.conf(5) variable. e.g. exec="gop set 0" exec="gop set 2" ... but ideally we would have loader.conf(5) variables for these kinds of things to trim down the interpreter-dependent things being done by a standard sysadmin/user that isn't trying to modify core boot/menu behavior. It doesn't read in /boot/loader.rc either. The problem is that while loader.rc and loader.rc.local started out with the notion they would be pure loader commands (whatever that means), over time forth leaked into the mix (because we setup words in such a way as to make the loader commands also forth words, so that the interpreter really was forth, not some abstract loader language that was, at best poorly defined). The default loader.rc shipped on many platforms had forth code in it at different times in the past. And customer deployed loader.rc.local setups definitely had forth code in them. The end result is that we can't have lua parsing loader.rc or loader.rc.local because it would need a forth interpreter to do so. If this is highly desirable, we might be able to try to parse loader.rc and do something semi-sane when we hit forth, but it's unclear how to implement semi-sane. And looking at loader.lua we see: try_include("local") which will try to include /boot/local.lua, if it exists (or is it /boot/lua/local.lua, I forget). At the very least, we should document this features. And how to translate simple loader.rc.local files into this format. As a last resort, we might be able to parse the loader.rc.local file (since we've translated the current loader.rc file into lua) and hope for the best, and have that controlled by a loader.conf variable, but that's not in my top 10 list of things to do with the loader. |