diff options
| author | Toomas Soome <tsoome@FreeBSD.org> | 2020-06-20 06:23:31 +0000 |
|---|---|---|
| committer | Toomas Soome <tsoome@FreeBSD.org> | 2020-06-20 06:23:31 +0000 |
| commit | 3830659e99640001c09d26dfc0e1bbd77d919a62 (patch) | |
| tree | c05db1c928b5f34c3b3027ccc6fef6cc7949423b /stand/efi | |
| parent | 830efe55395a27f0a72812b5a028e323ee3981a6 (diff) | |
Notes
Diffstat (limited to 'stand/efi')
| -rw-r--r-- | stand/efi/libefi/Makefile | 2 | ||||
| -rw-r--r-- | stand/efi/loader/main.c | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/stand/efi/libefi/Makefile b/stand/efi/libefi/Makefile index 6e5628047e17..8bbd421486ca 100644 --- a/stand/efi/libefi/Makefile +++ b/stand/efi/libefi/Makefile @@ -52,6 +52,8 @@ CFLAGS.efi_console.c+= -I${SRCTOP}/sys/teken CFLAGS.teken.c+= -I${SRCTOP}/sys/teken .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -DEFI_ZFS_BOOT .endif diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 14c320a09811..6ad626b2df39 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -260,6 +260,8 @@ probe_zfs_currdev(uint64_t guid) { char *devname; struct zfs_devdesc currdev; + char *buf = NULL; + bool rv; currdev.dd.d_dev = &zfs_dev; currdev.dd.d_unit = 0; @@ -269,7 +271,18 @@ probe_zfs_currdev(uint64_t guid) devname = efi_fmtdev(&currdev); init_zfs_bootenv(devname); - return (sanity_check_currdev()); + rv = sanity_check_currdev(); + if (rv) { + buf = malloc(VDEV_PAD_SIZE); + if (buf != NULL) { + if (zfs_nextboot(&currdev, buf, VDEV_PAD_SIZE) == 0) { + printf("zfs nextboot: %s\n", buf); + set_currdev(buf); + } + free(buf); + } + } + return (rv); } #endif |
