diff --git a/stand/kboot/conf.c b/stand/kboot/conf.c --- a/stand/kboot/conf.c +++ b/stand/kboot/conf.c @@ -33,6 +33,9 @@ #if defined(LOADER_NET_SUPPORT) #include "dev_net.h" #endif +#ifdef LOADER_ZFS_SUPPORT +#include "libzfs.h" +#endif extern struct devsw hostdisk; extern struct devsw host_dev; @@ -55,6 +58,9 @@ &netdev, #endif &host_dev, +#if defined(LOADER_ZFS_SUPPORT) + &zfs_dev, /* Must be last */ +#endif NULL }; @@ -84,6 +90,9 @@ #endif #if defined(LOADER_MSDOS_SUPPORT) &dosfs_fsops, +#endif +#if defined(LOADER_ZFS_SUPPORT) + &zfs_fsops, #endif &hostfs_fsops, NULL diff --git a/stand/kboot/main.c b/stand/kboot/main.c --- a/stand/kboot/main.c +++ b/stand/kboot/main.c @@ -46,6 +46,7 @@ int kboot_autoload(void); uint64_t kboot_loadaddr(u_int type, void *data, uint64_t addr); static void kboot_kseg_get(int *nseg, void **ptr); +static void kboot_zfs_probe(void); extern int command_fdt_internal(int argc, char *argv[]); @@ -160,6 +161,7 @@ archsw.arch_autoload = kboot_autoload; archsw.arch_loadaddr = kboot_loadaddr; archsw.arch_kexec_kseg_get = kboot_kseg_get; + archsw.arch_zfs_probe = kboot_zfs_probe; /* Give us a sane world if we're running as init */ do_init(); @@ -380,6 +382,18 @@ *ptr = &loaded_segments[0]; } +static void +kboot_zfs_probe(void) +{ +#if defined(LOADER_ZFS_SUPPORT) + /* + * Open all the disks and partitions we can find to see if there are ZFS + * pools on them. + */ + hostdisk_zfs_probe(); +#endif +} + /* * Since proper fdt command handling function is defined in fdt_loader_cmd.c, * and declaring it as extern is in contradiction with COMMAND_SET() macro