xref: /freebsd/usr.sbin/efibootmgr/efibootmgr.8 (revision 83c4237258d3574b28a63c9182b7d95c428cd8ef)
152467047SWarner Losh.\"
252467047SWarner Losh.\" Copyright (c) 2017-2018 Netflix, Inc.
31285bcc8SWarner Losh.\"
41285bcc8SWarner Losh.\" Redistribution and use in source and binary forms, with or without
51285bcc8SWarner Losh.\" modification, are permitted provided that the following conditions
61285bcc8SWarner Losh.\" are met:
71285bcc8SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
81285bcc8SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
91285bcc8SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
101285bcc8SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
111285bcc8SWarner Losh.\"    documentation and/or other materials provided with the distribution.
121285bcc8SWarner Losh.\"
131285bcc8SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
141285bcc8SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
151285bcc8SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
161285bcc8SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
171285bcc8SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
181285bcc8SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
191285bcc8SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
201285bcc8SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
211285bcc8SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
221285bcc8SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
231285bcc8SWarner Losh.\" SUCH DAMAGE.
241285bcc8SWarner Losh.\"
251285bcc8SWarner Losh.\" $FreeBSD$
261285bcc8SWarner Losh.\"
27*83c42372SD Scott Phillips.Dd August 25, 2020
281285bcc8SWarner Losh.Dt EFIBOOTMGR 8
291285bcc8SWarner Losh.Os
301285bcc8SWarner Losh.Sh NAME
311285bcc8SWarner Losh.Nm efibootmgr
321285bcc8SWarner Losh.Nd manipulate the EFI Boot Manager
331285bcc8SWarner Losh.Sh SYNOPSIS
34736dcdb7SYuri Pankov.Nm
35557a5ad4SRebecca Cran.Op Fl v
36736dcdb7SYuri Pankov.Nm
37736dcdb7SYuri Pankov.Fl a
38736dcdb7SYuri Pankov.Fl b Ar bootnum
39736dcdb7SYuri Pankov.Nm
40736dcdb7SYuri Pankov.Fl A
41736dcdb7SYuri Pankov.Fl b Ar bootnum
42736dcdb7SYuri Pankov.Nm
43736dcdb7SYuri Pankov.Fl B
44736dcdb7SYuri Pankov.Fl b Ar bootnum
45736dcdb7SYuri Pankov.Nm
46736dcdb7SYuri Pankov.Fl c
47736dcdb7SYuri Pankov.Fl l Ar loader
48736dcdb7SYuri Pankov.Op Fl aD
49736dcdb7SYuri Pankov.Op Fl b Ar bootnum
50736dcdb7SYuri Pankov.Op Fl k Ar kernel
51736dcdb7SYuri Pankov.Op Fl L Ar label
521cdb8eb8SWarner Losh.Op Fl e Ar env
531cdb8eb8SWarner Losh.Nm
541cdb8eb8SWarner Losh.Fl E
551cdb8eb8SWarner Losh.Op Fl d
561cdb8eb8SWarner Losh.Op Fl p
57736dcdb7SYuri Pankov.Nm
58*83c42372SD Scott Phillips.Fl F
59*83c42372SD Scott Phillips.Nm
60*83c42372SD Scott Phillips.Fl f
61*83c42372SD Scott Phillips.Nm
62736dcdb7SYuri Pankov.Fl n
63736dcdb7SYuri Pankov.Fl b Ar bootnum
64736dcdb7SYuri Pankov.Nm
65736dcdb7SYuri Pankov.Fl N
66736dcdb7SYuri Pankov.Nm
67736dcdb7SYuri Pankov.Fl o Ar bootorder
68736dcdb7SYuri Pankov.Nm
69736dcdb7SYuri Pankov.Fl t Ar timeout
70736dcdb7SYuri Pankov.Nm
71736dcdb7SYuri Pankov.Fl T
721285bcc8SWarner Losh.Sh "DESCRIPTION"
7398b765e5SJohn-Mark GurneyThe
741285bcc8SWarner Losh.Nm
7598b765e5SJohn-Mark Gurneyprogram manipulates how UEFI Boot Managers boot the system.
7698b765e5SJohn-Mark GurneyIt can create and destroy methods for booting along with activating or
7798b765e5SJohn-Mark Gurneydeactivating them.
7898b765e5SJohn-Mark GurneyIt can also change the defined order of boot methods.
7998b765e5SJohn-Mark GurneyIt can create a temporary boot (BootNext) variable that references a
8098b765e5SJohn-Mark Gurneyboot method to be tried once upon the next boot.
811285bcc8SWarner Losh.Pp
821285bcc8SWarner LoshThe UEFI standard defines how hosts may control what is used to
831285bcc8SWarner Loshbootstrap the system.
841285bcc8SWarner LoshEach method is encapsulated within a persistent UEFI variable, stored
851285bcc8SWarner Loshby the UEFI BIOS of the form
8698b765e5SJohn-Mark Gurney.Cm Boot Ns Em XXXX
8798b765e5SJohn-Mark Gurney(where XXXX are uppercase hexadecimal digits).
8898b765e5SJohn-Mark GurneyThese variables are numbered, each describing where to load the bootstrap
8998b765e5SJohn-Mark Gurneyprogram from, and whether or not the method is active (used for booting,
9098b765e5SJohn-Mark Gurneyotherwise the method will be skipped).
9198b765e5SJohn-Mark GurneyThe order of these methods is controlled by another variable,
92736dcdb7SYuri Pankov.Cm BootOrder .
9398b765e5SJohn-Mark GurneyThe currently booted method is communicated using
94736dcdb7SYuri Pankov.Cm BootCurrent .
951285bcc8SWarner LoshA global timeout can also be set.
961285bcc8SWarner Losh.Pp
971285bcc8SWarner Losh.Nm
9898b765e5SJohn-Mark Gurneyrequires that the kernel module
9998b765e5SJohn-Mark Gurney.Xr efirt 9
10098b765e5SJohn-Mark Gurneymodule be present or loaded to get and set these
1011285bcc8SWarner Loshnon-volatile variables.
1021285bcc8SWarner Losh.Pp
1031285bcc8SWarner LoshThe following options are available:
104736dcdb7SYuri Pankov.Bl -tag -width Ds
105736dcdb7SYuri Pankov.It Fl a -activate
106736dcdb7SYuri PankovActivate the given
107736dcdb7SYuri Pankov.Ar bootnum
108736dcdb7SYuri Pankovboot entry, or the new entry when used with
109736dcdb7SYuri Pankov.Fl c .
110736dcdb7SYuri Pankov.It Fl A -deactivate
111736dcdb7SYuri PankovDeactivate the given
112736dcdb7SYuri Pankov.Ar bootnum
113736dcdb7SYuri Pankovboot entry.
114557a5ad4SRebecca Cran.It Fl b -bootnum Ar bootnum
115736dcdb7SYuri PankovWhen creating or modifying an entry, use
116736dcdb7SYuri Pankov.Ar bootnum
117736dcdb7SYuri Pankovas the index.
11870de14d8SRebecca CranWhen creating a new entry, fail if it already exists.
119736dcdb7SYuri Pankov.It Fl B -delete
120736dcdb7SYuri PankovDelete the given
121736dcdb7SYuri Pankov.Ar bootnum
122736dcdb7SYuri Pankovboot entry.
123736dcdb7SYuri Pankov.It Fl c -create
124736dcdb7SYuri PankovCreate a new
125736dcdb7SYuri Pankov.Cm Boot
12698b765e5SJohn-Mark Gurneyvariable (aka method or entry).
1271285bcc8SWarner Losh.It Fl D -dry-run
128557a5ad4SRebecca CranProcess but do not change any variables.
1291cdb8eb8SWarner Losh.It Fl E -esp
1301cdb8eb8SWarner LoshPrint the
1311cdb8eb8SWarner Losh.Fx
1321cdb8eb8SWarner Loshpath to the ESP device, derived from the EFI variables
1331cdb8eb8SWarner Losh.Va BootCurrent
1341cdb8eb8SWarner Loshand
1351cdb8eb8SWarner Losh.Va BootXXXX .
1361cdb8eb8SWarner LoshThis is the ESP partition used by UEFI to boot the current
1371cdb8eb8SWarner Loshinstance of the system.
1381cdb8eb8SWarner LoshIf
1391cdb8eb8SWarner Losh.Fl d -device-path
1401cdb8eb8SWarner Loshis specified, the UEFI device path to the ESP is reported instead.
1411cdb8eb8SWarner LoshIf
1421cdb8eb8SWarner Losh.Fl p -unix-path
1431cdb8eb8SWarner Loshis specified, the mount point of the ESP is reported instead.
144*83c42372SD Scott Phillips.It Fl f -fw-ui , Fl F -no-fw-ui
145*83c42372SD Scott PhillipsSet or clear the request to the system firmware to stop in its user
146*83c42372SD Scott Phillipsinterface on the next boot.
147736dcdb7SYuri Pankov.It Fl k -kernel Ar kernel
148736dcdb7SYuri PankovThe path to and name of the kernel.
149736dcdb7SYuri Pankov.It Fl l -loader Ar loader
150736dcdb7SYuri PankovThe path to and name of the loader.
151736dcdb7SYuri Pankov.It Fl L -label Ar label
15298b765e5SJohn-Mark GurneyAn optional description for the method.
15370de14d8SRebecca Cran.It Fl n -bootnext
154736dcdb7SYuri PankovSet
155736dcdb7SYuri Pankov.Ar bootnum
156736dcdb7SYuri Pankovboot entry as the
157736dcdb7SYuri Pankov.Cm BootNext
158736dcdb7SYuri Pankovvariable.
1591285bcc8SWarner Losh.It Fl N -delete-bootnext
160736dcdb7SYuri PankovDelete the
161736dcdb7SYuri Pankov.Cm BootNext
162736dcdb7SYuri Pankovoptional variable.
1631285bcc8SWarner Losh.It Fl o -bootorder Ar bootorder
164736dcdb7SYuri PankovSet
165736dcdb7SYuri Pankov.Cm BootOrder
166736dcdb7SYuri Pankovvariable to the given comma delimited set of
167736dcdb7SYuri Pankov.Ar bootnum Ns s .
168736dcdb7SYuri PankovThe numbers are in hex to match
169736dcdb7SYuri Pankov.Cm Boot Ns Em XXXX ,
170736dcdb7SYuri Pankovbut may omit leading zeros.
1711285bcc8SWarner Losh.It Fl t -set-timeout Ar timeout
1721285bcc8SWarner LoshSet the bootmenu timeout value.
1731285bcc8SWarner Losh.It Fl T -del-timeout
174736dcdb7SYuri PankovDelete the
175736dcdb7SYuri Pankov.Cm BootTimeout
176736dcdb7SYuri Pankovvariable.
1771285bcc8SWarner Losh.It Fl v -verbose
178557a5ad4SRebecca CranDisplay the device path of boot entries in the output.
1791285bcc8SWarner Losh.El
180557a5ad4SRebecca Cran.Sh Examples
181736dcdb7SYuri PankovTo display the current
182736dcdb7SYuri Pankov.Cm Boot
183736dcdb7SYuri Pankovrelated variables in the system:
1841285bcc8SWarner Losh.Pp
18598b765e5SJohn-Mark Gurney.Dl efibootmgr -v
1861285bcc8SWarner Losh.Pp
187736dcdb7SYuri PankovThis will display the optional
188736dcdb7SYuri Pankov.Cm BootNext
18998b765e5SJohn-Mark Gurney(if present),
19098b765e5SJohn-Mark Gurney.Cm BootCurrent
19198b765e5SJohn-Mark Gurney(currently booted method), followed by the optional
192736dcdb7SYuri Pankov.Cm Timeout
193736dcdb7SYuri Pankovvalue, any
194736dcdb7SYuri Pankov.Cm BootOrder
195736dcdb7SYuri Pankovthat may be set, followed finally by all currently defined
196736dcdb7SYuri Pankov.Cm Boot
197736dcdb7SYuri Pankovvariables, active or not.
19898b765e5SJohn-Mark GurneyThe verbose flag,
19998b765e5SJohn-Mark Gurney.Pq Fl v ,
20098b765e5SJohn-Mark Gurneyaugments this output with the disk partition uuids,
201736dcdb7SYuri Pankovsize/offset and device-path of the variable.
20298b765e5SJohn-Mark GurneyThe flag will also include any unreferenced (by BootOrder) variables.
2031285bcc8SWarner Losh.Pp
2041285bcc8SWarner LoshThe
2051285bcc8SWarner Losh.Nm
206736dcdb7SYuri Pankovprogram can be used to create new EFI boot variables.
20798b765e5SJohn-Mark GurneyThe following command may be used to create a new boot method, using
20898b765e5SJohn-Mark Gurneythe EFI partition mounted under
209736dcdb7SYuri Pankov.Pa /mnt ,
21098b765e5SJohn-Mark Gurneymark the method active, using
21198b765e5SJohn-Mark Gurneythe given loader and label the method
212736dcdb7SYuri Pankov.Qq FreeBSD-11 :
2131285bcc8SWarner Losh.Pp
21498b765e5SJohn-Mark Gurney.Dl efibootmgr -a -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11
2151285bcc8SWarner Losh.Pp
216557a5ad4SRebecca CranThis will result in the next available bootnum being assigned to a
217736dcdb7SYuri Pankovnew UEFI boot variable, and given the label
218736dcdb7SYuri Pankov.Qq FreeBSD-11
219736dcdb7SYuri Pankovsuch as:
2201285bcc8SWarner Losh.Pp
2211285bcc8SWarner Losh.Dl Boot0009 FreeBSD-11
2221285bcc8SWarner Losh.Pp
22398b765e5SJohn-Mark GurneyNote newly created boot entries are, by default, created inactive, hence
22498b765e5SJohn-Mark Gurneythe reason
22598b765e5SJohn-Mark Gurney.Fl a
22698b765e5SJohn-Mark Gurneyflag is specified above so that it will be considered for booting.
22798b765e5SJohn-Mark GurneyThe active state is denoted by a '*' following the
228736dcdb7SYuri Pankov.Cm Boot Ns Em XXXX
229736dcdb7SYuri Pankovname in the output.
230736dcdb7SYuri PankovThey are also inserted into the first position of current
231736dcdb7SYuri Pankov.Cm BootOrder
232736dcdb7SYuri Pankovvariable if it exists.
233736dcdb7SYuri PankovThey must first be set to active before being considered available to attempt
234736dcdb7SYuri Pankovbooting from, else they are ignored.
2351285bcc8SWarner Losh.Pp
23670de14d8SRebecca Cran.Dl efibootmgr -B -b 0009
2371285bcc8SWarner Losh.Pp
238736dcdb7SYuri PankovWill delete the given boot entry Boot0009.
2391285bcc8SWarner Losh.Pp
24098b765e5SJohn-Mark GurneyTo set the given boot entry active:
2411285bcc8SWarner Losh.Pp
24270de14d8SRebecca Cran.Dl efibootmgr -a -b 0009
2431285bcc8SWarner Losh.Pp
244736dcdb7SYuri PankovTo set a given boot entry to be used as the
245736dcdb7SYuri Pankov.Cm BootNext
246736dcdb7SYuri Pankovvariable, irrespective of its active state, use:
2471285bcc8SWarner Losh.Pp
24870de14d8SRebecca Cran.Dl efibootmgr -n -b 0009
2491285bcc8SWarner Losh.Pp
250736dcdb7SYuri PankovTo set the
251736dcdb7SYuri Pankov.Cm BootOrder
252736dcdb7SYuri Pankovfor the next reboot use:
2531285bcc8SWarner Losh.Pp
2541285bcc8SWarner Losh.Dl efibootmgr -o 0009,0003,...
2551285bcc8SWarner Losh.Sh SEE ALSO
25698b765e5SJohn-Mark Gurney.Xr efirt 9 ,
2571285bcc8SWarner Losh.Xr efivar 8 ,
258736dcdb7SYuri Pankov.Xr gpart 8 ,
259736dcdb7SYuri Pankov.Xr uefi 8
26098b765e5SJohn-Mark Gurney.Sh STANDARDS
26198b765e5SJohn-Mark GurneyThe Unified Extensible Firmware Interface Specification is available
26298b765e5SJohn-Mark Gurneyfrom
26398b765e5SJohn-Mark Gurney.Pa www.uefi.org .
264