Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
CONFIG.LUA(8)		  BSD System Manager's Manual		 CONFIG.LUA(8)

NAME
     config.lua	-- FreeBSD config module

DESCRIPTION
     config.lua	contains configuration and module loading functionality.

     Before hooking into or using the functionality provided by	config.lua, it
     must be included with a statement such as the following:

	   local config	= require("config")

   Exported functions
     The following functions are exported from config.lua:

	   config.getCarouselIndex(id)	     Returns the currently chosen in-
					     dex in the	carousel menu entry
					     described by id.  See the defini-
					     tion of menu.lua(8) for a more
					     in-depth explanation of
					     carousels.

	   config.setCarouselIndex(id, idx)  Set the chosen index for the
					     carousel menu entry described by
					     id	to idx.	 A lookup will be done
					     as	needed to determine what value
					     idx actually corresponds to.

	   config.processFile(name, silent)  Process and parse name as a con-
					     figuration	file.  Returns true if
					     name exists and parses without
					     error, false otherwise.  If
					     silent is true,
					     config.processFile() will not
					     consider a	failure	to read	the
					     file as a failure.

	   config.parse(text)		     Parse text	as a configuration
					     file.  This is used internally by
					     config.processFile() to parse the
					     contents of a configuration file.
					     Returns true if parsing succeeds
					     without error, false if an	error
					     occurred.	A message is also
					     printed to	the console if an er-
					     ror is encountered.

	   config.loadKernel(other_kernel)   Attempts to load other_kernel as
					     a kernel.	If other_kernel	is un-
					     set config.loadKernel() will at-
					     tempt to load "kernel".  Other-
					     wise, it will try to load
					     "kernel" first from
					     /boot/{other_kernel}, then	from
					     {other_kernel}.

					     The latter	is tried in case an
					     absolute path has been specified
					     to	the kernel to use.
					     module_path is amended to include
					     the directory the kernel was
					     found in if either	of these paths
					     result in a loaded	kernel.

					     If	no kernel was loaded from ei-
					     ther of these paths,
					     config.loadKernel() will attempt
					     to	load a kernel named
					     "{other_kernel}" from module_path
					     instead of	attempting to load a
					     kernel named "kernel".

					     Returns true if a kernel was
					     loaded, false if no kernel	was
					     loaded.

	   config.selectKernel(kernel)	     Set kernel	to the kernel that
					     will be loaded when either
					     autoboot or boot are invoked.
					     This is usually called by the
					     menu system as the	kernel selec-
					     tor carousel is toggled through.

	   config.load(file, reload)	     Loads file	as a configuration
					     file.  If file is not specified,
					     /boot/defaults/loader.conf	is
					     used.  config.load() will then
					     silently attempt to process any
					     files specified in
					     loader_conf_files after file has
					     been processed.  nextboot(8) con-
					     figuration	will also be checked
					     as	part of	config.load().	Before
					     returning,	all "config.loaded"
					     hooks will	be run if reload is
					     not set to	true.

	   config.reload(file)		     Reloads file as a configuration
					     file.  config.reload() will re-
					     store the environment to how it
					     existed before the	last config
					     was loaded, then it will invoke
					     config.load(file).	 Before	re-
					     turning, all "config.reloaded"
					     hooks will	be run.

	   config.loadelf()		     Loads all ELF objects, the	se-
					     lected kernel as well as any mod-
					     ules configured to	be preloaded
					     in	loader.conf(5).	 This will be
					     called by the Lua intercepted
					     autoboot and boot commands.

   Defined Hooks
     The following hooks are defined in	config.lua:

	   config.loaded

	   config.reloaded

SEE ALSO
     loader.conf(5), loader(8),	menu.lua(8), nextboot(8)

AUTHORS
     The config.lua file was originally	written	by Pedro Souza
     <pedrosouza@FreeBSD.org>.	Later work and this manual page	was done by
     Kyle Evans	<kevans@FreeBSD.org>.

BSD				 June 9, 2018				   BSD

NAME | DESCRIPTION | SEE ALSO | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=config.lua&sektion=8&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help