diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c index 2b30b92161f1..644747e81510 100644 --- a/sys/boot/i386/loader/main.c +++ b/sys/boot/i386/loader/main.c @@ -262,7 +262,6 @@ extract_currdev(void) new_currdev.d_kind.zfs.root_guid = 0; } new_currdev.d_dev = &zfs_dev; - init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ @@ -296,6 +295,11 @@ extract_currdev(void) new_currdev.d_unit = 0; } +#ifdef LOADER_ZFS_SUPPORT + if (new_currdev.d_type == DEVT_ZFS) + init_zfs_bootenv(zfs_fmtdev(&new_currdev)); +#endif + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset,