| Main index | Section 8 | Options |
It provides a scripting language that can be used to automate tasks, do pre-configuration or assist in recovery procedures. This scripting language is roughly divided in two main components. The smaller one is a set of commands designed for direct use by the casual user, called "builtin commands" for historical reasons. The main drive behind these commands is user-friendliness. The bigger component is the Lua interpreter.
During initialization, loader_lua probes for a console and sets the console variable, or sets it to serial console ("comconsole") if the previous boot stage used that. If multiple consoles are selected, they are listed separated by spaces. Then, devices are probed, currdev and loaddev are set, and LINES is set to 24. Next, Lua is initialized, and /boot/lua/loader.lua is processed if it exists. After that, /boot/loader.conf is processed if available.
At this point, if an autoboot has not been attempted, and if autoboot_delay is not set to "NO" (case insensitive), then an autoboot is attempted. If the system gets past this point, prompt is set and loader_lua enters interactive mode. Please note that, historically, even when autoboot_delay is set to "0", the user can interrupt the autoboot process by pressing a key on the console while the kernel and modules are being loaded. To prevent this set autoboot_delay to "-1". In this case loader_lua enters interactive mode only if autoboot has failed.
The commands are described in the loader_simp(8) "BUILTIN COMMANDS" section.
One can prevent unauthorized access to the loader_lua command line by setting the password, or setting autoboot_delay to -1. See loader.conf(5) for details. In order for this to be effective, one should also configure the firmware (BIOS or UEFI) to prevent booting from unauthorized devices.
Currently, MD is only supported in loader.efi(8).
| /boot/loader | loader_lua itself. |
| /boot/defaults/loader.conf
/boot/lua/loader.lua | |
| Loader init | |
| /boot/loader.conf
/boot/loader.conf.local | |
| loader_lua configuration files, as described in loader.conf(5). | |
boot -s
Load the kernel, a splash screen, and then autoboot in five seconds. Notice that a kernel must be loaded before any other load command is attempted.
load kernel load splash_bmp load -t splash_image_data /boot/chuckrulez.bmp autoboot 5
Set the disk unit of the root device to 2, and then boot. This would be needed in a system with two IDE disks, with the second IDE disk hardwired to ada2 instead of ada1.
set root_disk_unit=2 boot /boot/kernel/kernel
Set the default device used for loading a kernel from a ZFS filesystem:
set currdev=zfs:tank/ROOT/knowngood:
| 100 | Any type of error in the processing of a builtin. |
| -1 | Abort executed. |
| -2 | Abort" executed. |
| -56 | Quit executed. |
| -256 | Out of interpreting text. |
| -257 | Need more text to succeed -- will finish on next run. |
| -258 | Bye executed. |
| -259 | Unspecified error. |
| LOADER_LUA (8) | September 29, 2021 |
| Main index | Section 8 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Unix is a junk OS designed by a committee of PhDs. | ” |
| — Dave Cutler | ||