xref: /freebsd-14.2/stand/lua/loader.conf.lua.5 (revision fa9896e0)
13cb2f5f3SKyle Evans.\"
2*4d846d26SWarner Losh.\" SPDX-License-Identifier: BSD-2-Clause
33cb2f5f3SKyle Evans.\"
43cb2f5f3SKyle Evans.\" Copyright (c) 2020 Kyle Evans <[email protected]>
53cb2f5f3SKyle Evans.\"
63cb2f5f3SKyle Evans.\" Redistribution and use in source and binary forms, with or without
73cb2f5f3SKyle Evans.\" modification, are permitted provided that the following conditions
83cb2f5f3SKyle Evans.\" are met:
93cb2f5f3SKyle Evans.\" 1. Redistributions of source code must retain the above copyright
103cb2f5f3SKyle Evans.\"    notice, this list of conditions and the following disclaimer.
113cb2f5f3SKyle Evans.\" 2. Redistributions in binary form must reproduce the above copyright
123cb2f5f3SKyle Evans.\"    notice, this list of conditions and the following disclaimer in the
133cb2f5f3SKyle Evans.\"    documentation and/or other materials provided with the distribution.
143cb2f5f3SKyle Evans.\"
153cb2f5f3SKyle Evans.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
163cb2f5f3SKyle Evans.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173cb2f5f3SKyle Evans.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183cb2f5f3SKyle Evans.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
193cb2f5f3SKyle Evans.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
203cb2f5f3SKyle Evans.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
213cb2f5f3SKyle Evans.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
223cb2f5f3SKyle Evans.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
233cb2f5f3SKyle Evans.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
243cb2f5f3SKyle Evans.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
253cb2f5f3SKyle Evans.\" SUCH DAMAGE.
263cb2f5f3SKyle Evans.\"
273cb2f5f3SKyle Evans.Dd May 10, 2023
283cb2f5f3SKyle Evans.Dt LOADER.CONF.LUA 5
293cb2f5f3SKyle Evans.Os
303cb2f5f3SKyle Evans.Sh NAME
313cb2f5f3SKyle Evans.Nm loader.conf.lua
323cb2f5f3SKyle Evans.Nd Lua-based system bootstrap configuration file
333cb2f5f3SKyle Evans.Sh DESCRIPTION
343cb2f5f3SKyle EvansWhen the lua-based
353cb2f5f3SKyle Evans.Xr loader 8
363cb2f5f3SKyle Evansencounters a filename in
373cb2f5f3SKyle Evans.Va loader_conf_files
383cb2f5f3SKyle Evansthat has a
393cb2f5f3SKyle Evans.Dq .lua
403cb2f5f3SKyle Evanssuffix, it will be loaded and executed by the lua interpreter in a limited
413cb2f5f3SKyle Evansenvironment.
423cb2f5f3SKyle Evans.Pp
433cb2f5f3SKyle EvansThe limited environment does not contain the ability to reference or load other
443cb2f5f3SKyle Evanslua modules.
453cb2f5f3SKyle EvansExisting loader environment variables may be referenced as if they were already
463cb2f5f3SKyle Evansdefined global variables.
473cb2f5f3SKyle Evans.Pp
483cb2f5f3SKyle EvansA lua configuration file may set any global variable, which will subsequently
493cb2f5f3SKyle Evansbe processed and added to the environment after execution of the configuration
503cb2f5f3SKyle Evansfile has completed.
513cb2f5f3SKyle EvansOther than the
523cb2f5f3SKyle Evans.Ar exec
533cb2f5f3SKyle Evanssetting, all variables described in
543cb2f5f3SKyle Evans.Xr loader.conf 5
553cb2f5f3SKyle Evansoperate the same in the
563cb2f5f3SKyle Evans.Nm
573cb2f5f3SKyle Evansenvironment.
583cb2f5f3SKyle EvansNote that the settings describing module options can only be set in the
593cb2f5f3SKyle Evansenvironment; there is currently no way for a
603cb2f5f3SKyle Evans.Pa loader.conf.lua
613cb2f5f3SKyle Evansto fetch them.
623cb2f5f3SKyle EvansAt this time, global table and function values are ignored.
633cb2f5f3SKyle Evans.Pp
643cb2f5f3SKyle EvansThe
653cb2f5f3SKyle Evans.Fn config.buildenv
663cb2f5f3SKyle Evanshook will be run with an empty environment provided to it that may be populated
673cb2f5f3SKyle Evansby a custom
683cb2f5f3SKyle Evans.Pa local.lua .
693cb2f5f3SKyle Evans.Sh SEE ALSO
703cb2f5f3SKyle Evans.Xr loader.conf 5
713cb2f5f3SKyle Evans.Sh AUTHORS
723cb2f5f3SKyle EvansThe mechanism for loading
733cb2f5f3SKyle Evans.Nm
743cb2f5f3SKyle Evansfiles was originally written by
753cb2f5f3SKyle Evans.An Kyle Evans Aq Mt [email protected] .
76