From nobody Fri Jun 26 14:59:13 2026 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 4gmzN22Hvyz6jcxN for ; Fri, 26 Jun 2026 14:59:14 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gmzN21jRkz3d41 for ; Fri, 26 Jun 2026 14:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782485954; 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=nbAv577cdNxoaBSJQ/AviBwmuai/vK/iRTKnTTTv+uc=; b=QHRRJZEZM9hFv1E9bnwNboHK/J6jz5gaa4JXCbECWSSjBbNk0SoOYDlYl1fg4spCBkUbTT C5I9D3vMFJ0gwoCO2uxNJJCOMJ4O363IwF4CMsQ/NleTwu+Mo88pWCJ+i+FoguG7pjhO36 PZTYze+xkHQMhfk6QgDaQbiuvCKpb1UFBreGwYGuiEe1suGxpb072vlLJdjtvAgZr8c8OU x5brNKAm1vvJ0s96w/dRWZ0HBL22yQCVdVlag6L7QXBgkwyFT5Q6zAE/evax6cen4axhjy K0OSFml5pbqCeu+jbydd/eBfX5m8L6NkkQzOcCp9NALH2pRUifxJRH68WEzITw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782485954; a=rsa-sha256; cv=none; b=f6W0RCJKhOuDTsw+rgRDKpQ6nCezT694hmGBHgMhyKP1eb3rIaNv2fy2lMokmByv+ZP0UF okbsbMKM2OKKu6Vi1avnalcjkk1Cuee7L6q4vojVk+frzHT85Nprk7FM1s4MqMoz1BBhYL GbgW+m2lZ5DAb2p7c+k8RwgCB7quUSaM4n37bIK6EMTsxyRVCMuoAkGHc+nVVruJ2LF0ia gnxnOUDGRPdLVAQc9APOFIEyrlOQw3fqWil2kDq8kNcbODkqwQsZMrx+xKJDc3803M9iV9 K6pnU3rbs7Got4g75lMBa402x/c3rFjxodZKyqphJ8/gitL3W0Jz6uhzHhLlFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782485954; 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=nbAv577cdNxoaBSJQ/AviBwmuai/vK/iRTKnTTTv+uc=; b=kAsRTsYkRFRcOJb7emt7ziqqKeCYdz4QLsyvCMoFbbRpgxiPM9NprHo4AObPOoDm7JNOyT uXL9Scm0SLEbBMyEPzF2PPgE8421mAuDFF0f6enk7NTDq7BkOxvCTk/E5usuyI2kQajEgS 8zDBtmdbw07E1LTwyc1g6D9OEfjypJ8MDK8+rroxqmdhB8ebi64wUAIm4Z4dfk9RdDeDox 3mLj6Tm0XWnzKNQ7cMR7GMff6lJ4gRprXls6xob+cwwF6gey/IwrjhPtpsjka2ojm7dV5d LxoLe0zcyBDEZzkrf2fVA803LUmXk7GYm7yb6u6MEomi1m8WCFdPSmkpMeiGYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gmzN20VWJzhWl for ; Fri, 26 Jun 2026 14:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 216ee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Jun 2026 14:59:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1e49aa7a984e - main - loader.efi: Add comments describing the boot protocol 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 1e49aa7a984e0d4381538aa6cf16d37b20b000b9 Auto-Submitted: auto-generated Date: Fri, 26 Jun 2026 14:59:13 +0000 Message-Id: <6a3e93c1.216ee.6ad1e87f@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e49aa7a984e0d4381538aa6cf16d37b20b000b9 commit 1e49aa7a984e0d4381538aa6cf16d37b20b000b9 Author: Warner Losh AuthorDate: 2026-06-26 14:45:31 +0000 Commit: Warner Losh CommitDate: 2026-06-26 14:54:35 +0000 loader.efi: Add comments describing the boot protocol Add some comments about the boot protocol. Need to do a deeper dive into the networking code since it's the last set of code used here. Signed-off-by: Warner Losh Differential Revision: https://reviews.freebsd.org/D57800 --- stand/efi/loader/main.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 1444b1eee17d..1d91c8dd26ac 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -641,17 +641,24 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz) #ifdef MD_IMAGE_SIZE /* - * If there is an embedded MD, try to use that. + * Forth choice: If there is an embedded MD, try to use that. */ printf("Trying MD\n"); if (probe_md_currdev()) return (0); #endif /* MD_IMAGE_SIZE */ + /* + * Fifth choice: try all the partitions on the boot device. + */ if (try_boot_device_partitions() == 0) return (0); #ifdef EFI_ZFS_BOOT + /* + * Sixth Choice: Probe the boot disk for ZFS and then probe the non-boot + * disk if we have a relaxed boot poluicy. + */ { zfsinfo_list_t *zfsinfo = efizfs_get_zfsinfo_list(); zfsinfo_t *zi; @@ -686,8 +693,8 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz) #endif /* EFI_ZFS_BOOT */ /* - * Try the device handle from our loaded image first. If that - * fails, use the device path from the loaded image and see if + * Seventh choice: Try the device handle from our loaded image first. + * If that fails, use the device path from the loaded image and see if * any of the nodes in that path match one of the enumerated * handles. Currently, this handle list is only for netboot. */ @@ -697,6 +704,12 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz) return (0); } + /* + * Eighth choice: look up the device handle... This loops through the + * entries to find the device handle. The network protocols have long + * strings of device nodes in the device path, and this may make + * something work. + */ copy = NULL; devpath = efi_lookup_image_devpath(IH); while (devpath != NULL) { @@ -1256,7 +1269,7 @@ main(int argc, CHAR16 *argv[]) #endif /* Get our loaded image protocol interface structure. */ - (void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); + (void)OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); /* Report the RSDP early. */ acpi_detect();