From nobody Fri Jul 15 18:03:54 2022 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 4Lkzkg0jgtz4TGfj; Fri, 15 Jul 2022 18:03:55 +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 4Lkzkg08Rfz3RFN; Fri, 15 Jul 2022 18:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657908235; 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=OAmVzcWKiT0OWH7zp5HYFMssdKoZmY5T4tP6DFR42aQ=; b=ENhsPXssCvspt3W/UMEzHu84NRiCo6uQSb8XMvrMTBWlnSbD5lB7670H5gPaA/hRKBcDAD mRQcra957YTo3L8IXVE4HQyzf31KPuxxAiI5tRiDA8so+9tn0LMepeQ9uOUpnI0qjceG4i 8LKV/wX9pRZgsWGwZYpMe3/882ObBpQ7Z44Q+fpgW1EkP7dcdAaCEWypG+HCLDzfqVORVI o9bOnQlprcteXaKHmGX2vUjLkTPgcSxk2e0gVu1LWnGRjqa0/ryxIzwPTXmpCJ7V6cRqQS j0AtJmWH+7BIKcpnSRsXw+iO0zXbBiMC17WTBcqZKW8mFIWgIq7tJHiv2VAKQA== 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 4Lkzkf6NRRzrlw; Fri, 15 Jul 2022 18:03: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 26FI3sOI060133; Fri, 15 Jul 2022 18:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26FI3scc060132; Fri, 15 Jul 2022 18:03:54 GMT (envelope-from git) Date: Fri, 15 Jul 2022 18:03:54 GMT Message-Id: <202207151803.26FI3scc060132@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: bf35f0052267 - main - 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/main X-Git-Reftype: branch X-Git-Commit: bf35f00522676d6e456b19168908cfa890ae0782 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657908235; 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=OAmVzcWKiT0OWH7zp5HYFMssdKoZmY5T4tP6DFR42aQ=; b=KsHTPPFN1KDRRWsnRRLjqrhOSUmovRl5CR+tMuttEayja3KdNjkkX9qkxl1/mag/qz1jtv lP94w6v755VnDrI9sFJU4b5fy5YM42jHvtgYMGqsh6S4hBY6WdQB32PYMqKf9Oowf+hCn8 Inhg/fKEYnE/3iLqbXffxDRkLNcj/WiUPb8rPUAktUDINAlWW7whwr9dXJM6F04k4Hj2Ng DyM89FLt1IMQWrf4d/MGG5NV9hXiYRaOcDXLQrqphYB3pjJ3V4mpdHSJGFZeIR8spcSSE4 CUnKX+XekPAq8uohkJdMaANzKMMeDJxs4M8trQT2EgPci4ApaWRpIrSF98P0gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657908235; a=rsa-sha256; cv=none; b=aqMw40ZbAhAjq2IgW0Y5Z+k3K9DjI0tKPejhlniR2XqxuQoltUUNc7kyRnrg4VPHjOWxUL McdciDF216oeyc9WRYyaMyq6nekV4+gX9hiTC3MDHd60vbBJAtxYUvhcKg6Hh6daG3n1wY WVD2J0zQYMjhR6Ujr1GQtTVuar4QOTGbj6xo6FR/zYOfQysIWv4b3dUEmvfsYIcWKzu6TC 2fETCjHllZwcWk3C/WaCEP3WYzg6TVYZymGt8VYh+wnNeGCKHbc8ouuED/H8QspFs4tNP5 RCROf1rXFKhTJ9d9Aj/vbilk8PtiA3J+I80J7+oEjFVYvI28/WQKB/gCtiYVBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bf35f00522676d6e456b19168908cfa890ae0782 commit bf35f00522676d6e456b19168908cfa890ae0782 Author: Warner Losh AuthorDate: 2022-07-15 13:32:16 +0000 Commit: Warner Losh CommitDate: 2022-07-15 18:00:50 +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 --- 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;