Bug 240478 - arm64: opensolaris.ko not automatically loaded as a zfs.ko dependency
Summary: arm64: opensolaris.ko not automatically loaded as a zfs.ko dependency
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-arm mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-10 16:03 UTC by Ed Maste
Modified: 2019-09-11 19:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2019-09-10 16:03:56 UTC
On an Ampere eMAG system I'm trying to boot from ZFS on root on an attached SSD. I used bsdinstall to partition and configure the disk and installed the kernel/userland manually, and created loader.conf and fstab manually.

loader.conf had zfs_load="YES" and vfs.root.mountfrom="zfs:zroot/ROOT/default".

on boot the kernel reported
KLD file zfs.ko is missing depndencies

A similar report from twitter:
https://twitter.com/manuvadot/status/1106841888903057408
Comment 1 Rodney W. Grimes freebsd_committer 2019-09-10 16:08:12 UTC
(In reply to Ed Maste from comment #0)
Have you tried to force load zfs dependencies by addding to loader.conf
opensolaris_load="YES"

That is what I do when I run into this error.
Comment 2 iz-rpi03 2019-09-11 12:43:33 UTC
(In reply to Rodney W. Grimes from comment #1)
I have to add opensolaris_load="YES" here (RPi3B) as well, but I do not need
to set vfs.root.mountfrom as Ed does.

Bernd Walter's workflow 
(https://lists.freebsd.org/pipermail/freebsd-arm/2019-February/019455.html)
also mentioned to add opensolaris_load="YES" to loader.conf on arm.
Comment 3 Ed Maste freebsd_committer 2019-09-11 14:15:58 UTC
(In reply to Rodney W. Grimes from comment #1)
> Have you tried to force load zfs dependencies by addding to loader.conf
> opensolaris_load="YES"

Yes this is a suitable workaround; I opened this PR to track the underlying bug / issue.

(In reply to iz-rpi03 from comment #2)
> I do not need to set vfs.root.mountfrom as Ed does.

It turns out I didn't actually need vfs.root.mountfrom, it works with only opensolaris_load="YES".
Comment 4 Rodney W. Grimes freebsd_committer 2019-09-11 17:46:16 UTC
(In reply to Ed Maste from comment #3)
> It turns out I didn't actually need vfs.root.mountfrom, it works with only pensolaris_load="YES".

I thought that was the case.  Last time I ran into this IIRC was before the hints file was being generated and I just attributed it to that.  It may be that we have a general "dependency" locating problem on some (arm?) platforms?

Might be worth testing if foo_load="othermodulewithdependecny" hauls in those dependencies.

Thanks for tracking this.
Rod
Comment 5 Ed Maste freebsd_committer 2019-09-11 19:09:15 UTC
kldload once the system has booted works as expected:

root@:~ # kldstat
Id Refs Address                Size Name
 1    8 0xffff000000000000  14c3a30 kernel
 2    1 0xffff0001b4400000    41000 uhid.ko
 3    1 0xffff0001b4441000    41000 ums.ko
root@:~ # kldload zfs
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
root@:~ # kldstat
Id Refs Address                Size Name
 1   18 0xffff000000000000  14c3a30 kernel
 2    1 0xffff0001b4400000    41000 uhid.ko
 3    1 0xffff0001b4441000    41000 ums.ko
 5    1 0xffff0001b4e00000   2c1000 zfs.ko
 6    1 0xffff0001b50c1000    47000 opensolaris.ko
root@:~ #