From nobody Sun Nov 14 14:41:48 2021 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 006AE185C65E; Sun, 14 Nov 2021 14:41:49 +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 4HsZlc6cd8z3mhP; Sun, 14 Nov 2021 14:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C37AF27FB3; Sun, 14 Nov 2021 14:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEEfmHr037906; Sun, 14 Nov 2021 14:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEEfmZ4037905; Sun, 14 Nov 2021 14:41:48 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:41:48 GMT Message-Id: <202111141441.1AEEfmZ4037905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 544af629a490 - main - loader: Fix pnpmatch and add some usage 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 544af629a4906be1873983dfa129e65bc5d0c3df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=544af629a4906be1873983dfa129e65bc5d0c3df commit 544af629a4906be1873983dfa129e65bc5d0c3df Author: Emmanuel Vadot AuthorDate: 2021-11-14 14:11:24 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 14:41:30 +0000 loader: Fix pnpmatch and add some usage pnpmatch needs a busname and a compat data. --- stand/common/module.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stand/common/module.c b/stand/common/module.c index 8bddd9f56f52..9b001089149d 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -381,14 +381,19 @@ command_pnpmatch(int argc, char *argv[]) return(CMD_OK); } } - argv += (optind - 1); - argc -= (optind - 1); + argv += optind; + argc -= optind; - module = mod_searchmodule_pnpinfo(argv[1], argv[2]); + if (argc != 2) { + command_errmsg = "Usage: pnpmatch compat="; + return (CMD_CRIT); + } + + module = mod_searchmodule_pnpinfo(argv[0], argv[1]); if (module) printf("Matched module: %s\n", module); - else if(argv[1]) - printf("No module matches %s\n", argv[1]); + else + printf("No module matches %s on bus %s\n", argv[1], argv[0]); return (CMD_OK); }