From nobody Tue Jan 24 22:14:32 2023 X-Original-To: dev-commits-src-branches@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 4P1h8n3dk6z3bgj8; Tue, 24 Jan 2023 22:14:33 +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 4P1h8n06tSz3LjL; Tue, 24 Jan 2023 22:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598473; 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=57NnTeynt4qzzNaGzXqL3Ol/3EyKZCUGlzsjPrWuvS4=; b=JfP5hjKJw7tldUEw5++gP3lf4GEZo/w4Stp4z+KSIUGUvXeZHddBVFIFCgZm9I4FoWDeNC F+l8MpBgyDvWYjpCLq7b3K85f7DSYtHTzZN8+Jv7T7xd7L2TlIZ8mkD9SGGJx9yldzAlbJ 6HtVFh5U2xHjAodUOSraYROvyGb1HIj/q0wF9NEcd1KxuujP6+t4szD1l1e3268Ylpl4Cn wns3SGvjSrhMcVRQIjDjdZP0O1KSjCZQnAjUbGkH7QqWjQwXQmfJrhmVQpnXvs3G55EG9l CCLOOYB6S7T2p9SEYOzPX06UIXOisA/7EaWde6+W6wm5sZ21imRhb92x7cPD/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598473; 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=57NnTeynt4qzzNaGzXqL3Ol/3EyKZCUGlzsjPrWuvS4=; b=cXgzFkzwy5kJw3LWMn7MLRhq+8SMynMN2NTIZfC60jyyL5HAYkWMtY/uUbe3WeNzzrpv2F YHKCWGeVXgX7TfigOnk4iLNwptCOuLb/CapCqVUewuS8ZQ9aZ7TwIWsezrcLx334REPIe2 ziT8xj3AWFWGYR/sRu0RTebnpVqWgd2OjtEhEOGpe+BtqzLepjcHad1EYID/dWtXONKDdn oD7jghzbgesk7F+46zWllAYS194rJTilFMfk+VYfyESlcIX9FXH6SITMeNJE/uHff+Y3zx qSikZYUwCiEOjz9+ZAOyKr0ZqMpU39qodY0DMhFJsDRXNSyk7yv2EZws24cwdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598473; a=rsa-sha256; cv=none; b=S5Fv4TgUoWCCxHN4e7HjwNVL7p8E9jgGtXRFF8gUcVP6KpctAd5XQhv95vutwqQyFnw85F f0QPN0/QNWBg9NSjGrRxoqd4sUwnHGUx1Qx7Q7XO+nNBhA6R4C+RiTr7HtUUAADgkzfnRE wqPhs48MwqfuFwoaqaN9yUCSVWE0D1JoSccjspyAnrnG9WqHDdEGbg+ODgAIXHS8BNmM/w fja31YQmSCGJealNWK7qZgqTalKdJM+nJ0TLXb6402Q3sbW9uJ2/g0rXpd5IlznsfkWHja PZ5v6+SiVgexgt8n33/tH+7sdGcAuBpvMF8b/cNavmUEdRK/nAhNe3mvtzuDsw== 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 4P1h8m6LrQzQhP; Tue, 24 Jan 2023 22:14:32 +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 30OMEWZs089969; Tue, 24 Jan 2023 22:14:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMEWFF089968; Tue, 24 Jan 2023 22:14:32 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:14:32 GMT Message-Id: <202301242214.30OMEWFF089968@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: eaed7ff9d014 - stable/13 - kboot: Fetch hostfs_root and bootdev from the environment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: eaed7ff9d014a7707181719fe6f0cc6c34a34926 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eaed7ff9d014a7707181719fe6f0cc6c34a34926 commit eaed7ff9d014a7707181719fe6f0cc6c34a34926 Author: Warner Losh AuthorDate: 2023-01-13 21:20:56 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:47 +0000 kboot: Fetch hostfs_root and bootdev from the environment Fetch bootdev from the environment variable (so it should be set on the command line). Default to 'zfs:' which will in the future look for the first zpool that we can boot from. Prior versions of kboot would set this from the second argument on the command line. Fetch hostfs_root from the environment (defaulting to '/'). Prior versions of kboot would set this from the first arg on the command line. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D38010 (cherry picked from commit 4f3be6b8d94a388ce7ae239c785ea447d0adbf48) --- stand/kboot/main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/stand/kboot/main.c b/stand/kboot/main.c index d333737e164a..9a0f8b8baf69 100644 --- a/stand/kboot/main.c +++ b/stand/kboot/main.c @@ -172,6 +172,9 @@ main(int argc, const char **argv) heapbase = host_getmem(heapsize); setheap(heapbase, heapbase + heapsize); + /* Parse the command line args -- ignoring for now the console selection */ + parse_args(argc, argv); + /* * Set up console. */ @@ -180,8 +183,20 @@ main(int argc, const char **argv) /* Initialize all the devices */ devinit(); - /* Parse the command line args -- ignoring for now the console selection */ - parse_args(argc, argv); + bootdev = getenv("bootdev"); + if (bootdev == NULL) + bootdev="zfs:"; + hostfs_root = getenv("hostfs_root"); + if (hostfs_root == NULL) + hostfs_root = "/"; +#if defined(LOADER_ZFS_SUPPORT) + if (strcmp(bootdev, "zfs:") == 0) { + /* + * Pseudo device that says go find the right ZFS pool. + */ + printf("WARNING: bare 'zfs:' for boot device not yet implemented\n"); + } +#endif printf("Boot device: %s with hostfs_root %s\n", bootdev, hostfs_root);