]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add --esp/-E argument to print the currently booted ESP
authorWarner Losh <imp@FreeBSD.org>
Wed, 20 Nov 2019 23:58:36 +0000 (23:58 +0000)
committerWarner Losh <imp@FreeBSD.org>
Wed, 20 Nov 2019 23:58:36 +0000 (23:58 +0000)
commit1cdb8eb8fe16025c151957b05202320e3f1c9a78
tree7920f3550993a689a8d2fc576d3ad8f4bb788e70
parent9af6c78cd43b18e169f10802142c61638bd62bed
Add --esp/-E argument to print the currently booted ESP

Add code to decode the BootCurrent and BootXXXX variable it points at
to deduce the ESP used to boot the system. By default, it prints the
path to that device. With --unix-path (-p) it will instead print the
current 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 ESP
is part of a gmirror, etc, that won't be reported. If by some weird
chance there was a complicated series of chain boots, this may not be
what you want. For setups that don't add layers on top of the raw
devices, it is accurate.

Differential Revision: https://reviews.freebsd.org/D22432
usr.sbin/efibootmgr/efibootmgr.8
usr.sbin/efibootmgr/efibootmgr.c