MENU.4TH(8)
π menu.4th β FreeBSD dynamic menu boot module π
okay so bestie, this is the MENU.4TH(8) page from the System Manager's Manual, and it's literally all about the FreeBSD dynamic menu boot module. Let's get into it β¨
πΈ NAME πΈ
menu.4th β FreeBSD dynamic menu boot module.
β¨ DESCRIPTION β¨
The file that goes by the name of menu.4th is a set of commands designed to display a dynamic menu system managed through a system of carefully named environment variables π
. The commands of menu.4th by themselves are not enough for most uses. Please refer to the examples below for the most common situations, and to loader(8) for additional commands.
Before using any of the commands provided in menu.4th, it must be included through the command:
include menu.4th
This line is present in the default /boot/menu.rc file, so it is not needed (and should not be re-issued) in a normal setup.
π οΈ The commands it gives you π οΈ
menu-initβ Draws the menu bounding box and initializes some internal state variables. This should be called before any other menu-related functions.menu-displayβ Displays the menu (configured via the below documented environment variables) and blocks on keyboard input, awaiting user action.menu-eraseβ Clears the screen area within the menu bounding box.menu-redrawβ Callsmenu-eraseand then redraws the menu.menu-unsetβ Unsets the environment variables associated with individual menu items, clearing the way for a new menu.menu-clearβ Callsmenu-unsetand thenmenu-erase.
𧬠The environment variables that shape its behavior π§¬
loader_colorβ If set toNO(case-insensitive) or0, causes the menu to be displayed without color. The default is to use ANSI coloring whenever possible. If serial boot is enabled, color is disabled by default. Color features include the use of ANSI bold for numbers appearing to the left of menuitems and the use of specialansivariables described below.autoboot_delayβ Number of secondsmenu-displaywill wait before executingmenu_timeout_command(bootby default) unless a key is pressed. If set toNO(case-insensitive),menu-displaywill wait for user input and never executemenu_timeout_command. If set to-1,menu-displaywill boot immediately, preventing both interruption of the autoboot process and escaping to the loader prompt. Default is10. Seeloader(8)for additional information.menu_timeout_commandβ The command to be executed afterautoboot_delayseconds if a key is not pressed. The default isboot.loader_menu_frameβ Sets the desired box style to draw around the boot menu. Possible values are:single(the default),double, andnone.loader_menu_timeout_xβ Sets the desired column position of the timeout countdown text. Default is4.loader_menu_timeout_yβ Sets the desired row position of the timeout countdown text. Default is23.loader_menu_titleβ The text to display above the menu. Default isWelcome to FreeBSD.loader_menu_title_alignβ Default is to alignloader_menu_titlecentered above the menu. This can be set toleftorrightto instead display the title left-or-right justified (respectively).loader_menu_xβ Sets the desired column position of the boot menu. Default is5.loader_menu_yβ Sets the desired row position of the boot menu. Default is10.menu_caption[x]β The text to be displayed for the numbered menuitemx.menu_command[x]β The command to be executed when the number associated with menuitemxis pressed. See the list of included FICL words below for some ideas.menu_keycode[x]β An optional decimal ASCII keycode to be associated with menuitemx. When pressed, will cause the execution ofmenu_command[x].ansi_caption[x]β Ifloader_coloris set (enabled by default), use this caption for menuitemxinstead ofmenu_caption[x].toggled_text[x]β For menuitems wheremenu_command[x]is set totoggle_menuitem(or a derivative thereof), the text displayed will toggle between this andmenu_caption[x].toggled_ansi[x]β Liketoggled_text[x]except used whenloader_coloris enabled (default).menu_caption[x][y]β For menuitems wheremenu_command[x]is set tocycle_menuitem(or a derivative thereof), the text displayed will cycle between this and othermenu_caption[x][y]entries.ansi_caption[x][y]β Likemenu_caption[x][y]except used whenloader_coloris enabled (default).menu_acpiβ When set to a numberxassociated with a given menuitem, that menuitem will only appear when running on ACPI-compatible hardware,acpi.rsdpis set (indicating the presence of hardware ACPI support as detected byloader(8)), andhint.acpi.0.disabledis not set. On non-i386 hardware, menuitems configured after themenu_acpimenuitem will use a lower number (to compensate for the missing ACPI menuitem) but continue to function as expected. On i386-compatible hardware lacking ACPI support (as detected byloader(8)), subsequent menuitems will retain their associated numbers.acpi.rsdpβ Set automatically byloader(8)on ACPI-compatible hardware when ACPI support is detected at boot time. Effects the display of themenu_acpimenuitem (if configured).hint.acpi.0.disabledβ Effects the display of themenu_acpimenuitem. If set, the menuitem will displaytoggled_text[x](toggled_ansi[x]ifloader_coloris set), otherwisemenu_caption[x](ansi_caption[x]ifloader_coloris set).menu_optionsβ When set to a numberx, a single blank-line and anOptionsheader are inserted betweenmenu_caption[x-1]andmenu_caption[x](if configured).menu_rebootβ If set, adds a built-inRebootmenuitem to the end of the last configured menuitem. Ifmenu_optionsis configured, theRebootmenuitem will be inserted before theOptionsseparator.
π§ Bonus FICL words π§
In addition, it provides the following FICL words:
arch-i386? (-- BOOL)β Returns true (-1) on i386 and false (0) otherwise.acpipresent? (-- BOOL)β Returns true (-1) if ACPI is present and false (0) otherwise.acpienabled? (-- BOOL)β Returns true (-1) if ACPI is enabled and false (0) otherwise.toggle_menuitem (N -- N)β Toggles menuitemNbetweenmenu_caption[x]andtoggled_text[x](whereNrepresents the ASCII decimal value forx).cycle_menuitem (N -- N)β Cycles menuitemNbetweenmenu_caption[x][y]entries (whereNrepresents the ASCII decimal value forx).
For all values of x above, use any number between 1 through 9. Sorry, double-digits are not currently supported π
π FILES π
/boot/loaderβ Theloader(8)./boot/menu.4thβmenu.4thitself./boot/loader.rcβloader(8)bootstrapping script.
π§ͺ EXAMPLES π§ͺ
A simple boot menu:
include /boot/menu.4th
menu-init
set menu_caption[1]="Boot"
set menu_command[1]="boot"
set menu_options=2
set menu_caption[2]="Option: NO"
set toggled_text[2]="Option: YES"
set menu_command[2]="toggle_menuitem"
set menu_timeout_command="boot"
set menu_reboot
menu-display
π SEE ALSO π
π°οΈ HISTORY π°οΈ
The menu.4th set of commands first appeared in FreeBSD 9.0.
π AUTHORS π
The menu.4th set of commands was written by Devin Teske <dteske@FreeBSD.org>.
that's the whole MENU.4TH(8) vibe, bestie π this build says Debian and October 4, 2024, so go make your boot menu iconic β¨π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2011-2013 Devin Teske
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms