-
Notifications
You must be signed in to change notification settings - Fork 20
Updating DKMS modules in initramfs doesn't trigger update #44
Comments
I haven't tried it, but it seems like this could be solved using the same technique described in the Arch wiki for automatically rebuilding the initial ramdisk. |
I've worked around it by adding "Target = nvidia-dkms" to /usr/share/libalpm/hooks/95-sbupdate.hook. There are already hooks for intel-ucode and amd-ucode in that file. Ideally, there should be a way to trigger it any time mkinitcpio is run (rather than on specific packages), but without running it twice when pacman does a kernel update. Maybe a combination of a hook that runs whenever mkinitcpio runs and a cli option to not regenerate/re-sign the .efi file if it is already newer than the kernel and initramfs. |
A more generic workaround might be to change the path triggers in 95-sbupdate.hook to the following:
These are the triggers from 90-mkinitcpio-install.hook and 70-dkms-install.hook, so they should cause sbupdate to trigger whenever dkms triggers or mkinitcpio runs. However, I've found another issue. It seems that with either this solution or the "Target=nvidia-dkms" solution, the alpm hooks are run in the wrong order. It's running sbupdate before it runs mkinitcpio:
I'm not sure why this is. According to alpm-hooks, the hooks are run in alphabetical order, which should mean that the sbupdate hook runs after any dkms/mkinitcpio stuff. It might be a bug in libalpm. |
Never mind the hook order thing - I just needed my custom nvidia hook to run before sbupdate (fixed by renaming nvidia.hook to 94-nvidia.hook). I'll create a pull request for the proposed target fix. |
If a DKMS module is included in the initramfs (via MODULES= in mkinitcpio.conf) and the DKMS module is update, sbupdate hooks are not triggered. Here is an example scenario:
When nvidia-dkms is updated to a newer version, pacman automatically runs dkms install followed by mkinitcpio. However, sbupdate is not run (this can be verified by observing that the signed EFI file is older than the initramfs).
The text was updated successfully, but these errors were encountered: