On Thu, Jul 23, 2015 at 8:22 AM, Roderick Johnstone <rmj@ast.cam.ac.uk> wrote:
Do you also have the shutdown service enabled?

No, I don't.

So then I guess it would need to rebuild the kmod for all installed kernels, not just the currently running one as it can't know which kernel you might want to boot, although the latest would probably be a good guess.

Well the answer to your first statement is no then yes then no :)

For some reason I setup the shutdown service to run akmods directly instead of calling a script which would "collect" the installed kernels, so no, it would only try to build for the current kernel via "uname -r".

Then yes, because I just changed the service file to run a script which would grab all of the installed kernels and pass them to akmods.

Then no, because it can only build kernel modules for kernels that have the appropriate kernel-devel package installed, but currently unlike the kernel itself, only one kernel-devel package is typically installed at one time. :)

Could you follow all that?

So basically once I build new packages, the shutdown script will attempt to build modules for every kernel-devel package installed, whether it be the latest or not (though it typically should be).

Ok, now that that's covered I have a crazy idea... For systemd service type "oneshot" which the akmod service is, you can have multiple ExecStart= directives. Why couldn't we have two, something like:

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/sbin/akmods --from-init
ExecStart=-/usr/sbin/modprobe nvidia

Anything know why that wouldn't work? That should fix the problem with building modules on startup.

Thanks,
Richard