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*736dcdb7SYuri Pankov.Dd September 24, 2019 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 34*736dcdb7SYuri Pankov.Nm 35557a5ad4SRebecca Cran.Op Fl v 36*736dcdb7SYuri Pankov.Nm 37*736dcdb7SYuri Pankov.Fl a 38*736dcdb7SYuri Pankov.Fl b Ar bootnum 39*736dcdb7SYuri Pankov.Nm 40*736dcdb7SYuri Pankov.Fl A 41*736dcdb7SYuri Pankov.Fl b Ar bootnum 42*736dcdb7SYuri Pankov.Nm 43*736dcdb7SYuri Pankov.Fl B 44*736dcdb7SYuri Pankov.Fl b Ar bootnum 45*736dcdb7SYuri Pankov.Nm 46*736dcdb7SYuri Pankov.Fl c 47*736dcdb7SYuri Pankov.Fl l Ar loader 48*736dcdb7SYuri Pankov.Op Fl aD 49*736dcdb7SYuri Pankov.Op Fl b Ar bootnum 50*736dcdb7SYuri Pankov.Op Fl k Ar kernel 51*736dcdb7SYuri Pankov.Op Fl L Ar label 52*736dcdb7SYuri Pankov.Nm 53*736dcdb7SYuri Pankov.Fl n 54*736dcdb7SYuri Pankov.Fl b Ar bootnum 55*736dcdb7SYuri Pankov.Nm 56*736dcdb7SYuri Pankov.Fl N 57*736dcdb7SYuri Pankov.Nm 58*736dcdb7SYuri Pankov.Fl o Ar bootorder 59*736dcdb7SYuri Pankov.Nm 60*736dcdb7SYuri Pankov.Fl t Ar timeout 61*736dcdb7SYuri Pankov.Nm 62*736dcdb7SYuri Pankov.Fl T 631285bcc8SWarner Losh.Sh "DESCRIPTION" 641285bcc8SWarner Losh.Nm 651285bcc8SWarner Loshmanipulates how UEFI Boot Managers boot the system. 661285bcc8SWarner LoshMethods of booting can be created and destroyed. 671285bcc8SWarner LoshBoot methods can be activated or deactivated. 681285bcc8SWarner LoshThe order of boot methods tried can be changed. 691285bcc8SWarner LoshTemporary boot methods can override the usual booting methods. 701285bcc8SWarner Losh.Pp 711285bcc8SWarner LoshThe UEFI standard defines how hosts may control what is used to 721285bcc8SWarner Loshbootstrap the system. 731285bcc8SWarner LoshEach method is encapsulated within a persistent UEFI variable, stored 741285bcc8SWarner Loshby the UEFI BIOS of the form 75*736dcdb7SYuri Pankov.Cm Boot Ns Em XXXX . 761285bcc8SWarner LoshThese variables are numbered, describe where to load the bootstrap 771285bcc8SWarner Loshprogram from, and whether or not the method is active. 781285bcc8SWarner LoshThe boot order of these methods is controlled by another variable 79*736dcdb7SYuri Pankov.Cm BootOrder . 801285bcc8SWarner LoshThe currently booting method is communicated using 81*736dcdb7SYuri Pankov.Cm BootCurrent . 821285bcc8SWarner LoshA global timeout can also be set. 831285bcc8SWarner Losh.Pp 841285bcc8SWarner Losh.Nm 85557a5ad4SRebecca Cranrequires that the kernel efirt module be loaded to get and set these 861285bcc8SWarner Loshnon-volatile variables. 871285bcc8SWarner Losh.Pp 881285bcc8SWarner LoshThe following options are available: 89*736dcdb7SYuri Pankov.Bl -tag -width Ds 90*736dcdb7SYuri Pankov.It Fl a -activate 91*736dcdb7SYuri PankovActivate the given 92*736dcdb7SYuri Pankov.Ar bootnum 93*736dcdb7SYuri Pankovboot entry, or the new entry when used with 94*736dcdb7SYuri Pankov.Fl c . 95*736dcdb7SYuri Pankov.It Fl A -deactivate 96*736dcdb7SYuri PankovDeactivate the given 97*736dcdb7SYuri Pankov.Ar bootnum 98*736dcdb7SYuri Pankovboot entry. 99557a5ad4SRebecca Cran.It Fl b -bootnum Ar bootnum 100*736dcdb7SYuri PankovWhen creating or modifying an entry, use 101*736dcdb7SYuri Pankov.Ar bootnum 102*736dcdb7SYuri Pankovas the index. 10370de14d8SRebecca CranWhen creating a new entry, fail if it already exists. 104*736dcdb7SYuri Pankov.It Fl B -delete 105*736dcdb7SYuri PankovDelete the given 106*736dcdb7SYuri Pankov.Ar bootnum 107*736dcdb7SYuri Pankovboot entry. 108*736dcdb7SYuri Pankov.It Fl c -create 109*736dcdb7SYuri PankovCreate a new 110*736dcdb7SYuri Pankov.Cm Boot 111*736dcdb7SYuri Pankovvariable. 1121285bcc8SWarner Losh.It Fl D -dry-run 113557a5ad4SRebecca CranProcess but do not change any variables. 114*736dcdb7SYuri Pankov.It Fl k -kernel Ar kernel 115*736dcdb7SYuri PankovThe path to and name of the kernel. 116*736dcdb7SYuri Pankov.It Fl l -loader Ar loader 117*736dcdb7SYuri PankovThe path to and name of the loader. 118*736dcdb7SYuri Pankov.It Fl L -label Ar label 119*736dcdb7SYuri PankovAn optional description for the entry. 12070de14d8SRebecca Cran.It Fl n -bootnext 121*736dcdb7SYuri PankovSet 122*736dcdb7SYuri Pankov.Ar bootnum 123*736dcdb7SYuri Pankovboot entry as the 124*736dcdb7SYuri Pankov.Cm BootNext 125*736dcdb7SYuri Pankovvariable. 1261285bcc8SWarner Losh.It Fl N -delete-bootnext 127*736dcdb7SYuri PankovDelete the 128*736dcdb7SYuri Pankov.Cm BootNext 129*736dcdb7SYuri Pankovoptional variable. 1301285bcc8SWarner Losh.It Fl o -bootorder Ar bootorder 131*736dcdb7SYuri PankovSet 132*736dcdb7SYuri Pankov.Cm BootOrder 133*736dcdb7SYuri Pankovvariable to the given comma delimited set of 134*736dcdb7SYuri Pankov.Ar bootnum Ns s . 135*736dcdb7SYuri PankovThe numbers are in hex to match 136*736dcdb7SYuri Pankov.Cm Boot Ns Em XXXX , 137*736dcdb7SYuri Pankovbut may omit leading zeros. 1381285bcc8SWarner Losh.It Fl t -set-timeout Ar timeout 1391285bcc8SWarner LoshSet the bootmenu timeout value. 1401285bcc8SWarner Losh.It Fl T -del-timeout 141*736dcdb7SYuri PankovDelete the 142*736dcdb7SYuri Pankov.Cm BootTimeout 143*736dcdb7SYuri Pankovvariable. 1441285bcc8SWarner Losh.It Fl v -verbose 145557a5ad4SRebecca CranDisplay the device path of boot entries in the output. 1461285bcc8SWarner Losh.El 147557a5ad4SRebecca Cran.Sh Examples 148*736dcdb7SYuri PankovTo display the current 149*736dcdb7SYuri Pankov.Cm Boot 150*736dcdb7SYuri Pankovrelated variables in the system: 1511285bcc8SWarner Losh.Pp 1521285bcc8SWarner Losh.Dl efibootmgr [-v] 1531285bcc8SWarner Losh.Pp 154*736dcdb7SYuri PankovThis will display the optional 155*736dcdb7SYuri Pankov.Cm BootNext 156*736dcdb7SYuri Pankovbootnum, 157*736dcdb7SYuri Pankov.Cm BootCurrent , 158*736dcdb7SYuri Pankovor currently booted bootnum, followed by the optional 159*736dcdb7SYuri Pankov.Cm Timeout 160*736dcdb7SYuri Pankovvalue, any 161*736dcdb7SYuri Pankov.Cm BootOrder 162*736dcdb7SYuri Pankovthat may be set, followed finally by all currently defined 163*736dcdb7SYuri Pankov.Cm Boot 164*736dcdb7SYuri Pankovvariables, active or not. 165*736dcdb7SYuri PankovThe verbose flag will augment this output with the disk partition uuids, 166*736dcdb7SYuri Pankovsize/offset and device-path of the variable. 1671285bcc8SWarner Losh.Pp 1681285bcc8SWarner LoshThe 1691285bcc8SWarner Losh.Nm 170*736dcdb7SYuri Pankovprogram can be used to create new EFI boot variables. 171*736dcdb7SYuri PankovTo create a new boot var pointing to an installation with its EFI partition 172*736dcdb7SYuri Pankovmounted under 173*736dcdb7SYuri Pankov.Pa /mnt , 174*736dcdb7SYuri Pankovthe given loader and a label 175*736dcdb7SYuri Pankov.Qq FreeBSD-11 : 1761285bcc8SWarner Losh.Pp 177557a5ad4SRebecca Cran.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11 1781285bcc8SWarner Losh.Pp 179557a5ad4SRebecca CranThis will result in the next available bootnum being assigned to a 180*736dcdb7SYuri Pankovnew UEFI boot variable, and given the label 181*736dcdb7SYuri Pankov.Qq FreeBSD-11 182*736dcdb7SYuri Pankovsuch as: 1831285bcc8SWarner Losh.Pp 1841285bcc8SWarner Losh.Dl Boot0009 FreeBSD-11 1851285bcc8SWarner Losh.Pp 186*736dcdb7SYuri PankovNote newly created boot entries are created inactive. 187*736dcdb7SYuri PankovThe active state is denoted by an '*' following the 188*736dcdb7SYuri Pankov.Cm Boot Ns Em XXXX 189*736dcdb7SYuri Pankovname in the output. 190*736dcdb7SYuri PankovThey are also inserted into the first position of current 191*736dcdb7SYuri Pankov.Cm BootOrder 192*736dcdb7SYuri Pankovvariable if it exists. 193*736dcdb7SYuri PankovThey must first be set to active before being considered available to attempt 194*736dcdb7SYuri Pankovbooting from, else they are ignored. 1951285bcc8SWarner Losh.Pp 19670de14d8SRebecca Cran.Dl efibootmgr -B -b 0009 1971285bcc8SWarner Losh.Pp 198*736dcdb7SYuri PankovWill delete the given boot entry Boot0009. 1991285bcc8SWarner Losh.Pp 200557a5ad4SRebecca CranTo set a given newly created boot entry active use: 2011285bcc8SWarner Losh.Pp 20270de14d8SRebecca Cran.Dl efibootmgr -a -b 0009 2031285bcc8SWarner Losh.Pp 204*736dcdb7SYuri PankovTo set a given boot entry to be used as the 205*736dcdb7SYuri Pankov.Cm BootNext 206*736dcdb7SYuri Pankovvariable, irrespective of its active state, use: 2071285bcc8SWarner Losh.Pp 20870de14d8SRebecca Cran.Dl efibootmgr -n -b 0009 2091285bcc8SWarner Losh.Pp 210*736dcdb7SYuri PankovTo set the 211*736dcdb7SYuri Pankov.Cm BootOrder 212*736dcdb7SYuri Pankovfor the next reboot use: 2131285bcc8SWarner Losh.Pp 2141285bcc8SWarner Losh.Dl efibootmgr -o 0009,0003,... 2151285bcc8SWarner Losh.Sh SEE ALSO 2161285bcc8SWarner Losh.Xr efivar 8 , 217*736dcdb7SYuri Pankov.Xr gpart 8 , 218*736dcdb7SYuri Pankov.Xr uefi 8 219