aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2026-06-26 14:45:31 +0000
committerWarner Losh <imp@FreeBSD.org>2026-06-26 14:54:35 +0000
commit1e49aa7a984e0d4381538aa6cf16d37b20b000b9 (patch)
tree1f8f9a0379531736199f8560ea7040f9ad65be95
parent8bda488114f330d758e6741ff44882bb12b76c0d (diff)
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 <imp@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D57800
-rw-r--r--stand/efi/loader/main.c21
1 files 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();