EFIBOOTMGR(8) | MidnightBSD System Manager's Manual | EFIBOOTMGR(8) |
efibootmgr
—
manipulate the EFI Boot Manager
[-aAnNB
Bootvar]
[-t
timeout]
[-T
] [-o
bootorder] [-verbose
]
[-c
--k
kernel -l loader [-L
label] [--dry-run] [-b Bootvar]]
efibootmgr
manipulates how UEFI Boot
Managers boot the system. Methods of booting can be created and destroyed.
Boot methods can be activated or deactivated. The order of boot methods
tried can be changed. Temporary boot methods can override the usual booting
methods.
The UEFI standard defines how hosts may control what is used to bootstrap the system. Each method is encapsulated within a persistent UEFI variable, stored by the UEFI BIOS of the form BootXXXX. These variables are numbered, describe where to load the bootstrap program from, and whether or not the method is active. The boot order of these methods is controlled by another variable BootOrder. The currently booting method is communicated using BootCurrent. A global timeout can also be set.
efibootmgr
requires that the kernel efirt
module to get and set these non-volatile variables.
The following options are available:
-c
--create
-l
--loader
loader-k
--kernel
kernel-b
-Bootvar
-L
--label
label-D
--dry-run
-B
--delete
BootVarNum-a
--activate
BootVarNum-A
--deactivate
BootVarNum-n
--bootnext
BootVarNum-N
--delete-bootnext
-o
--bootorder
bootorder-t
--set-timeout
timeout-T
--del-timeout
-v
--verbose
To Display the current Boot related variables in the system:
efibootmgr [-v]
This will display the optional BootNext BootVar, BootCurrent, or currently booted BootVar, followed by the optional Timeout value, any BootOrder that maybe set, followed finally by all currently defined Boot variables, active or not. The verbose flag will augment this output with the hardrive partition uuids, size/offset and device-path of the variable.
The efibootmgr
program can be used to
create new EFI boot variables. To create a new boot var pointing to an
installation with its EFI partition mounted under /mnt, the given loader and
a label "FreeBSD-11":
efibootmgr -c -l
/mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
This will result in the next available BootVarNum being assigned to a new UEFI load variable, and given the label "FreeBSD-11" such as:
Boot0009 FreeBSD-11
Note newly created BootVars are created inactive. The active state is denoted by an '*' following the BootVar name in the output. They are also inserted into the first position of current BootOrder variable if it exists. They must first be set to active before being considered available to attempt booting from, else they are ignored.
efibootmgr -B 0009
Will delete the given BootVar Boot0009
To set a given newly created BootVar active use:
efibootmgr -a 0009
To set a given BootVar to be used as the BootNext variable, irrespective of its active state, use:
efibootmgr -n 0009
To set the BootOrder for the next reboot use:
efibootmgr -o
0009,0003,...
May 8, 2018 | midnightbsd-3.1 |