From nobody Wed Feb 21 03:38:29 2024 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 4Tfhnd6S1Mz5BJ56; Wed, 21 Feb 2024 03:38:29 +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 4Tfhnd4kNsz4WFc; Wed, 21 Feb 2024 03:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708486709; 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=GnvPsNB1b0K3GVdOAfISGJq2yO6fCnbzYbaRfAdJLIE=; b=RVuFj6i3pkfjjNcoq0YWV/TFhmuMc3dWcU0vO/5ysVPncnMCQ4jq3Dj1FKJq4EhUie9r7Z nSecdiqNtFy3WFvdWM3mkrEiumy+ZFVCR0gOWLJiXD/+nKUyEfLBzfMtgJp3LOc2zF52/C 9ArLqeGRYh3VeI9AcEZ2EdwGOXS5GcY4o7gGGUEWTsuM8YCvxBW0KrgOIfOV12EmELqzv1 3eyr+fg+f8rBOLzpbhWlTTIqph8s4eB5MkM670uWcahkAOFGTPjRlB0ADFtMeF9MIbGfAk iTMowvoaybFFmCfUI3h8D19sqzEfV3NCaN/HBGg68ZYtaEPYuPHgRJlT5Lfw9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708486709; 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=GnvPsNB1b0K3GVdOAfISGJq2yO6fCnbzYbaRfAdJLIE=; b=Xz65JNu3QtPp0SYy/Oqnf8rIw1VndJDLyOLUPRA88fD2Spw3An6k+VhqiOLS8o/kehHvK7 vqikBIl49hQXlrlajDIQGdZmgu0jTsPnWnsi2nHzhMy+oJTJN8v8eU2eRcprU9sbzJ0ms6 lYghcBPEvVaD3FOAQxRG9xdMyjdjBB337xmnRsPbAUq1dk/fA6LNC+mvWnaV/mA2njGdJL P6Fd/AJsDcHZAGh8x/aV4FghKk5sAN5JPuihOmS4SMxD3o+MRJk2aVZbxAft20x+qNlmpF T3ydCCQox//YSlp52FOqV9Rs20BwgAvOE2VjIZsBFfQdrHzJvjaM3Vx5fSMtjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708486709; a=rsa-sha256; cv=none; b=dX4kd6YpkNaRtTnVIk9fxjBnFu9Luig7AG1mI1vpyEKIC0yz3SVu/B+RKwGpPJex369i2b QyDMFZIzgz06zA67JC6EdmvdEABBekFoJftQntxGiiSroGBqJ1lRIxzMWfNpy7Ui6VY5eC PLLMCJnYoLW85DLTXtI5Z/4ch+l5wcIfzdqX1C10Ak17OP5KCtz2ewJlY4Kya0VMFPtQmb 1GjNLlCRxv0agB5nvje1cq1Iv6i28BFuril+BOXO6iBwM8oqWRxy6q8C3w9drMUyN7NcRD Sr3JOUchfh/xjRrtdyGuZN4ZioxIzp2JDilTnT9j3sFk1GDRdjUiZnBHzeQ8lg== 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 4Tfhnd3p7nzmh3; Wed, 21 Feb 2024 03:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L3cT6Q021204; Wed, 21 Feb 2024 03:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L3cTKj021201; Wed, 21 Feb 2024 03:38:29 GMT (envelope-from git) Date: Wed, 21 Feb 2024 03:38:29 GMT Message-Id: <202402210338.41L3cTKj021201@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: 65ee8f90b790 - main - kboot: Fix zfs bootonce protocol 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: 65ee8f90b7906a5895c87bfe05f85ce3d3bf84c7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=65ee8f90b7906a5895c87bfe05f85ce3d3bf84c7 commit 65ee8f90b7906a5895c87bfe05f85ce3d3bf84c7 Author: Warner Losh AuthorDate: 2024-02-21 03:26:08 +0000 Commit: Warner Losh CommitDate: 2024-02-21 03:36:00 +0000 kboot: Fix zfs bootonce protocol This wasn't updated when the other copies were updated. Make it identical to efi code. We should likely refactor this (with userboot), but they are all not quite identical. Sponsored by: Netflix --- stand/kboot/kboot/hostdisk.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/stand/kboot/kboot/hostdisk.c b/stand/kboot/kboot/hostdisk.c index 552ae68daced..423151983523 100644 --- a/stand/kboot/kboot/hostdisk.c +++ b/stand/kboot/kboot/hostdisk.c @@ -567,40 +567,35 @@ hostdisk_zfs_probe(void) /* This likely shoud move to libsa/zfs/zfs.c and be used by at least EFI booting */ static bool -probe_zfs_currdev(uint64_t pool_guid, uint64_t root_guid, bool setcurrdev) +probe_zfs_currdev(uint64_t pool_guid) { char *devname; struct zfs_devdesc currdev; - bool bootable; + char buf[VDEV_PAD_SIZE]; currdev.dd.d_dev = &zfs_dev; currdev.dd.d_unit = 0; currdev.pool_guid = pool_guid; - currdev.root_guid = root_guid; + currdev.root_guid = 0; devname = devformat(&currdev.dd); - if (setcurrdev) - set_currdev(devname); - - bootable = sanity_check_currdev(); - if (bootable) { - char buf[VDEV_PAD_SIZE]; - - if (zfs_get_bootonce(&currdev, OS_BOOTONCE, buf, sizeof(buf)) == 0) { - printf("zfs bootonce: %s\n", buf); - if (setcurrdev) - set_currdev(buf); - setenv("zfs-bootonce", buf, 1); - } - (void)zfs_attach_nvstore(&currdev); - init_zfs_boot_options(devname); + printf("Setting currdev to %s\n", devname); + set_currdev(devname); + init_zfs_boot_options(devname); + + if (zfs_get_bootonce(&currdev, OS_BOOTONCE, buf, sizeof(buf)) == 0) { + printf("zfs bootonce: %s\n", buf); + set_currdev(buf); + setenv("zfs-bootonce", buf, 1); } - return (bootable); + (void)zfs_attach_nvstore(&currdev); + + return (sanity_check_currdev()); } static bool hostdisk_zfs_try_default(hdinfo_t *hd) { - return (probe_zfs_currdev(hd->hd_zfs_uuid, 0, true)); + return (probe_zfs_currdev(hd->hd_zfs_uuid)); } bool