Slow boots after kernel updates due to akmods
Issue:
System boot takes a long time since akmods are required to be built after "Shutdown and Apply Updates".
Possible solutions:
Solution 1
System already restarts once on using "Shutdown and Apply Updates". If we restart one more time after applying updates, the new akmods can be built. This can be smart on the basis of if there are kernel updates and if new akmods need to be built. Not an expert on this.
Solution 2
Can akmods
be run after kernel updates automatically/as part of the kernel packages as a scriptlet? I guess in this case it is packaging/distro-specific? Will there be any issue running akmods
when the system has not fully updated?
Example log
This shows that boot took approximately 2.5 minutes more than average.
❯ sudo systemctl status akmods
● akmods.service - Builds and install new kmods from akmod packages
Loaded: loaded (/usr/lib/systemd/system/akmods.service; enabled; vendor preset: enabled)
Active: active (exited) since Sat 2021-08-21 21:33:32 BST; 1h 31min ago
Process: 785 ExecStart=/usr/sbin/akmods --from-init (code=exited, status=0/SUCCESS)
Main PID: 785 (code=exited, status=0/SUCCESS)
CPU: 4min 51.232s
Aug 21 21:31:13 megh-fedora systemd[1]: Starting Builds and install new kmods from akmod packages...
Aug 21 21:31:13 megh-fedora akmods[785]: Checking kmods exist for 5.13.10-200.fc34.x86_64[ OK ]
Aug 21 21:31:19 megh-fedora runuser[923]: pam_unix(runuser:session): session opened for user akmods(uid=975) by (uid=0)
Aug 21 21:32:44 megh-fedora runuser[923]: pam_unix(runuser:session): session closed for user akmods
Aug 21 21:33:31 megh-fedora akmods[785]: Building and installing nvidia-kmod[ OK ]
Aug 21 21:33:32 megh-fedora systemd[1]: Finished Builds and install new kmods from akmod packages.
Please let me know if this is not GNOME Software related and needs to be implemented somewhere else. Also let me know if any more info is needed