Bug 1023598 - dkms does not handle module dependencies
Summary: dkms does not handle module dependencies
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dkms
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Simone Caronni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-25 21:49 UTC by Richard Yao
Modified: 2013-12-01 02:52 UTC (History)
7 users (show)

Fixed In Version: dkms-2.2.0.3-20.el6
Clone Of:
Environment:
Last Closed: 2013-11-23 19:32:26 UTC
Type: Bug
Embargoed:
negativo17: needinfo-


Attachments (Terms of Use)

Description Richard Yao 2013-10-25 21:49:17 UTC
Anyone trying to use Fedora with ZFS or Lustre (with a ZFS OSD) will run into a problem where modules are built out of order. The upstream DKMS is not able to handle module dependencies.

A workaround is in place where ZFSOnLinux maintains a patched version of the dkms package in its repository, but every once in a while, someone who already has the Fedora version installed installs ZFS and the ZFSOnLinux version is not used. This is a pain for the volunteers that do ZFSOnLinux support, so it would be greatly appreciated if this were fixed in Fedora (and possibly other Redhat operating systems, such as RHEL).

Here is a link to the source RPM, which contains the patches that ZFSOnLinux applies:

http://archive.zfsonlinux.org/fedora/19/SRPMS/dkms-2.2.0.3-14.zfs1.fc19.src.rpm

Comment 1 Simone Caronni 2013-10-25 22:53:46 UTC
As a matter of fact I was actually looking at it a few days ago and was planning to import the same patches. :)

The patches that ZFSOnLinux has applied to the base dkms are here:

https://github.com/zfsonlinux/dkms/tree/master/ubuntu/saucy/debian/patches

Some of them are already applied in the tree.

