From nobody Fri Jan 13 21:24:52 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 4NtvZY36bYz2qkjL; Fri, 13 Jan 2023 21:24:53 +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 4NtvZX5mv7z40dl; Fri, 13 Jan 2023 21:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673645092; 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=s0pwSxfHgFnYlVH6zJRuoJp2nYEkiVWPCitbJUM286E=; b=BygOkoKnATJgNo1jbqH2ai2j1mItSHQSs3/xQm/v1MDd5lypV7xaNTlRa50jQLFFRAnjfA oJ5Ii9LUxfhRv5Wqpwk11kvYPLlhBNMljE13E4bzPuCTpw+g9Gosss/vZa62P3TUA62TI0 u/OCnqL/K0tsR8ga8WDD9UKSrkdY0MZJfekeawY5Vp0SUSBuH8ghtRxLOW08a0K3kusFRO lL1Cn1++Us6QEFSdRaIwvkWKZuIxZaLSPgg/21H/1SvX67DAnM2MPAutBKXHes79nyTeYl MFQ3Y/EgoepFlP27bWvGYQg/Wrelves9X4HVoGUEKnJTGnznNZxHIek6FPomrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673645092; 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=s0pwSxfHgFnYlVH6zJRuoJp2nYEkiVWPCitbJUM286E=; b=nMitdY90UFmoTEZl0M9vRP4aFFhLdYA719/hDS5I/YS5yO6Dsofm5s9YNXCeDoAmexpSzO l5s3TkraILjRG/9gHCys7pXzJanJ+FjQnHKlBa7PDG+dDafo7ZWQDdLjl+h4SI0jJQZj2t Ci38HWUdlsyru88QtRHBmPoLMZQHxyV4V+xzYumOB2hjHVDsdQDV2+FON51Ip/TiRhLBeP idavTy+RJWYbfp3IDtdprNLm2X1Aq9T9t8fjJNkkZo50t71EKS2MM2h3AFSigZkdqqHqhr J/40g/fvgINZ5DnoZIbbS3fVWEOLft00cNnvtQ4wJzf/I2WHKOpiSm/JyvvXSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673645092; a=rsa-sha256; cv=none; b=oPWWT9VjjP0R6gN5FlQYgY+azW7NQL+Lu641HMV41igJDDZAX4ji3XtJNhEFfxLXnsmZmz h0jhGjvy9QoKzq3qAik8dhDaJA5EoQ3aG6VnNqT8AxbZafo4B9WiFf5JwfTcYypZTRzse3 nUsGTWUfalZRw3zUKjq4uG+Y1RIeQqqHtTvY6fyE527TToygaFrhYWJyaXuG9BgRM1OSXr kbcRo9tCrzU+ac1pGNrqNX9wqUUt7hg+3d17J9eKM1SLKLTwn6u0ymWUury7LJ27zZBGxj +8qBUfJ4lYI4nvP32dvX7nlYMUnyTSAR9k6IwnRYSb17qEVnV9ueaKvsD5CPFA== 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 4NtvZX4tKKzMv6; Fri, 13 Jan 2023 21:24:52 +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 30DLOqji040931; Fri, 13 Jan 2023 21:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30DLOqen040930; Fri, 13 Jan 2023 21:24:52 GMT (envelope-from git) Date: Fri, 13 Jan 2023 21:24:52 GMT Message-Id: <202301132124.30DLOqen040930@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: 4f3be6b8d94a - main - kboot: Fetch hostfs_root and bootdev from the environment 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: 4f3be6b8d94a388ce7ae239c785ea447d0adbf48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f3be6b8d94a388ce7ae239c785ea447d0adbf48 commit 4f3be6b8d94a388ce7ae239c785ea447d0adbf48 Author: Warner Losh AuthorDate: 2023-01-13 21:20:56 +0000 Commit: Warner Losh CommitDate: 2023-01-13 21:22:39 +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 --- 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);