aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/efibootmgr/efibootmgr.8
blob: 7d23365cf5688d59ec22441fc1e5890c8788a05e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.\" Copyright (c) 2017 Netflix, Inc
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 8, 2017
.Dt EFIBOOTMGR 8
.Os
.Sh NAME
.Nm efibootmgr 
.Nd manipulate the EFI Boot Manager
.Sh SYNOPSIS
.Op Fl aAnNB Ar Bootvar
.Op Fl t Ar timeout
.Op Fl T
.Op Fl o Ar bootorder
.Op Fl verbose
.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] 
.Sh "DESCRIPTION"
.Nm
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.
.Pp
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
.Va 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
.Va BootOrder .
The currently booting method is communicated using 
.Va BootCurrent .
A global timeout can also be set.
.Pp
.Nm
requires that the kernel efirt module to get and set these
non-volatile variables.
.Pp
The following options are available:
.Bl -tag -width 28m
.It Fl c Fl -create
Create a new Boot Variable
.It Fl l -loader Ar loader
The path to and name of the loader.
.It Fl k -kernel Ar kernel
The path to and name of the kernel.
.It Fl L -label Ar label
An optional description for the entry.
.It Fl D -dry-run
Process but do not set the given BootVar.
.It Fl B -delete Ar BootVarNum
Delete the given BootVar Num.
.It Fl a -activate Ar BootVarNum
Activate the given BootVarNum.
.It Fl A -deactivate Ar BootVarNum
Deactivate the given BootVarNum.
.It Fl n -bootnext  Ar BootVarNum
Set BootVarNum as the BootNext variable.
.It Fl N -delete-bootnext 
Delete the BootNext optional BootVar.
.It Fl o -bootorder Ar bootorder
Set BootOrder variable to the given comma delimited set of BootVarNums.
The numbers are in hex to match BootXXXX, but may omit leading zeros.
.It Fl t -set-timeout Ar timeout
Set the bootmenu timeout value.
.It Fl T -del-timeout
Delete the BootTimeout variable.
.It Fl v -verbose
Display the device path of BootVars in the output.
.El
.Pp
.Sh Exammples
.Pp
To Display the current Boot related variables in the system:
.Pp
.Dl efibootmgr [-v]
.Pp
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.
.Pp
The
.Nm
program can be used to create new EFI boot variables. To create a new
boot var pointing to an installation on partition 1 of device ada0 using
the given loader with a description FreeBSD-11: 
.Pp
.Dl efibootmgr -c -d ada0 -p 1 -l/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
.Pp
This will result in the next available BootVarNum being assigned to a
new UEFI load variable, and given the label "FreeBSD-11" such as:
.Pp
.Dl Boot0009 FreeBSD-11
.Pp
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.
.Pp
.Dl efibootmgr -B 0009
.Pp
Will delete the given BootVar Boot0009
.Pp
To set a given newly created BootVar active use:
.Pp
.Dl efibootmgr -a 0009
.Pp
To set a given BootVar to be used as the BootNext variable, irrespective
of its active state, use:
.Pp
.Dl efibootmgr -n 0009
.Pp
To set the BootOrder for the next reboot  use:
.Pp
.Dl efibootmgr -o 0009,0003,...
.Pp
.Sh SEE ALSO
.Xr efivar 8 ,
.Xr uefi 8 ,
.Xr gpart 8