You are not logged in.

#1 2013-12-13 21:27:21

rgomes
Member
Registered: 2013-11-15
Posts: 43

DKMS running before kernel headers's update

I use DKMS to automatically build some modules for the kernel. In my case, one of the modules (bbswitch) depends on the kernel headers.
However, on every update, DKMS is called, because the kernel is installed, before the headers are installed. This causes the build of bbswitch to fail, and every time I reboot I have to manually build it (the big inconvenience here is that, without bbswitch, the graphics card stays on, which, if I forget to actually build the module, maybe because I don't want to reboot right away, sucks my battery life and makes my laptop heat up quite a bit).
Is there a way to force DKMS to happen later or the headers to be updated first?

Offline

#2 2013-12-24 10:08:34

Lekensteyn
Member
From: Netherlands
Registered: 2012-06-19
Posts: 192
Website

Re: DKMS running before kernel headers's update

If you use the stock kernel, then just install the bbswitch package which will be up-to-date with the latest kernel.

Otherwise, remember to run `dkms autoinstall -k $new_kernel_ver` after updating. You could create a systemd shutdown script for that.

Offline

#3 2013-12-24 11:53:09

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: DKMS running before kernel headers's update

Slightly off topic, but why doesn't the dkms package provide everything to accomplish its job?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2013-12-24 15:07:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: DKMS running before kernel headers's update

@graysky, I think by "automatically" the OP means that he/she is abusing mkinitpcio to do this.  So when the kernel is updated first, mkinitpcio is run in the install script, but that is not the end of all the transactions and at that point the kernel-headers have not been written to the disk (since they depend on the kernel of the same version).

So it is not a problem with dkms at all, it is an issue with the current state of pacman in combination with the hack that this person has implemented.

Offline

#5 2013-12-24 17:22:13

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: DKMS running before kernel headers's update

why pacman remove SyncFirst...

D:

Offline

#6 2013-12-24 17:55:17

rgomes
Member
Registered: 2013-11-15
Posts: 43

Re: DKMS running before kernel headers's update

@Lekensteyn
I am using linux-ck because graphics switching isn't working with the stock kernel at the moment (for more details: https://devtalk.nvidia.com/default/topi … er-crash/1 )

@WonderWooly @graysky
That is what I am doing, although I didn't understand it to be abusing mkinitcpio hmm (I just followed the guides on how to install the bbswitch hook).

Would there be a slightly less hacky way of having bbswitch installed automatically when a new linux-ck version is installed?

@Lekensteyn
What would the shutdown script look like?

Thanks!

Offline

#7 2013-12-24 21:40:39

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: DKMS running before kernel headers's update

rgomes wrote:

Would there be a slightly less hacky way of having bbswitch installed automatically when a new linux-ck version is installed?

Not yet. There is the idea of pacman hooks, but it hasn't been started yet
https://wiki.archlinux.org/index.php/De … dmap#Hooks

An unclean working hack would be this: start in mkinitcpio, find pacman parent process in pstree, fork to background and wait for pacman to exit. Then run your DKMS rebuild.

Last edited by progandy (2013-12-24 21:42:08)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#8 2013-12-26 14:09:49

Lekensteyn
Member
From: Netherlands
Registered: 2012-06-19
Posts: 192
Website

Re: DKMS running before kernel headers's update

rgomes wrote:

What would the shutdown script look like?

I don't have one ready, I think you can find it on the wiki. Personally I just try to remember to always rebuild with dkms after upgrading kernel.

Offline

Board footer

Powered by FluxBB