efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 caseIf cnt == 0 we access element 0 unconditionally, which is out of bounds,and then if that doesn't crash and happens to be 0 we will
efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 caseIf cnt == 0 we access element 0 unconditionally, which is out of bounds,and then if that doesn't crash and happens to be 0 we will accesselement - 1, also out of bounds, and then if that doesn't crash will add1 to whatever junk is there and use that for the variable. On CHERI,though, this does crash. This code is also overly complicated, withunnecessary special cases and tracking more state than needed.Rewrite it in a more general manner that doesn't need those specialcases and naturally works for cnt == 0.Found by: CHERIReviewed by: impFixes: 1285bcc833a3 ("Import Netflix's efibootmgr to help manage UEFI boot variables")MFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D44029(cherry picked from commit 09cb8031b43c8e98abb5ff9b43ff649031d1e808)
show more ...
efibootmgr: allow -u as a valid optionPR: 277907Reported by: [email protected]MFC after: 1 week(cherry picked from commit 65904399db9167b0970e42e14642e1d6bdbf6d3a)
efibootmgr: fix potential endless loop with -vI observed the problem on a system with fairly old and, apparently,buggy EFI implementation. A list of boot devices had an invalidtrailing entry. e
efibootmgr: fix potential endless loop with -vI observed the problem on a system with fairly old and, apparently,buggy EFI implementation. A list of boot devices had an invalidtrailing entry. efidp_size() for that entry returned zero, which meansthat the code got stuck looping on that entry.(cherry picked from commit bf87d4a4bfaa86e97079754e93fe14595adf07c5)
efibootmgr: provide explicit error message if run as non-rootThis should be less confusing for new users.Reviewed by: impSponsored by: The FreeBSD FoundationDifferential Revision: https://revie
efibootmgr: provide explicit error message if run as non-rootThis should be less confusing for new users.Reviewed by: impSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D42213(cherry picked from commit c08ba4a588d517e3c5fe00cee0927294d2490993)
Remove $FreeBSD$: two-line nroff patternRemove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
base: Remove support for the VTOC8 partitioning schemeThe removal of the sparc64 support in February 2020 obsoleted theVTOC8 partitioning scheme as no other FreeBSD platform makes useof it. Moreo
base: Remove support for the VTOC8 partitioning schemeThe removal of the sparc64 support in February 2020 obsoleted theVTOC8 partitioning scheme as no other FreeBSD platform makes useof it. Moreover, the code is bitrotting as nothing defines e. g.LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. Withthis change, the following commits are reverted as far as VTOC8is concerned and parts haven't already previously been deletedalong with prior sparc64 removals:094fcb157d4c98211899cf09d06e2cf19149b7e0a7d366e9589c95feda6f3bc78c59c6355d51f126ba8d50d08b9df4e8213f9a6997ff6792ecebcd9bThe alignment example d9711c28efc4ec89ba5ea11f8fd63e9d0a7fc81badded to the VTOC8 section of gpart.8 is folded into the MBR one.This should finally conclude the deorbit of sparc64-specific bits. We had joy, we had fun we ran Unix on a Sun. But that source and the song of FreeBSD have all gone.Credits to Michael Bueker for the original "Unix on a Sun" and RodMcKuen for the "Seasons in the Sun" lyrics.
efibootmgr: add missing break for 'u' caseReviewed by: imp, zleiReported by: CoverityCID: 1505695Fixes: 9a7915299484 ("efibootmgr: Add --efidev (-u) to dis...")Sponsored by: The FreeBSD Found
efibootmgr: add missing break for 'u' caseReviewed by: imp, zleiReported by: CoverityCID: 1505695Fixes: 9a7915299484 ("efibootmgr: Add --efidev (-u) to dis...")Sponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D38747
efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file"efibootmgr --efidev unix-path" will return the UEFI device-path to thefile or device specified by unix-path. It's usef
efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file"efibootmgr --efidev unix-path" will return the UEFI device-path to thefile or device specified by unix-path. It's useful for debugging, butmay also be useful for scripting.Sponsored by: NetflixReviewed by: corvink, manuDifferential Revision: https://reviews.freebsd.org/D38617
efibootmgr: Use the hier(7) ESP mount point in examplesMFC after: 1 week
pkgbase: Remove libefivar package and add a efi-tools onePut all the efi related tools into FreeBSD-efi-tools.Differential Revision: https://reviews.freebsd.org/D31803
efibootmgr: Check for efi supported after parsing argsMove the check for efi variables being supported to after parsing the args. Thisallows '-h' to produce both as a normal user as well as on all
efibootmgr: Check for efi supported after parsing argsMove the check for efi variables being supported to after parsing the args. Thisallows '-h' to produce both as a normal user as well as on all systems.
efibootmgr: fix an incorrect error handling checkefivar_device_path_to_unix_path() returns standard error codes onfailure and zero on success. Checking for a return value less than zeromeans that
efibootmgr: fix an incorrect error handling checkefivar_device_path_to_unix_path() returns standard error codes onfailure and zero on success. Checking for a return value less than zeromeans that the actual failure cases won't be handled. This couldmanifest as a segfault during the subsequent call to printf().Reviewed by: impMFC after: 3 daysDifferential Revision: https://reviews.freebsd.org/D27424
efibootmgr: Use returned error code for error message, not errnoefivar_unix_path_to_device_path returns the error code, it does not set errno.Reviewed by: impMFC after: 1 weekDifferential Revis
efibootmgr: Use returned error code for error message, not errnoefivar_unix_path_to_device_path returns the error code, it does not set errno.Reviewed by: impMFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D26852
efibootmgr: wrong check for opts.orderopts.order && !(opts.order) does not really make sense.Reported by: swildner
efibootmgr: Add option to request booting to the firmware user interfaceThe OsIndications UEFI variable can request the firware to stop atits UI instead of continuing with boot. Add flags for sett
efibootmgr: Add option to request booting to the firmware user interfaceThe OsIndications UEFI variable can request the firware to stop atits UI instead of continuing with boot. Add flags for setting andclearing this request.Reviewed by: manu, bcr (manpages)Approved by: scottl (implicit)MFC after: 1 weekSponsored by: Ampere Computing, Inc.Differential Revision: https://reviews.freebsd.org/D25839
update example to make it active when creating a new boot method...Clean up some of the sentences and grammar...make igor happy..
efibootmgr: typo in long option namedel-timout should be del-timeoutReported by: mjgMFC after: 1 week
Add --esp/-E argument to print the currently booted ESPAdd code to decode the BootCurrent and BootXXXX variable it points atto deduce the ESP used to boot the system. By default, it prints thepat
Add --esp/-E argument to print the currently booted ESPAdd code to decode the BootCurrent and BootXXXX variable it points atto deduce the ESP used to boot the system. By default, it prints thepath to that device. With --unix-path (-p) it will instead print thecurrent mount point for the ESP, if any (or an error). With--device-path (-d) it wil print the UEFI device path for the ESP.Note: This is the best guess based on the UEFI variables. If the ESPis part of a gmirror, etc, that won't be reported. If by some weirdchance there was a complicated series of chain boots, this may not bewhat you want. For setups that don't add layers on top of the rawdevices, it is accurate.Differential Revision: https://reviews.freebsd.org/D22432
efibootmgr(8): fix markup and style issues- split synopsis into separate options that can't be used together- sort options- fix (style) issues reported by mandoc lintReviewed by: impDifferenti
efibootmgr(8): fix markup and style issues- split synopsis into separate options that can't be used together- sort options- fix (style) issues reported by mandoc lintReviewed by: impDifferential Revision: https://reviews.freebsd.org/D21710
efibootmgr: Do not add the new boot entry in dry-run is specifiedWhile here fix a typo.Sponsored-by: Ampere Computing, LLCReviewed by: impDifferential Revision: https://reviews.freebsd.org/D202
efibootmgr: Do not add the new boot entry in dry-run is specifiedWhile here fix a typo.Sponsored-by: Ampere Computing, LLCReviewed by: impDifferential Revision: https://reviews.freebsd.org/D20212
Regularize the Netflix copyrightUse recent best practices for Copyright form at the top ofthe license:1. Remove all the All Rights Reserved clauses on our stuff. Where we piggybacked others, u
Regularize the Netflix copyrightUse recent best practices for Copyright form at the top ofthe 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)
Update the efibootmgr(8) man page to document changes to options.
Change the way efibootmgr works by specifying bootnum via -b parameterInstead of passing the bootnum to each different parameter, require usersto specify -b when running operations that need a boo
Change the way efibootmgr works by specifying bootnum via -b parameterInstead of passing the bootnum to each different parameter, require usersto specify -b when running operations that need a bootnum.This allows activation of a new boot entry at the same time it's createdby adding -a onto the command line.Sponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D18648
123