I will look at it next week (I'm off for the weekend).

Comment 2 Simone Caronni 2013-11-04 15:59:08 UTC
Hello, sorry for the delay, real work got in the middle.

I've applied all patches from ZFS On Linux, can you give it a try before I push the update to Bodhi?

http://koji.fedoraproject.org/koji/packageinfo?packageID=1605

I've built it for el5, el6, f18, f19, f20 and rawhide.

Thanks,
--Simone

Comment 3 Simone Caronni 2013-11-04 15:59:44 UTC
Build is dkms-2.2.0.3-18.

Comment 4 Brian Behlendorf 2013-11-04 23:15:02 UTC
Thanks Simole for adding these patches!  I can verify your updated packages work properly.  When I next refresh Fedora/EPEL packages in the ZFS on Linux repository I'll happily remove our custom version of DKMS.

Comment 5 Simone Caronni 2013-11-05 07:52:51 UTC
I would like to push the update today to all branches. One question, maybe you can help. Do you know how to reformat a man page for an older man version?

The DKMS man page does not render properly on el5/el6 and I don't know how to reformat it:

https://bugzilla.redhat.com/show_bug.cgi?id=986660#c5

Do you have any idea on how to do it? Otherwise I'll just push the update as is with the ZFS On Linux patches.

Thanks & regards,
--Simone

Comment 6 Darik Horn 2013-11-05 19:00:51 UTC
The imported `dkms-add_BUILD_DEPENDS.patch` could be incomplete for some systems.  Unless somebody verifies that it isn't necessary for all RHEL/EPEL/Fedora variants, consider adding the `dkms_conf_variables` change here:

https://github.com/zfsonlinux/dkms/blob/master/ubuntu/precise/debian/patches/0003-Add-dependency-logic-for-automatic-builds.patch#L32

This part of the patch ensures that the BUILD_DEPENDS variable is preserved during environment sanitization.

Given that there are several variants of this patch in circulation, some of which are imperfect, keeping the git header and/or commit hash intact during import would be appreciated.

Comment 7 Simone Caronni 2013-11-06 08:52:27 UTC
(In reply to Darik Horn from comment #6)
> https://github.com/zfsonlinux/dkms/blob/master/ubuntu/precise/debian/patches/
> 0003-Add-dependency-logic-for-automatic-builds.patch#L32

Ouch, looked at https://github.com/zfsonlinux/dkms/blob/master/ubuntu/saucy for all patches. Will re-check with the ubuntu/precise for differences.

> Given that there are several variants of this patch in circulation, some of
> which are imperfect, keeping the git header and/or commit hash intact during
> import would be appreciated.

Will try to re-add headers; all the other patches have been recreated as since a few years patches need to apply with --fuzz=0.

Comment 8 Simone Caronni 2013-11-06 10:35:28 UTC
Ok, I've added all the missing ZFS On Linux patches in both ubuntu/saucy and ubuntu/precise and the man patch.

All patches coming from zfsonlinux (7) have your headers back. I've also added a note in the spec file:

Patch0:         %{name}-git.patch
Patch1:         %{name}-force-tarball.patch
Patch2:         %{name}-fix-mkrpm.patch
Patch3:         %{name}-man.patch
# Patches coming from ZFS On Linux project for functionality / bugfixes
# https://github.com/zfsonlinux/dkms/tree/master/ubuntu/saucy/debian/patches
Patch4:         %{name}-cleanup-after-removal.patch
Patch5:         %{name}-do-not-fail-on-modules-dir.patch
# https://github.com/zfsonlinux/dkms/tree/master/ubuntu/precise/debian/patches
Patch6:         %{name}-add-POST_BUILD-to-the-dkms_conf_variables-list.patch
Patch7:         %{name}-use-STRIP-0-as-the-default-for-the-STRIP-array.patch
Patch8:         %{name}-add-dependency-logic-for-automatic-builds.patch
Patch9:         %{name}-fix-zfs-autoinstall-failures-for-kernel-upgrades.patch
Patch10:        %{name}-reset-build-dependencies.patch

It works for me with my modules. Can you make a test?

http://koji.fedoraproject.org/koji/packageinfo?packageID=1605

As before I've built it for el5, el6, f18, f19, f20 and rawhide.

Comment 9 Simone Caronni 2013-11-06 10:36:27 UTC
(In reply to Simone Caronni from comment #8)
> http://koji.fedoraproject.org/koji/packageinfo?packageID=1605
> 
> As before I've built it for el5, el6, f18, f19, f20 and rawhide.

..and build is dkms-2.2.0.3-19.

Comment 10 Simone Caronni 2013-11-06 10:42:25 UTC
Unfortunately it does not work on el5:

[root@localhost ~]# /etc/init.d/dkms_autoinstaller start
Starting dkms: /usr/sbin/dkms: line 3181: local: -A: invalid option
local: usage: local name[=value] ...

The issue is here:

https://github.com/zfsonlinux/dkms/blob/master/ubuntu/precise/debian/patches/0003-Add-dependency-logic-for-automatic-builds.patch#L45

Comment 11 Darik Horn 2013-11-07 00:57:25 UTC
(In reply to Simone Caronni from comment #10)
> Unfortunately it does not work on el5:
> 
> [root@localhost ~]# /etc/init.d/dkms_autoinstaller start
> Starting dkms: /usr/sbin/dkms: line 3181: local: -A: invalid option
> local: usage: local name[=value] ...

The BUILD_DEPENDS enhancement uses associative arrays, but el5 is shipping bash-3.2.25, which does not implement the required language feature.

However, el5 is shipping Linux 2.6.18, which is incompatible with ZoL.  I would therefore just disable the patch for that platform, but if you need code uniformity, then you should be able to disable only line 3181 and still get a good result for the supported platforms.

Comment 12 Richard Yao 2013-11-07 01:12:24 UTC
Another option is to rework this to stop depending on associative arrays. That way everyone will be happy. Darik, would you mind doing this?

Comment 13 Darik Horn 2013-11-07 01:23:24 UTC
(In reply to Richard Yao from comment #12)
> Another option is to rework this to stop depending on associative arrays.
> That way everyone will be happy. Darik, would you mind doing this?

If @superm1 or another upstream maintainer does a review and indicates what would be acceptable for upstream inclusion then I will look at scheduling the work.

Comment 14 Richard Yao 2013-11-07 02:59:51 UTC
It occurred to me that ZoL is expected to work on RHEL5 provided that a RHEL6 kernel is used. Disabling that patch for RHEL5 will cause problems whenever someone using a RHEL6 kernel wants to install ZoL. That should be sufficient to make bash 3.2.25 compatibility mandatory.

Comment 15 Brian Behlendorf 2013-11-07 17:01:30 UTC
I agree with Darik.  ZFS on Linux does not support el5 due to the incompatible kernel it ships with.  Therefore simply disabling the patch for el5 is probably the most straight forward thing to do.  Trying to accommodate the vanishingly small number of users running el5 with an el6 kernel shouldn't impede making this improvement available to el6, fc18, fc19, fc20 users.

If needed, reworking the patch for upstream inclusion would be desirable.  But we'd want to make sure it was done in a way which they could accept.

Comment 16 Simone Caronni 2013-11-07 17:22:36 UTC
Ok, I will excluide(In reply to Brian Behlendorf from comment #15)
> Trying to accommodate the vanishingly small number of users running el5 with
> an el6 kernel shouldn't impede making this improvement available to el6, fc18,
> fc19, fc20 users.

I agree with this. I will eliminate patch 8, 9 and 10 on EPEL 5. Can you confirm that the dkms package in comment #9 is working as expected in Fedora / RHEL 6? It works fine for me for normal packages.

Thanks,
--Simone

Comment 17 Simone Caronni 2013-11-11 09:57:28 UTC
Hello, can someone give feedback if the package is working as expected for ZFS On Linux on el6/fedora?

Thanks,
--Simone

Comment 18 Brian Behlendorf 2013-11-12 18:30:54 UTC
Sorry, I though I already posted this comment.  The patches appear to be working as expected for el6 and fedora.  Thanks.

Comment 19 Fedora Update System 2013-11-13 12:00:29 UTC
dkms-2.2.0.3-20.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-20.el6

Comment 20 Fedora Update System 2013-11-13 12:01:30 UTC
dkms-2.2.0.3-20.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-20.fc18

Comment 21 Fedora Update System 2013-11-13 12:02:16 UTC
dkms-2.2.0.3-20.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-20.fc19

Comment 22 Fedora Update System 2013-11-13 12:03:15 UTC
dkms-2.2.0.3-20.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-20.fc20

Comment 23 Fedora Update System 2013-11-13 18:50:06 UTC
Package dkms-2.2.0.3-20.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing dkms-2.2.0.3-20.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2013-12089/dkms-2.2.0.3-20.el6
then log in and leave karma (feedback).

Comment 24 Fedora Update System 2013-11-23 19:32:26 UTC
dkms-2.2.0.3-20.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2013-11-23 19:49:29 UTC
dkms-2.2.0.3-20.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2013-11-24 03:37:17 UTC
dkms-2.2.0.3-20.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2013-12-01 02:52:28 UTC
dkms-2.2.0.3-20.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.