FS#52901 - [dkms] figure out dependencies in alpm hook

Attached to Project: Arch Linux
Opened by Jianfeng Zhang (swordfeng) - Wednesday, 08 February 2017, 14:37 GMT
Last edited by Sébastien Luttringer (seblu) - Friday, 26 October 2018, 13:59 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 15
Private No

Details

The current alpm hook in the package will not check if one dkms module depends on another, so some modules fail to build.

Version: dkms 2.3-2
How to reproduce:
Install spl-dkms-git, zfs-dkms-git from AUR, zfs depends on spl.
When each time the hook is invoked (like upgrading the kernel), zfs is compiled before spl and triggers an error.

I think the hook may check the "BUILD_DEPENDS" field in the dkms.conf (the description can be found in `man dkms`).
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Friday, 26 October 2018, 13:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  dkms-2.5-2
Comment by Sébastien Luttringer (seblu) - Saturday, 11 February 2017, 21:13 GMT
Please provide a patch.
Comment by Jianfeng Zhang (swordfeng) - Monday, 13 February 2017, 02:44 GMT Comment by Jianfeng Zhang (swordfeng) - Monday, 13 February 2017, 14:34 GMT
updated a better method to read BUILD_DEPENDS

I feel sorry that I'm not familiar with bash programming, and I hope someone can help to improve it...
Comment by Marcel Korpel (Marcel-) - Sunday, 13 August 2017, 20:04 GMT
swordfeng: Your patch is no longer available; can you upload it again so we can inspect it?
Comment by Jianfeng Zhang (swordfeng) - Tuesday, 15 August 2017, 03:31 GMT
Marcel-: Sorry for my late reply. I have uploaded my version onto AUR here: https://aur.archlinux.org/cgit/aur.git/tree/alpm-hook?h=dkms-sorted
Feel free to take it.
Comment by Claudia Pellegrino (Auerhuhn) - Sunday, 17 September 2017, 11:27 GMT
I have replaced dkms by dkms-sorted on my system for testing.

Also, I have mentioned the package in the wiki [1] [2] to encourage more people to test it. (Will remove the note once the patch is integrated into dkms proper.)

[1]: https://wiki.archlinux.org/index.php/ZFS#DKMS
[2]: https://wiki.archlinux.org/index.php/Dynamic_Kernel_Module_Support#Upgrades
Comment by Jiachen Yang (farseerfc) - Sunday, 17 September 2017, 12:41 GMT
Just to put my two cents, I have been using dkms-sorted 2.3-2 from Mar 4th and current version of it 2.4.0-2 from Aug 17th.
The {zfs,spl}-dkms-git updated quite often (85 times on my machine) during this period and there was no issues.
Really hope this patch can make it into dkms package.
Comment by Claudia Pellegrino (Auerhuhn) - Monday, 30 October 2017, 07:48 GMT
Update: The patch has worked flawlessly for me so far.

In my opinion, this is going to make ZFS users’ lives a lot easier.
@Sébastien What needs to be done to get this patch merged?
Comment by Zach Dykstra (zdykstra) - Wednesday, 13 December 2017, 17:40 GMT
I've been using this patched version for a few months now, with both the linux and linux-zen kernels, ZFS, SPL and Nvidia DKMS modules. It has worked perfectly so far. I forgot about it until the recent DKMS package update reverted the patched alpm-hook, causing my kernel upgrades to fail. What additional information is needed to get this patch merged? It's vital for ZFS users.
Comment by Eli Schwartz (eschwartz) - Tuesday, 17 April 2018, 23:21 GMT
@seblu, you asked for a patch over a year ago, meanwhile a package containing a modified hook has been available in the AUR, and the wiki has pointed dkms users to it. It seems to be working out pretty well according to a bunch of people.

What are your thoughts on utilizing these changes?

https://aur.archlinux.org/cgit/aur.git/tree/alpm-hook?h=dkms-sorted
Comment by Sébastien Luttringer (seblu) - Sunday, 27 May 2018, 00:10 GMT
There is some sh syntax to convert into bash, but looks good. I'll merge it.
Comment by Sébastien Luttringer (seblu) - Sunday, 27 May 2018, 00:38 GMT
I remember now, there was also issues with check_kernel, which is called twice. So, this needs to be reworked a bit.
Comment by Sébastien Luttringer (seblu) - Sunday, 27 May 2018, 03:24 GMT
And finally, this means that the hook must know what dkms action needs to be executed. It can no longer just take arguments from the trigger and rely on dkms to sanitize input.
So, it requires more changes, that's why I put it back a year ago. But the feature make sense, I'm on it.
Comment by Sébastien Luttringer (seblu) - Sunday, 27 May 2018, 19:00 GMT
Version dkms-2.5-2 in testing should implement this. As a bonus, it also support BUILD_EXCLUSIVE_KERNEL, which will be useful for virtualbox modules and kernel >= 4.16.
Comment by Eli Schwartz (eschwartz) - Thursday, 07 June 2018, 00:08 GMT
Some minor nitpicking on the bash used in the latest version, see attached patch.

Basically those herestrings are unnecessary.
Comment by Sébastien Luttringer (seblu) - Friday, 26 October 2018, 11:39 GMT
I updated wiki and removed dkms-sorted from AUR since we have this supported here now.
Comment by Claudia Pellegrino (Auerhuhn) - Friday, 26 October 2018, 11:41 GMT
Thanks Sébastien! This is a good day for ZFS users.
Comment by Sébastien Luttringer (seblu) - Friday, 26 October 2018, 13:59 GMT
@eschwartz: Thanks for the patches, they are smart.

Loading...