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: 12.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-10 16:03 UTC by Ed Maste
Modified: 2021-09-02 22:58 UTC (History)
6 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 freebsd_triage 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 freebsd_triage 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 rz-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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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@:~ #
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-10-02 13:30:21 UTC
A commit references this bug:

Author: gjb
Date: Wed Oct  2 13:30:17 UTC 2019
New revision: 353004
URL: https://svnweb.freebsd.org/changeset/base/353004

Log:
  Explicitly add opensolaris_load="YES" to loader.conf through the
  installer when installing the system on a ZFS root filesystem.

  For arm64, zfs_load="YES" does not add opensolaris.ko as a kld
  dependency, so add it explicitly to prevent boot-time failures
  out-of-box.

  PR:		240478
  MFC after:	3 days
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Changes:
  head/usr.sbin/bsdinstall/scripts/config
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-10-03 14:39:38 UTC
A commit references this bug:

Author: gjb
Date: Thu Oct  3 14:39:16 UTC 2019
New revision: 353047
URL: https://svnweb.freebsd.org/changeset/base/353047

Log:
  MFC r353004, r353012:
   r353004:
    Explicitly add opensolaris_load="YES" to loader.conf through the
    installer when installing the system on a ZFS root filesystem.

    For arm64, zfs_load="YES" does not add opensolaris.ko as a kld
    dependency, so add it explicitly to prevent boot-time failures
    out-of-box.

   r353012:
    Add a comment explaining why the opensolaris_load line in loader.conf
    is explicitly added.

  PR:		240478
  Approved by:	re (kib, early MFC)
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Changes:
_U  stable/11/
  stable/11/usr.sbin/bsdinstall/scripts/config
_U  stable/12/
  stable/12/usr.sbin/bsdinstall/scripts/config
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-10-03 14:41:40 UTC
A commit references this bug:

Author: gjb
Date: Thu Oct  3 14:41:21 UTC 2019
New revision: 353048
URL: https://svnweb.freebsd.org/changeset/base/353048

Log:
  MFS12 r353047:
   MFC r353004, r353012:
   r353004:
    Explicitly add opensolaris_load="YES" to loader.conf through the
    installer when installing the system on a ZFS root filesystem.

    For arm64, zfs_load="YES" does not add opensolaris.ko as a kld
    dependency, so add it explicitly to prevent boot-time failures
    out-of-box.

   r353012:
    Add a comment explaining why the opensolaris_load line in loader.conf
    is explicitly added.

  PR:		240478
  Approved by:	re (kib)
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Changes:
_U  releng/12.1/
  releng/12.1/usr.sbin/bsdinstall/scripts/config
Comment 9 Henri Hennebert 2020-09-06 12:37:23 UTC
After the switch to OpenZFS this line must be added to loader.conf:

cryptodev_load="YES"