tail head cat sleep
QR code linking to this page

Manual Pages  — CONFIG.LUA

NAME

config.lua – FreeBSD config module

CONTENTS

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 index in the carousel menu entry described by id. See the definition 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 configuration 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 error is encountered.
config.loadKernel(other_kernel)
  Attempts to load other_kernel as a kernel. If other_kernel is unset config.loadKernel() will attempt to load "kernel". Otherwise, 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 either 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 selector 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) configuration 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 restore the environment to how it existed before the last config was loaded, then it will invoke config.load(file). Before returning, all "config.reloaded" hooks will be run.
config.loadelf()
  Loads all ELF objects, the selected kernel as well as any modules 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 <Mt pedrosouza@FreeBSD.org>. Later work and this manual page was done by Kyle Evans <Mt kevans@FreeBSD.org>.

CONFIG.LUA (8) June 9, 2018

tail head cat sleep
QR code linking to this page


Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

The last good thing written in C was Franz Schubert's Symphony #9.
— Erwin Dietrich