xref: /freebsd/usr.sbin/efibootmgr/efibootmgr.8 (revision 0957b409)
1.\"
2.\" Copyright (c) 2017-2018 Netflix, Inc.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd December 28, 2018
28.Dt EFIBOOTMGR 8
29.Os
30.Sh NAME
31.Nm efibootmgr
32.Nd manipulate the EFI Boot Manager
33.Sh SYNOPSIS
34.Op Fl aAnNB
35.Op Fl b Ar bootnum
36.Op Fl t Ar timeout
37.Op Fl T
38.Op Fl o Ar bootorder
39.Op Fl v
40.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ]
41.Sh "DESCRIPTION"
42.Nm
43manipulates how UEFI Boot Managers boot the system.
44Methods of booting can be created and destroyed.
45Boot methods can be activated or deactivated.
46The order of boot methods tried can be changed.
47Temporary boot methods can override the usual booting methods.
48.Pp
49The UEFI standard defines how hosts may control what is used to
50bootstrap the system.
51Each method is encapsulated within a persistent UEFI variable, stored
52by the UEFI BIOS of the form
53.Va BootXXXX .
54These variables are numbered, describe where to load the bootstrap
55program from, and whether or not the method is active.
56The boot order of these methods is controlled by another variable
57.Va BootOrder .
58The currently booting method is communicated using
59.Va BootCurrent .
60A global timeout can also be set.
61.Pp
62.Nm
63requires that the kernel efirt module be loaded to get and set these
64non-volatile variables.
65.Pp
66The following options are available:
67.Bl -tag -width 28m
68.It Fl c Fl -create
69Create a new Boot Variable
70.It Fl l -loader Ar loader
71The path to and name of the loader.
72.It Fl k -kernel Ar kernel
73The path to and name of the kernel.
74.It Fl b -bootnum Ar bootnum
75When creating or modifying an entry, use bootnum as the index.
76When creating a new entry, fail if it already exists.
77.It Fl L -label Ar label
78An optional description for the entry.
79.It Fl D -dry-run
80Process but do not change any variables.
81.It Fl B -delete
82Delete the given bootnum boot entry.
83.It Fl a -activate
84Activate the given bootnum boot entry, or the new entry when used with -c.
85.It Fl A -deactivate
86Deactivate the given bootnum boot entry.
87.It Fl n -bootnext
88Set bootnum boot entry as the BootNext variable.
89.It Fl N -delete-bootnext
90Delete the BootNext optional variable.
91.It Fl o -bootorder Ar bootorder
92Set BootOrder variable to the given comma delimited set of bootnums.
93The numbers are in hex to match BootXXXX, but may omit leading zeros.
94.It Fl t -set-timeout Ar timeout
95Set the bootmenu timeout value.
96.It Fl T -del-timeout
97Delete the BootTimeout variable.
98.It Fl v -verbose
99Display the device path of boot entries in the output.
100.El
101.Pp
102.Sh Examples
103.Pp
104To display the current Boot related variables in the system:
105.Pp
106.Dl efibootmgr [-v]
107.Pp
108This will display the optional BootNext bootnum, BootCurrent,
109or currently booted bootnum, followed by the optional Timeout value, any
110BootOrder that may be set, followed finally by all currently defined Boot
111variables, active or not. The verbose flag will augment this output with
112the disk partition uuids, size/offset and device-path of the
113variable.
114.Pp
115The
116.Nm
117program can be used to create new EFI boot variables. To create a new
118boot var pointing to an installation with its EFI partition mounted
119under /mnt, the given loader and a label "FreeBSD-11":
120.Pp
121.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11
122.Pp
123This will result in the next available bootnum being assigned to a
124new UEFI boot variable, and given the label "FreeBSD-11" such as:
125.Pp
126.Dl Boot0009 FreeBSD-11
127.Pp
128Note newly created boot entries are created inactive. The active state is denoted
129by an '*' following the BootXXXX name in the output.  They are also inserted
130into the first position of current BootOrder variable if it exists. They
131must first be set to active before being considered available to attempt booting from, else they
132are ignored.
133.Pp
134.Dl efibootmgr -B -b 0009
135.Pp
136Will delete the given boot entry Boot0009
137.Pp
138To set a given newly created boot entry active use:
139.Pp
140.Dl efibootmgr -a -b 0009
141.Pp
142To set a given boot entry to be used as the BootNext variable, irrespective
143of its active state, use:
144.Pp
145.Dl efibootmgr -n -b 0009
146.Pp
147To set the BootOrder for the next reboot  use:
148.Pp
149.Dl efibootmgr -o 0009,0003,...
150.Pp
151.Sh SEE ALSO
152.Xr efivar 8 ,
153.Xr uefi 8 ,
154.Xr gpart 8
155