]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/efibootmgr/efibootmgr.8
sys/{x86,amd64}: remove one of doubled ;s
[FreeBSD/FreeBSD.git] / usr.sbin / efibootmgr / efibootmgr.8
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
43 manipulates how UEFI Boot Managers boot the system.
44 Methods of booting can be created and destroyed.
45 Boot methods can be activated or deactivated.
46 The order of boot methods tried can be changed.
47 Temporary boot methods can override the usual booting methods.
48 .Pp
49 The UEFI standard defines how hosts may control what is used to
50 bootstrap the system.
51 Each method is encapsulated within a persistent UEFI variable, stored
52 by the UEFI BIOS of the form
53 .Va BootXXXX .
54 These variables are numbered, describe where to load the bootstrap
55 program from, and whether or not the method is active.
56 The boot order of these methods is controlled by another variable
57 .Va BootOrder .
58 The currently booting method is communicated using 
59 .Va BootCurrent .
60 A global timeout can also be set.
61 .Pp
62 .Nm
63 requires that the kernel efirt module be loaded to get and set these
64 non-volatile variables.
65 .Pp
66 The following options are available:
67 .Bl -tag -width 28m
68 .It Fl c Fl -create
69 Create a new Boot Variable
70 .It Fl l -loader Ar loader
71 The path to and name of the loader.
72 .It Fl k -kernel Ar kernel
73 The path to and name of the kernel.
74 .It Fl b -bootnum Ar bootnum
75 When creating or modifying an entry, use bootnum as the index.
76 When creating a new entry, fail if it already exists.
77 .It Fl L -label Ar label
78 An optional description for the entry.
79 .It Fl D -dry-run
80 Process but do not change any variables.
81 .It Fl B -delete
82 Delete the given bootnum boot entry.
83 .It Fl a -activate
84 Activate the given bootnum boot entry, or the new entry when used with -c.
85 .It Fl A -deactivate
86 Deactivate the given bootnum boot entry.
87 .It Fl n -bootnext
88 Set bootnum boot entry as the BootNext variable.
89 .It Fl N -delete-bootnext 
90 Delete the BootNext optional variable.
91 .It Fl o -bootorder Ar bootorder
92 Set BootOrder variable to the given comma delimited set of bootnums.
93 The numbers are in hex to match BootXXXX, but may omit leading zeros.
94 .It Fl t -set-timeout Ar timeout
95 Set the bootmenu timeout value.
96 .It Fl T -del-timeout
97 Delete the BootTimeout variable.
98 .It Fl v -verbose
99 Display the device path of boot entries in the output.
100 .El
101 .Pp
102 .Sh Examples
103 .Pp
104 To display the current Boot related variables in the system:
105 .Pp
106 .Dl efibootmgr [-v]
107 .Pp
108 This will display the optional BootNext bootnum, BootCurrent,
109 or currently booted bootnum, followed by the optional Timeout value, any
110 BootOrder that may be set, followed finally by all currently defined Boot
111 variables, active or not. The verbose flag will augment this output with
112 the disk partition uuids, size/offset and device-path of the
113 variable.
114 .Pp
115 The
116 .Nm
117 program can be used to create new EFI boot variables. To create a new
118 boot var pointing to an installation with its EFI partition mounted
119 under /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
123 This will result in the next available bootnum being assigned to a
124 new UEFI boot variable, and given the label "FreeBSD-11" such as:
125 .Pp
126 .Dl Boot0009 FreeBSD-11
127 .Pp
128 Note newly created boot entries are created inactive. The active state is denoted
129 by an '*' following the BootXXXX name in the output.  They are also inserted
130 into the first position of current BootOrder variable if it exists. They
131 must first be set to active before being considered available to attempt booting from, else they
132 are ignored.
133 .Pp
134 .Dl efibootmgr -B -b 0009
135 .Pp
136 Will delete the given boot entry Boot0009
137 .Pp
138 To set a given newly created boot entry active use:
139 .Pp
140 .Dl efibootmgr -a -b 0009
141 .Pp
142 To set a given boot entry to be used as the BootNext variable, irrespective
143 of its active state, use:
144 .Pp
145 .Dl efibootmgr -n -b 0009
146 .Pp
147 To 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