aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2026-06-26 14:47:25 +0000
committerWarner Losh <imp@FreeBSD.org>2026-06-26 14:54:36 +0000
commit3e3fd1fde8e168910edc538966111c0b5f03cd5f (patch)
tree7a74409d1bd0969033bfb5d0fb5999623165cc56
parent7f5475594aabf1d6aa3db4c9237a2bd4f4aef6c4 (diff)
loader.efi: Trim ZFS searching for other booting options
When we're searching the system for all the disks in relaxed mode, we need to do a final pass over all the non-boot disks. We no longer need to have two loops since ZFS on boot device is selected properly in try_boot_device_partitions. This also simplifies the code a bit. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D57805
-rw-r--r--stand/efi/loader/main.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index b467740682f8..050e802181b1 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -681,39 +681,21 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz)
#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.
+ * Sixth Choice: With a relaxed policy, try ZFS pools on non-boot
+ * devices after the boot device has been fully exhausted.
*/
- {
+ if (boot_policy == RELAXED) {
zfsinfo_list_t *zfsinfo = efizfs_get_zfsinfo_list();
zfsinfo_t *zi;
- /*
- * Try ZFS pool(s) on the boot device not reachable via
- * the partition walk above.
- */
STAILQ_FOREACH(zi, zfsinfo, zi_link) {
- if (zi->zi_handle != boot_img->DeviceHandle)
+ if (zi->zi_handle == boot_img->DeviceHandle)
continue;
- printf("Trying ZFS pool 0x%jx\n", zi->zi_pool_guid);
+ printf("Trying ZFS pool 0x%jx\n",
+ zi->zi_pool_guid);
if (probe_zfs_currdev(zi->zi_pool_guid))
return (0);
}
-
- /*
- * With a relaxed policy, try pools on other devices only
- * after the boot device has no bootable root.
- */
- if (boot_policy == RELAXED) {
- STAILQ_FOREACH(zi, zfsinfo, zi_link) {
- if (zi->zi_handle == boot_img->DeviceHandle)
- continue;
- printf("Trying ZFS pool 0x%jx\n",
- zi->zi_pool_guid);
- if (probe_zfs_currdev(zi->zi_pool_guid))
- return (0);
- }
- }
}
#endif /* EFI_ZFS_BOOT */