Don't allow module to init if root is not mounted since the modcmd

wants to traverse the file system.  This *might* fix statically
linking zfs support into the kernel (at least it fixes rump kernel
bootstrap).
This commit is contained in:
pooka 2011-01-21 13:08:42 +00:00
parent 51f08b56c8
commit 1c44cbfd96
1 changed files with 3 additions and 0 deletions

View File

@ -4601,6 +4601,9 @@ zfs_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
if (!rootvnode)
return EAGAIN;
printf("WARNING: ZFS on NetBSD is under development\n");
availrmem = (uint64_t)physmem * PAGE_SIZE / 1048576;
if (availrmem < ZFS_MIN_MEGS * 80 / 100) {