Commit Graph

28 Commits

Author SHA1 Message Date
bcran
40f785a247 Update the efibootmgr(8) man page to document changes to options. 2019-01-01 04:57:46 +00:00
bcran
c73998516d Change the way efibootmgr works by specifying bootnum via -b parameter
Instead of passing the bootnum to each different parameter, require users
to specify -b when running operations that need a bootnum.

This allows activation of a new boot entry at the same time it's created
by adding -a onto the command line.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18648
2018-12-31 00:09:45 +00:00
bcran
1e9d96d62d Improve the efibootmgr(8) man page
Fix formatting, typos, and attempt to improve the wording.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18646
2018-12-28 21:26:45 +00:00
bcran
9ccaf63779 Activate support for efibootmgr(8) -b --bootnum parameter
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18647
2018-12-24 15:38:36 +00:00
imp
b1eb86d345 Make -a (to make the entry active) apply to creation of a new boot
variable.

Approved by: re@ (rgrimes)
PR: 231013
Differential Revision:  https://reviews.freebsd.org/D16977
2018-09-02 18:40:18 +00:00
imp
b24c750e0b Add -b bootnum to allow creation of a specific boot number (rather
than the auotmatic selection). This is important in some scripting
environments.

Also, remove bogus checks for bootnum != 0. 0 is a valid bootnum.

Sponsored by: Netflix
2018-07-27 18:18:20 +00:00
imp
99647df61b Remove ignored command line options
The --device and --part command line options were planned for Linux
compatibility mode. However, that mode will never happen, so remove
them as last vestiges of a false start.

Submitted by: Vlad Movchan
2018-05-08 20:02:44 +00:00
imp
17f87c0e1f efibootmgr.8: fix example
The example given was for the old, and now deleted, Linux
compatibility mode. Update the example for the current code.

Submitted by: Vlad Movchan
2018-05-08 20:02:39 +00:00
imp
f1d75106c3 Improve printing the boot variables.
Print the boot variables in the order in the BootOrder variable, if it
exists, and then in verbose mode print any unreferneced BootXXXX
variables. If BootOrder isn't set, fall back to printing all the
variables.

Sponsored by: Netflix
2018-05-08 19:43:57 +00:00
imp
2d507e9195 Inline print_order(). It's used one palce. 2018-05-08 18:25:37 +00:00
imp
64b1deb8c7 Make not getting BootOrder a warning, not a fatal error when printing.
Sponsored by: Netflix
2018-03-16 18:16:31 +00:00
imp
2a234cba97 Fix error in determining the next available boot slot.
Sponsored by: Netflix
2018-01-12 15:30:48 +00:00
imp
23082ef0c7 There's no need / benefit from deleting the variable before we set it.
Sponsored by: Netflix
2018-01-06 06:00:40 +00:00
imp
fe5bd3196d Fix usage strings. -d and -p were removed before this was committed to
FreeBSD, but the strings weren't updated.

Sponsored by: Netflix
2018-01-06 06:00:34 +00:00
imp
6fb458c8b6 Free options before setting them. This will prevent us from leaking
memory when we have multiple copies of the same option from being
specified.

Sponsored by: Netflix
2018-01-05 07:09:19 +00:00
imp
abc96179c1 Ensure that we have a description string. When unspecified, default to "".
Sponsored by: Netflix
2018-01-05 07:09:09 +00:00
kan
7eba7096e2 Remove write-only opt and useless optlen variables.
This squashes the warning gebnerated by GCC 6.x. Since
variables that are now removed had come documentation
value, put relevant bits in comment, so they can be
resurrected from there when actually needed.
2017-12-24 16:39:57 +00:00
imp
8aa8d9dea8 Actually insert the free(d) call missed in r326802.
Noticed by: rpokala@
2017-12-12 19:45:24 +00:00
imp
8749eeff28 Add sanity testing against maximum sane lengths for device paths for
loader and kernel.

CID: 1383608
Sponsored by: Netflix
2017-12-12 19:26:24 +00:00
imp
45bef17ee1 Free load_opt_buf after we're done with it.
CID: 1383607
Sponsored by: Netflix
2017-12-12 19:26:19 +00:00
imp
3734655b60 Fix resource leak. Free converted description after printing it.
Also minor style sort of local vars.

CID: 1383606
Sponsored by: Netflix
2017-12-12 19:26:15 +00:00
imp
22bccd4c7f Don't leak new_data.
CID: 1383605
Sponsored by: Netflix
2017-12-12 19:26:10 +00:00
imp
6ebf216419 Check return value for set_bootvar and give a good error message.
CID: 1383601
Sponsored by: Netflix
2017-12-12 19:25:54 +00:00
imp
ce0c071810 Unbreak gcc build by using (void) for functions that take no args.
Sponsored by: Netflix
2017-12-11 16:17:53 +00:00
imp
78d7c7bcc2 Indent multiple device path entries correctly.
Sponsored by: Netflix
2017-12-09 07:44:00 +00:00
imp
de17a8a35f Remove vestiges of -d and -p commands.
Fix two core dumps when optional data isn't specified.

Sponsored by: Netflix
2017-12-09 07:43:55 +00:00
imp
b537088658 Forgotten in 326725
Release Notes: Yes
2017-12-09 06:57:19 +00:00
imp
e5d45b774d Import Netflix's efibootmgr to help manage UEFI boot variables
efibootmgr manages the UEFI BootXXXX variables that implement the UEFI
Boot Manager protocol defined in the UEFI standards. It is modeled
after the Linux program of the same name with a mostly compatible set
of command line options. Since there's a fair amount of OS specifioc
code due to differeing names and methods of doing things, the
compatibility isn't 100%.

Basic functionality is implemented, though the more advanced next boot
functionality that's been defined elsewhere is unimplemented.

Submitted by: Matt Williams (with unix / efi path xlate by me)
Sponsored by: Netflix
2017-12-09 06:52:20 +00:00