aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/efivar
Commit message (Collapse)AuthorAgeFilesLines
* efivar(8): Fix a typo in a source code commentGordon Bergling2022-04-021-1/+1
| | | | | | - s/differnt/different/ MFC after: 3 days
* Correct minor typos/grammos and break long lines to fit in 80 chars.Jens Schweikhardt2022-03-121-7/+9
|
* efivar: handle error when reading --fromfileEric van Gyzen2022-02-251-1/+3
| | | | | | | | | | | | The result of read() was stored in an unsigned variable, so the test for a negative value would never work. While I'm here, print a better error message for an empty file, omitting the misleading errno message. Reported by: Coverity MFC after: 1 week Sponsored by: Dell EMC Isilon
* pkgbase: Remove libefivar package and add a efi-tools oneEmmanuel Vadot2021-09-071-0/+2
| | | | | | Put all the efi related tools into FreeBSD-efi-tools. Differential Revision: https://reviews.freebsd.org/D31803
* efivar: use bool for booleansWarner Losh2021-04-091-23/+22
| | | | | | | | | Rather than int flags we ++, use booleans for all command line args. No functional change intended. Reviewed by: markj@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29621
* efivar: Attempt to fix setting/printing/deleting EFI vars with '-' in their nameWarner Losh2021-04-091-9/+18
| | | | | | | | | | | | Due to how we're parsing UUIDs, we were disallowing setting, printing or deleting any UEFI variable with a '-' in it when you attempted to do that operation with the exact name (wildcard reporting was unaffected). Fix the parser to loop over all the dashes in the name and only give up when all possible matches are exhausted. Reviewed by: markj@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29620
* efivar: Add --quiet to not report errorsWarner Losh2021-04-092-17/+55
| | | | | | | | | Add -q/--quiet flag to the command line. With it, errors are not reported at all. Instead nothing is printed and the exit code is non-zero. Reviewed by: markj Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29619
* Comment out bogus command line entryWarner Losh2020-09-251-1/+1
| | | | | | | | Linux implements -d to mean --print-decimal. We don't implement that and use -d for --device-path. Note that. Notes: svn path=/head/; revision=366165
* Tweak output of the loader variableWarner Losh2020-09-251-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the DEVICE_PATH is <= 4 that means it's effectively empty. I have a laptop that has a BIOS that likes to generate these: 8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot2001 0000: 01 00 00 00 04 00 45 00 46 00 49 00 20 00 55 00 0010: 53 00 42 00 20 00 44 00 65 00 76 00 69 00 63 00 0020: 65 00 00 00 7f ff 04 00 52 43 which now decodes as 8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot2001 * EFI USB Device Empty path Option: 0000: 52 43 which matches my hand-decode. Add an extra newline after Option: to make it look nice. I suspect that these entries really should be VenHw entries instead, but my ability to change that is NIL, so cope with them as best we can. efibootmgr(8)'s output is fine and doesn't need adjusting. Notes: svn path=/head/; revision=366164
* Fix the --guid flag descriptionMateusz Piotrowski2020-06-181-4/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=362325
* Document the efivar --load-option optionRebecca Cran2019-03-071-2/+5
| | | | | | | | | Reviewed by: imp, kevans Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19263 Notes: svn path=/head/; revision=344862
* Add the unix path to the output of `efivar --load-option`Rebecca Cran2019-02-201-1/+10
| | | | | | | | | Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19242 Notes: svn path=/head/; revision=344337
* Regularize the Netflix copyrightWarner Losh2019-02-044-5/+2
| | | | | | | | | | | | | | | Use recent best practices for Copyright form at the top of the license: 1. Remove all the All Rights Reserved clauses on our stuff. Where we piggybacked others, use a separate line to make things clear. 2. Use "Netflix, Inc." everywhere. 3. Use a single line for the copyright for grep friendliness. 4. Use date ranges in all places for our stuff. Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files) Notes: svn path=/head/; revision=343755
* Fix pointer arithmetic botch.Warner Losh2018-10-261-3/+4
| | | | | | | | | | Pointer subtraction to find size only works with char pointers. Noticed by: jhb@ Sponsored by: Netflix, Inc Notes: svn path=/head/; revision=339801
* Require that we have at least a device path header beforeWarner Losh2018-10-261-1/+1
| | | | | | | | | trying to decode the next device path. Sponsored by: Netflix, Inc Notes: svn path=/head/; revision=339798
* Implenent --fromfile to read variable values when printing variablesWarner Losh2018-10-262-9/+42
| | | | | | | | | | | | | | | So ./efivar --fromfile Boot0001.bin --print --load-option will take the value from Boot0001.bin file and then decode it as if it were a load-option. This is useful for debugging handling of such variables that may be hanging the boot for some people. Sponsored by: Netflix, Inc Notes: svn path=/head/; revision=339797
* Iniailize str so ucs2_to_utf8 won't free stack garbage.Warner Losh2017-12-121-1/+1
| | | | | | | | CID: 1381037 Sponsored by: Netflix Notes: svn path=/head/; revision=326805
* Add forgotten libgeom.Warner Losh2017-12-021-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326472
* efivar: add missing getopt 'u' optionEd Maste2017-11-271-1/+1
| | | | Notes: svn path=/head/; revision=326287
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-141-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325834
* Simplify the efivar interface a little.Warner Losh2017-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | We started out having Linux compatible libefivar interfaces. This was in anticipation of porting the GPL'd efibootmgr to FreeBSD via a port. However, since we need that functionality in the base, that port isn't going to happened. It also appears that efivar is a private library that's not used much outside a command line util and efibootmgr. Reduce compatibility with the Linux version a little by removing the mode parameter to efi_set_variable (which was unused on FreeBSD, and not set to something useful in the code we'd written). Also remove some efi error routines that were never implemented and existed only to placate early GPL efibootmgr porting experiments. Suggested by: Matt Williams Sponsored by: Netflix Notes: svn path=/head/; revision=325684
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Create efi utility printing routinesWarner Losh2017-09-074-81/+234
| | | | | | | | | | | | Split out asciidump, utf8dump, bindump, and hexdump into a separate file efiutil.c. Implement new efi_print_load_option for printing out the EFI_LOADER_OPTION data structure used to specify different options to the UEFI boot manager. Sponsored by: Netflix Notes: svn path=/head/; revision=323260
* Add UCS2->UTF8 option.Warner Losh2017-08-313-2/+37
| | | | | | | | | | Many UEFI variables are UCS2 strings (some NUL terminated, others not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing. Sponsored by: Netflix Notes: svn path=/head/; revision=323066
* Correct the "first appeared in" version for efivar(8).Glen Barber2017-05-221-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=318643
* Updates for efivar.8Benjamin Kaduk2017-05-211-17/+15
| | | | | | | | | | | Fix spelling [1], appease igor and mandoc -Tlint, and adopt the language style to be more consistent with our corpus. PR: 219434 [1] Submitted by: olgeni [1] Notes: svn path=/head/; revision=318599
* Finish implementing -d/--device/--device-path flag to print variableWarner Losh2017-03-092-16/+37
| | | | | | | | | | | | | | | as if it were a device path. Remove language about a=b syntax on the command line. This will not be implemented due to its limited usefulness. UEFI variables are binary blobs, on the whole, and a simple work around exists for strings. Clarify that the new value of the variable is taken from stdin. Update manual with history. Sponsored by: Netflix Notes: svn path=/head/; revision=314927
* If the guid specified can't be decoded as a GUID, try looking it up inWarner Losh2017-03-031-1/+1
| | | | | | | | | the known guid to name table. Sponsored by: Netflix Notes: svn path=/head/; revision=314621
* Implement -d / --device-path to print the ascii representation of a variable ↵Warner Losh2017-03-031-0/+11
| | | | | | | | | that contains a UEFI device path. Sponsored by: Netflix Notes: svn path=/head/; revision=314620
* Implement --guid/-g to print the known GUIDs as human readable. TheWarner Losh2017-03-032-3/+27
| | | | | | | | | list of known GUIDs can be found with --list-guids. Sponsored by: Netflix Notes: svn path=/head/; revision=314619
* Actually implement efivar -LWarner Losh2017-03-031-0/+13
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=314618
* Print just the variables when we're not printing the values.Warner Losh2017-03-031-0/+2
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=314617
* Exit when we can't print a variable.Warner Losh2017-02-251-11/+10
| | | | | | | | | | | | Exit after printing a message on stderr when we can't get a message. This is slightly different than linux, but keeps shell scripts from thinking the value of the variable is the error message and so is a net win. Sponsored by: Netflix Notes: svn path=/head/; revision=314232
* DIRDEPS_BUILD: Connect new dependencies.Bryan Drewery2016-11-131-0/+19
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308605
* style(9) nit: space after |.Warner Losh2016-10-161-1/+1
| | | | Notes: svn path=/head/; revision=307390
* Implement -t. Use symbolic names in place of the magical 0x7.Warner Losh2016-10-151-2/+4
| | | | | | | Submitted by: ambrisko@ Notes: svn path=/head/; revision=307339
* 'b' is short for --binary, it isn't 'a'.Warner Losh2016-10-131-1/+1
| | | | | | | | PR: 213437 Submitted by: Ganael LAPLANCHE Notes: svn path=/head/; revision=307224
* Fix building on i386 and arm. But 'public domain' headers on the filesWarner Losh2016-10-132-4/+4
| | | | | | | | | | | with no creative content. Include "lost" changes from git: o Use /dev/efi instead of /dev/efidev o Remove redundant NULL checks. Submitted by: kib@, dim@, zbb@, emaste@ Notes: svn path=/head/; revision=307189
* Add efivar(1) to manipulate EFI variables. It uses a similar commandWarner Losh2016-10-113-0/+521
line interface to the Linux program, as well as adding a number of useful features to make using it in shell scripts easier (since we don't have a filesystem to fall back on interacting with). Differential Revision: https://reviews.freebsd.org/D8128 Reviewed by: kib@, wblock@, Ganael Laplanche Notes: svn path=/head/; revision=307072