1.\" Copyright (c) 2017 Netflix, Inc 2.\" All rights reserved. 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 8, 2017 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 Ar Bootvar 35.Op Fl t Ar timeout 36.Op Fl T 37.Op Fl o Ar bootorder 38.Op Fl verbose 39.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] 40.Sh "DESCRIPTION" 41.Nm 42manipulates how UEFI Boot Managers boot the system. 43Methods of booting can be created and destroyed. 44Boot methods can be activated or deactivated. 45The order of boot methods tried can be changed. 46Temporary boot methods can override the usual booting methods. 47.Pp 48The UEFI standard defines how hosts may control what is used to 49bootstrap the system. 50Each method is encapsulated within a persistent UEFI variable, stored 51by the UEFI BIOS of the form 52.Va BootXXXX . 53These variables are numbered, describe where to load the bootstrap 54program from, and whether or not the method is active. 55The boot order of these methods is controlled by another variable 56.Va BootOrder . 57The currently booting method is communicated using 58.Va BootCurrent . 59A global timeout can also be set. 60.Pp 61.Nm 62requires that the kernel efirt module to get and set these 63non-volatile variables. 64.Pp 65The following options are available: 66.Bl -tag -width 28m 67.It Fl c Fl -create 68Create a new Boot Variable 69.It Fl l -loader Ar loader 70The path to and name of the loader. 71.It Fl k -kernel Ar kernel 72The path to and name of the kernel. 73.It Fl L -label Ar label 74An optional description for the entry. 75.It Fl D -dry-run 76Process but do not set the given BootVar. 77.It Fl B -delete Ar BootVarNum 78Delete the given BootVar Num. 79.It Fl a -activate Ar BootVarNum 80Activate the given BootVarNum. 81.It Fl A -deactivate Ar BootVarNum 82Deactivate the given BootVarNum. 83.It Fl n -bootnext Ar BootVarNum 84Set BootVarNum as the BootNext variable. 85.It Fl N -delete-bootnext 86Delete the BootNext optional BootVar. 87.It Fl o -bootorder Ar bootorder 88Set BootOrder variable to the given comma delimited set of BootVarNums. 89The numbers are in hex to match BootXXXX, but may omit leading zeros. 90.It Fl t -set-timeout Ar timeout 91Set the bootmenu timeout value. 92.It Fl T -del-timeout 93Delete the BootTimeout variable. 94.It Fl v -verbose 95Display the device path of BootVars in the output. 96.El 97.Pp 98.Sh Exammples 99.Pp 100To Display the current Boot related variables in the system: 101.Pp 102.Dl efibootmgr [-v] 103.Pp 104This will display the optional BootNext BootVar, BootCurrent, 105or currently booted BootVar, followed by the optional Timeout value, any 106BootOrder that maybe set, followed finally by all currently defined Boot 107variables, active or not. The verbose flag will augment this output with 108the hardrive partition uuids, size/offset and device-path of the 109variable. 110.Pp 111The 112.Nm 113program can be used to create new EFI boot variables. To create a new 114boot var pointing to an installation on partition 1 of device ada0 using 115the given loader with a description FreeBSD-11: 116.Pp 117.Dl efibootmgr -c -d ada0 -p 1 -l/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11 118.Pp 119This will result in the next available BootVarNum being assigned to a 120new UEFI load variable, and given the label "FreeBSD-11" such as: 121.Pp 122.Dl Boot0009 FreeBSD-11 123.Pp 124Note newly created BootVars are created inactive. The active state is denoted 125by an '*' following the BootVar name in the output. They are also inserted 126into the first position of current BootOrder variable if it exists. They 127must first be set to active before being considered available to attempt booting from, else they 128are ignored. 129.Pp 130.Dl efibootmgr -B 0009 131.Pp 132Will delete the given BootVar Boot0009 133.Pp 134To set a given newly created BootVar active use: 135.Pp 136.Dl efibootmgr -a 0009 137.Pp 138To set a given BootVar to be used as the BootNext variable, irrespective 139of its active state, use: 140.Pp 141.Dl efibootmgr -n 0009 142.Pp 143To set the BootOrder for the next reboot use: 144.Pp 145.Dl efibootmgr -o 0009,0003,... 146.Pp 147.Sh SEE ALSO 148.Xr efivar 8 , 149.Xr uefi 8 , 150.Xr gpart 8 151