From nobody Tue Jan 24 22:10:53 2023 X-Original-To: dev-commits-src-all@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 4P1h4Z2ftkz3bf2X; Tue, 24 Jan 2023 22:10:54 +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 4P1h4Z1jjCz4M6T; Tue, 24 Jan 2023 22:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598254; 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=Io7azLBtBlLho/z75qMyWt5Dym5vtIhVRo7JwfuZNyo=; b=jsoRSfOOys6rOz81p1gAgxKegPsKOoqN0PMK7Cd3X5TeSsdttjThy1kot9yFafUU7iCgCw THNLbj93Sq7wQDPEYMUr2fgqHPNRUvUN8PduSDPksKTYz6vzY7o2FRBSEwQUYMWoIKNbgV 5QO0TdvNxlVYUTGFOq29C2Ka8HzZ4elf4dXXDxQtkVooOhC8Ru2SetdUvJX4GvOA7V18GD 3YOcmMiv5miOO+HTLdUH7VtKlNHdvnNiRsOcCOT/K7HccudXU7J0fguOs976mKDV8A+Xef 5+rCEfRdtGpdiqAbyM4pOFQTX7oMmBI5Z01HtBRaHNhJ43/c86TDr/5GCfPhhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598254; 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=Io7azLBtBlLho/z75qMyWt5Dym5vtIhVRo7JwfuZNyo=; b=JJG71tw4mP+vatizDpOgE+s09rxWzdVykuzQv/b3kRk07oO13PefNf1Q85RLH4qeOxaN7D KwA2PYtWdBel8zSmJK6m6AA3fj9k5NQXaiVRHkXXfXn8/BhZlwSEr5318qaY1qCRCNdCCF GPYRm7Adw2W+TqNJB3eMDa0mbvGYMfITYVYZeFfSXhMSuvZcnYRRFrMb+kLXrpyBrHRFdE TKxmp5bxRuI2vkT8MvSYAMf1WCD5z1L4z9xapeI+1HAs9bK4K02jsGGbHx8f+qi/nhs/F3 0UVD69lQI9x17ipdVIc7lYMXBR9/P3lveVFjB3XDrTF80B4jFNITacY42L5wQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598254; a=rsa-sha256; cv=none; b=Rv9lJ8JQZNUN9V4/ASpMYpi2R55J0HJrDkNrgrRELKqCCD7YOArIbamaLhVQg2vTJICBNP /BPSmlgIMlVyFVes+tR15WyMudMiERTof0Lbc3+46teh/izcSnAWT6GJCkEpDoyfu/qL91 6Ov8CqlTTtkPU0JDKAH9IgVAZuCzsUFciPrq7eQZUkRIN9S4UyWAIhyrZ35mUdFNsjGZon ibqbR0X+cbGKcKNk0b9woX1mVufSIVbeDHVkDDbynTZNdtHl6G+mKquauB4wwo++BHOOJE +uGfmZ3js1rtUpgMVJqYX5+zN3ky7hpVuqe2OlrLOenNcn9hvMM8vTR/7i6cXA== 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 4P1h4Z0FmBzQNm; Tue, 24 Jan 2023 22:10:54 +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 30OMArn3083159; Tue, 24 Jan 2023 22:10:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMAri5083158; Tue, 24 Jan 2023 22:10:53 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:10:53 GMT Message-Id: <202301242210.30OMAri5083158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2ec7d6fd4217 - stable/13 - kboot: Enhance kboot_getdev to cope with NULLs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ec7d6fd42170fca215dbe291830606648f00ae5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ec7d6fd42170fca215dbe291830606648f00ae5 commit 2ec7d6fd42170fca215dbe291830606648f00ae5 Author: Warner Losh AuthorDate: 2022-07-15 13:32:16 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:23 +0000 kboot: Enhance kboot_getdev to cope with NULLs Fallback to currdev when NULL is passed in when 'rootdev' is NULL. Other getdevs do this. Additional features are needed here still, though. Sponsored by: Netflix (cherry picked from commit bf35f00522676d6e456b19168908cfa890ae0782) --- stand/kboot/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stand/kboot/main.c b/stand/kboot/main.c index 90b31a611476..3fab25132f15 100644 --- a/stand/kboot/main.c +++ b/stand/kboot/main.c @@ -212,11 +212,17 @@ kboot_get_kernel_machine_bits(void) int kboot_getdev(void **vdev, const char *devspec, const char **path) { - int i; + int i, rv; const char *devpath, *filepath; struct devsw *dv; struct devdesc *desc; + if (devspec == NULL) { + rv = kboot_getdev(vdev, getenv("currdev"), NULL); + if (rv == 0 && path != NULL) + *path = devspec; + return (rv); + } if (strchr(devspec, ':') != NULL) { devpath = devspec; filepath = strchr(devspec, ':') + 1;