diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2026-02-27 00:57:26 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2026-02-27 01:01:36 +0000 |
| commit | d69fc3a9dc71768e125e83d35274f0820063e42d (patch) | |
| tree | 62bcf1cd138ce86c2d5a1524cb4eb0d89043c7bf /stand/efi | |
| parent | 86dc5dd0b2a861cf9d8cad18fc17c17dbbfc4465 (diff) | |
Diffstat (limited to 'stand/efi')
| -rw-r--r-- | stand/efi/include/efizfs.h | 2 | ||||
| -rw-r--r-- | stand/efi/libefi/efizfs.c | 9 | ||||
| -rw-r--r-- | stand/efi/loader/main.c | 9 |
3 files changed, 7 insertions, 13 deletions
diff --git a/stand/efi/include/efizfs.h b/stand/efi/include/efizfs.h index 45c2ca1c94aa..5f50b7740a55 100644 --- a/stand/efi/include/efizfs.h +++ b/stand/efi/include/efizfs.h @@ -49,8 +49,6 @@ typedef struct zfsinfo uint64_t zi_pool_guid; } zfsinfo_t; -extern uint64_t pool_guid; - void efi_zfs_probe(void); EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); diff --git a/stand/efi/libefi/efizfs.c b/stand/efi/libefi/efizfs.c index 1c80f1ae26b9..563cf841143a 100644 --- a/stand/efi/libefi/efizfs.c +++ b/stand/efi/libefi/efizfs.c @@ -40,8 +40,6 @@ #ifdef EFI_ZFS_BOOT static zfsinfo_list_t zfsinfo; -uint64_t pool_guid; - zfsinfo_list_t * efizfs_get_zfsinfo_list(void) { @@ -111,13 +109,8 @@ efi_zfs_probe(void) STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { snprintf(devname, sizeof(devname), "%s%dp%d:", efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - guid = 0; - if (zfs_probe_dev(devname, &guid, false) == 0) { + if (zfs_probe_dev(devname, &guid, false) == 0) insert_zfs(pd->pd_handle, guid); - if (pd->pd_handle == boot_img->DeviceHandle) - pool_guid = guid; - } - } } } diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 7ff2cf188509..d8508d7d91a0 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -588,6 +588,9 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz) } #ifdef EFI_ZFS_BOOT + zfsinfo_list_t *zfsinfo = efizfs_get_zfsinfo_list(); + zfsinfo_t *zi; + /* * Did efi_zfs_probe() detect the boot pool? If so, use the zpool * it found, if it's sane. ZFS is the only thing that looks for @@ -595,9 +598,9 @@ find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz) * if we allow specifying which pool to boot from via UEFI variables * rather than the bootenv stuff that FreeBSD uses today. */ - if (pool_guid != 0) { - printf("Trying ZFS pool\n"); - if (probe_zfs_currdev(pool_guid)) + STAILQ_FOREACH(zi, zfsinfo, zi_link) { + 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 */ |
