aboutsummaryrefslogtreecommitdiff
path: root/stand/common
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2024-02-14 17:51:38 +0000
committerWarner Losh <imp@FreeBSD.org>2024-02-14 17:55:38 +0000
commitcd147a2a024301a796f307c7bae686305d2bf302 (patch)
treef63584b491a16d3f7002a9cb04da77a33048fbda /stand/common
parentee91dae43d23a3fa94dca1c905157e66c73c45de (diff)
loader: Fetch initial script from loader_lua env
Sometimes it is nice to override the initial script that we run. Make it possible by fetching loader_lua from the env and using that instead of the default if prsent. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43819
Diffstat (limited to 'stand/common')
-rw-r--r--stand/common/interp_lua.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stand/common/interp_lua.c b/stand/common/interp_lua.c
index db58d80b2048..3f758baebc2d 100644
--- a/stand/common/interp_lua.c
+++ b/stand/common/interp_lua.c
@@ -123,7 +123,9 @@ interp_init(void)
lua_pop(luap, 1); /* remove lib */
}
- filename = LOADER_LUA;
+ filename = getenv("loader_lua");
+ if (filename == NULL)
+ filename = LOADER_LUA;
if (interp_include(filename) != 0) {
const char *errstr = lua_tostring(luap, -1);
errstr = errstr == NULL ? "unknown" : errstr;