diff --git a/usr.sbin/efibootmgr/efibootmgr.8 b/usr.sbin/efibootmgr/efibootmgr.8 index fc8da06719c5..5805b797ff5c 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 February 15, 2023 +.Dd October 26, 2023 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -115,6 +115,11 @@ When creating or modifying an entry, use .Ar bootnum as the index. When creating a new entry, fail if it already exists. +For convenience, if +.Ar bootnum +is prefixed with +.Dq boot , +that prefix is ignored. .It Fl B -delete Delete the given .Ar bootnum diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 8dcf9876486d..ce7265857391 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -202,6 +202,7 @@ static void parse_args(int argc, char *argv[]) { int ch; + const char *arg; while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:v", lopts, NULL)) != -1) { @@ -214,7 +215,10 @@ parse_args(int argc, char *argv[]) break; case 'b': opts.has_bootnum = true; - opts.bootnum = strtoul(optarg, NULL, 16); + arg = optarg; + if (strncasecmp(arg, "boot", 4) == 0) + arg += 4; + opts.bootnum = strtoul(arg, NULL, 16); break; case 'B': opts.delete = true;