From 6aa1b4332f6c0b1d97599996beab32e45d0d0de4 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 17 Dec 2023 21:32:15 -0700 Subject: [PATCH] efibootmgr: Document -e command line switch -e env will include `env` in the boot loader. Document that the boot loader appends the `env` to the BootXXXX variable, and will parse it as a series of a=b values to set in the boot loader's environment. These assignments are separated by spaces. The env arg needs to be quoted if more than one env var is to be set (we parse only the next argument on the command line). Sponsored by: Netflix --- usr.sbin/efibootmgr/efibootmgr.8 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.8 b/usr.sbin/efibootmgr/efibootmgr.8 index 5805b797ff5c..f74ee8a2e634 100644 --- a/usr.sbin/efibootmgr/efibootmgr.8 +++ b/usr.sbin/efibootmgr/efibootmgr.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 26, 2023 +.Dd December 17, 2023 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -130,6 +130,21 @@ Create a new variable (aka method or entry). .It Fl D -dry-run Process but do not change any variables. +.It Fl e -env +When creating a +.Cm Boot +variable, include a set of environment variables for the loader to set after +parsing the command line. +Variables are of the form +.Dq a=b +and separated by spaces. +The argument should be quoted. +.Nm appends these to the end of the +.Cm Boot +environment variable. +Before processing anything else, +.Xr loader.efi 8 +will parse this area and set all variables found there. .It Fl E -esp Print the .Fx @@ -216,16 +231,16 @@ the EFI partition mounted under .Pa /boot/efi , mark the method active, using the given loader and label the method -.Qq FreeBSD-11 : +.Qq FreeBSD-15 : .Pp -.Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-11 +.Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15 .Pp This will result in the next available bootnum being assigned to a new UEFI boot variable, and given the label -.Qq FreeBSD-11 +.Qq FreeBSD-15 such as: .Pp -.Dl Boot0009 FreeBSD-11 +.Dl Boot0009 FreeBSD-15 .Pp Note newly created boot entries are, by default, created inactive, hence the reason