CORE.LUA(8)
β¨ NAME β¨
okay bestie, welcome to CORE.LUA(8) β this is core.lua from the System Manager's Manual, and it is literally the bootloader core module. main character energy only π
πΈ DESCRIPTION πΈ
core.lua contains core functionality that does not have a more fitting module. it's the spot for the stuff that doesn't have a better home, no cap.
Before hooking into or using the functionality provided by core.lua, it must be included with a statement such as the following:
local core = require("core")
π CONSTANTS π
The following raw key code constants are defined in core.lua:
KEY_BACKSPACEβ the backspace code. bestie, you should generally check this along withKEY_DELETEfor backspace functionality.KEY_ENTERβ the enter key, or hard return.KEY_DELETEβ the delete code. you should generally check this along withKEY_BACKSPACEfor backspace functionality.
The following key-string constants are defined in core.lua:
KEYSTR_ESCAPEβ the escape key.KEYSTR_CSIβ the ANSI CSI sequence.
The following menu entry type constants are defined in core.lua:
MENU_RETURNβ return to the parent menu.MENU_ENTRYβ a normal menu entry.MENU_SEPARATORβ a menu entry that serves as a separator.MENU_SUBMENUβ a menu entry that opens a submenu when selected.MENU_CAROUSEL_ENTRYβ a menu entry that rotates through items like a carousel upon selection of the menu entry.
fr fr, please see menu.lua(8) for extended descriptions and usage of the MENU_* constants β iykyk π¦
π¦ Exported functions π¦
The following functions are exported from core.lua:
core.setVerbose(verbose)β sets or unsetsboot_verbose. ifverboseis omitted, toggle the current verbose setting.core.setSingleUser(singleUser)β sets or unsetsboot_single. ifsingleUseris omitted, toggle the current single user setting.core.getACPI()β return true if ACPI is both present and not explicitly disabled byhints.acpi.0.disabled.core.hasACPI()β checks whether ACPI support is present. this requires the loader to probe the system and setacpi.rsdpearly before starting the interpreter.core.setACPI(acpi)β sets or unsetsacpi_load,hint.acpi.0.disabled, andloader.acpi_disabled_by_user. ifacpiis omitted, toggle the current ACPI setting.core.setSafeMode(safeMode)β set the safe mode setting. sets or unsetskern.smp.disabled,hw.ata.ata_dma,hw.ata.atapi_dma,kern.eventtimer.periodic, andkern.geom.part.check_integrity. ifsafeModeis omitted, toggle the current safe mode setting.core.clearCachedKernels()β clears out the cache of kernels to be displayed on the boot menu. this function is registered as aconfig.reloadedhook. it is used to invalidate the kernel list whenever it may have changed, either due to a boot environment change or a potential change in eitherkernelorkernels.core.hasFeature(featureName)β checks whether the namedfeatureNameis enabled in the current loader. this is specifically used for detecting capabilities of the loaded loader binary, so that one can reasonably implement backwards compatibility shims if needed.core.kernelList()β returns a table of kernels to display on the boot menu. this will combinekernelandkernelsfromloader.conf(5). ifkernels_autodetectis set inloader.conf(5),kernelswill be autodetected from the current system.core.bootenvDefault()β returns the default boot environment,nilif unset.core.bootenvFilter(func)β installs a filterfuncintocore.bootenvList(). if thefuncreturns true, then the boot environment is retained in the list. otherwise, the boot environment is hidden. the old filter, if any, is returned to allow the caller to compose a filter on top of another filter.core.bootenvList()β returns a table of boot environments, or an empty table. these will be picked up using thebootenvsandbootenvs_countvariables set byloader(8).core.setDefaults()β resets ACPI, safe mode, single user, and verbose settings to their system defaults.core.autoboot(argstr)β loads the kernel and specified modules, then invokes theautobootloader(8)command withargstras-is.core.boot(argstr)β loads the kernel and specified modules, then invokes thebootloader(8)command withargstras-is.core.isSingleUserBoot()β returns true ifboot_singleis set toyes.core.isZFSBoot()β returns true ifcurrdevis set to azfs(8)dataset.core.isSerialBoot()β returns true if we are booting over serial. this checksconsole,boot_serial, andboot_multicons.core.deepCopyTable(tbl)β recursively deep copiestbland returns the result.core.popFrontTable(tbl)β pops the front element off oftbl, and returns two return values: the front element, and the rest of the table. if there are no elements, this returnsnilandnil. if there is one element, this returns the front element and an empty table. β οΈ this will not operate on truly associative tables; numeric indices are required.core.loaderTooOld()β returns true if the loader is too old. specifically, this means, is the loader old enough to require one or more workarounds in the current lua base modules.
π SEE ALSO π
π AUTHORS π
The core.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).
π cute sign-off: this CORE.LUA(8) page is from Debian, dated April 8, 2026. that's the whole manual, bestie β go slay your bootloader π
β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms