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 May 8, 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 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] [-b Bootvar] 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 b Bootvar 74When creating an entry, use Bootvar as the index. 75Fail if it already exists. 76.It Fl L -label Ar label 77An optional description for the entry. 78.It Fl D -dry-run 79Process but do not set the given BootVar. 80.It Fl B -delete Ar BootVarNum 81Delete the given BootVar Num. 82.It Fl a -activate Ar BootVarNum 83Activate the given BootVarNum. 84.It Fl A -deactivate Ar BootVarNum 85Deactivate the given BootVarNum. 86.It Fl n -bootnext Ar BootVarNum 87Set BootVarNum as the BootNext variable. 88.It Fl N -delete-bootnext 89Delete the BootNext optional BootVar. 90.It Fl o -bootorder Ar bootorder 91Set BootOrder variable to the given comma delimited set of BootVarNums. 92The numbers are in hex to match BootXXXX, but may omit leading zeros. 93.It Fl t -set-timeout Ar timeout 94Set the bootmenu timeout value. 95.It Fl T -del-timeout 96Delete the BootTimeout variable. 97.It Fl v -verbose 98Display the device path of BootVars in the output. 99.El 100.Pp 101.Sh Exammples 102.Pp 103To Display the current Boot related variables in the system: 104.Pp 105.Dl efibootmgr [-v] 106.Pp 107This will display the optional BootNext BootVar, BootCurrent, 108or currently booted BootVar, followed by the optional Timeout value, any 109BootOrder that maybe set, followed finally by all currently defined Boot 110variables, active or not. The verbose flag will augment this output with 111the hardrive partition uuids, size/offset and device-path of the 112variable. 113.Pp 114The 115.Nm 116program can be used to create new EFI boot variables. To create a new 117boot var pointing to an installation with its EFI partition mounted 118under /mnt, the given loader and a label "FreeBSD-11": 119.Pp 120.Dl efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11 121.Pp 122This will result in the next available BootVarNum being assigned to a 123new UEFI load variable, and given the label "FreeBSD-11" such as: 124.Pp 125.Dl Boot0009 FreeBSD-11 126.Pp 127Note newly created BootVars are created inactive. The active state is denoted 128by an '*' following the BootVar name in the output. They are also inserted 129into the first position of current BootOrder variable if it exists. They 130must first be set to active before being considered available to attempt booting from, else they 131are ignored. 132.Pp 133.Dl efibootmgr -B 0009 134.Pp 135Will delete the given BootVar Boot0009 136.Pp 137To set a given newly created BootVar active use: 138.Pp 139.Dl efibootmgr -a 0009 140.Pp 141To set a given BootVar to be used as the BootNext variable, irrespective 142of its active state, use: 143.Pp 144.Dl efibootmgr -n 0009 145.Pp 146To set the BootOrder for the next reboot use: 147.Pp 148.Dl efibootmgr -o 0009,0003,... 149.Pp 150.Sh SEE ALSO 151.Xr efivar 8 , 152.Xr uefi 8 , 153.Xr gpart 8 154