From nobody Fri Oct 27 04:04:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SGpvc6JFjz4xhYX; Fri, 27 Oct 2023 04:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SGpvc5gfhz4chc; Fri, 27 Oct 2023 04:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698379468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAKTogqzwlFztZsNK75yLw9JTrMJJbOlmbO0XXwcnG8=; b=nouxUgjqCS2DBCAlgKZZTWbEBVQ6aYTegGqNnRrxbMqxMa9KAA70dqBQ6+MoMpJsK9ajqk IqmSVvZYXQNRyyN7+qV5Nn0vtli5qAYt97n+ttQ5TC8Avxc6pgEAFw7lnOp5X+qZ9G9bT1 lC1jjXlbItwSpTyf3IKbxeDi0/0bGk5oLzpjosbe79jMgirnCp/CgARxZOFPE4l1aoGPId Sz2bnzRzV0Iskj26lICM5O9+KMRzxekoa+iZRpcac88bFiEczjL1OwBXyVuFnIfIQWoKb6 8dTrZU+diNWWsDwTeiIKsOWqNjssIQ1MYqwCkVH4PfZ4d9JS174+fsT1jupCkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698379468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAKTogqzwlFztZsNK75yLw9JTrMJJbOlmbO0XXwcnG8=; b=VQONr258j8UZcE0wWPXLz9bPDQzdsxZJTAPtbcVndrtjq8cJosUhaSev5TDd3Q2pRU/oIT KKGM5QFrMSzubnkLNG0Q5sY1BGqSG6GS1a7h+KqV9sqg9xePX7iuhGiF6l03XVtOpSTtJg rUVibf/F/IpCokXT9mBpWNmSV/jFv/AdKOSYCGEi9XT+3zkfzEApZWilltUJZ/x9jE8vQe Ncu3SMT8mH9VjFUYkF22WWlZFfwr4D853JbupeIABP31f71neIEos0eT846WgHeLmpjhNQ aCZ1DhQOsQ4x/ruD+Ws+LLxaeOR0pAUC/nULT4xDpHBEaiPiZCZH2zTTFahTeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698379468; a=rsa-sha256; cv=none; b=p4czWoMO5ZJ+gCtJ0gxTnunzLBydBZtUAI8oYTNiOj/T0Utme+CT7bdwDFYnlkYGRUmvKd ILubFS2DFJTx7bYBdCvitrZFtRlpVDBFj4FjI4qfal01t5JNiYca5FmFluM+SZt7JYnzxX 25KreJHyf+MD+SGNS/+1lV/mzKhtPfXLTOaTD4AVs+Grc1+koLP8TwBLoOJSprffRWPNE2 QTvNXE1qmTe8IUJtb6vHK5k3RlavmoCKzHp/I6ysHXdUi5Ah7nyHJVsdOPXvx8ITKH1GOO n1zm1DTZj3A9OeJY3rw1a8Ls9KYoHeY4aLAhmT18SrC+9p4ELVayNAxSp+IHsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SGpvc4kFqzyVx; Fri, 27 Oct 2023 04:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39R44SNe040653; Fri, 27 Oct 2023 04:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39R44S7e040651; Fri, 27 Oct 2023 04:04:28 GMT (envelope-from git) Date: Fri, 27 Oct 2023 04:04:28 GMT Message-Id: <202310270404.39R44S7e040651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 98d2608a2a68 - main - efibootmgr: support '-b bootXXXX' as an alias for '-b XXXX' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98d2608a2a686a300fdaeb45e666ff1661244260 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=98d2608a2a686a300fdaeb45e666ff1661244260 commit 98d2608a2a686a300fdaeb45e666ff1661244260 Author: Warner Losh AuthorDate: 2022-05-17 16:47:03 +0000 Commit: Warner Losh CommitDate: 2023-10-27 04:01:16 +0000 efibootmgr: support '-b bootXXXX' as an alias for '-b XXXX' Sponsored by: Netflix --- usr.sbin/efibootmgr/efibootmgr.8 | 7 ++++++- usr.sbin/efibootmgr/efibootmgr.c | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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;