How & why to use rpmfusion's "automagical" source akmods instead of regular binary kmods (kernel modules).
Using akmods, as soon as you install a new kernel, if a matching kmod version does not already exist, it will automatically be rebuilt from the akmod source rpm and immediately installed.
Applicable to Fedora Versions
- Fedora 9+
kernel-devel must also be installed for each kernel version, because kernel-devel is only brought in as an akmods dependency the first time it's installed, and only if it's available in a repo (e.g. in updates-testing)
NOTE: If you neglect to install kernel-devel at the same time as the kernel, then the post-install akmod rebuild will FAIL, so make sure to do:
yum --enablerepo updates-testing install kernel kernel-devel kernel-headersOR
yum --nogpg localinstall kernel*(in this case you don't escape the '*' wildcard). If you did forget, but then subsequently installed kernel-devel AFTER the kernel, you can still force the akmod to be rebuilt now, without rebooting, for the specific kernel version just installed (rather than the current running kernel) by doing, for example:
akmods --kernels 184.108.40.206-124.fc13.i686
Doing the Work
Summary: install the akmod-foobar which gets autobuilt into kmod-foobar, then reboot, or rebuild it now for the current kernel, by running "service akmods restart".
- Configure yum to use RPMFUSION, if it is not already configured.
Determine which pre-built kmods you already have installed, if any. It's important to note that the rpmfusion-built kmods in the rpmfusion repo will eventually take precedence and update your locally-built akmods for the same kernel version as soon as they're made available, so your akmod only served to fill in the gap while it was unavailable. For custom kernels, where no regular rpmfusion kmod will ever be made available, your akmod kmod will always reign supreme.
(So, it's pointless to remove "kmod-nvidia" and then install "akmod-nvidia", because a subsequent yum update will eventually update your locally-built "kmod-nvidia-kernelversion" to rpmfusion's version and bring in the kmod-nvidia meta-package dependency as well.)
[root@f13 ~]# rpm -qa kmod-\*
- Determine the available akmod kernel modules you want to use. For this howto, we'll be using the nvidia kmod for example:
[root@f13 ~]# yum list akmod-\*
akmod-VirtualBox-OSE.i686 3.1.8-1 rpmfusion-free
akmod-em8300.i686 0.18.0-1.fc13.5 rpmfusion-free
akmod-kqemu.i686 1.4.0-0.2.pre1.fc13.21 rpmfusion-free
akmod-ndiswrapper.i686 1.54-4.fc13.20 rpmfusion-free
akmod-nvidia.i686 1:195.36.24-2.fc13 rpmfusion-nonfree-update
akmod-omnibook.i686 2.20090714-0.4.svn288.fc13.5 rpmfusion-free
akmod-open-vm-tools.i686 0.0.0.243334-1.fc13.5 rpmfusion-free
akmod-rt2860.i686 220.127.116.11-1.fc13.1 rpmfusion-free
akmod-rt2870.i686 18.104.22.168-6.fc13.5 rpmfusion-free
akmod-rt3070.i686 22.214.171.124-3.fc13.12 rpmfusion-free
akmod-west-chamber.i686 0.0.1-4.20100405svn.fc13.5 rpmfusion-free
akmod-wl.i686 126.96.36.199-1.fc13.5 rpmfusion-nonfree
akmod-xtables-addons.i686 1.27-1.fc13 rpmfusion-free-updates
- Install the akmod. The first time you install an akmod it will also install the dependencies necessary to build and manage them (kmodtool and akmods from rpmfusion; the rest from fedora):
[root@f13 ~]# yum install akmod-nvidia...
Package Arch Version Repository Size
akmod-nvidia i686 1:195.36.24-2.fc13 rpmfusion-nonfree-updates 6.2 M
Installing for dependencies:
akmods noarch 0.3.6-3.fc12 rpmfusion-free 16 k
cloog-ppl i686 0.15.7-1.fc12 fedora 81 k
cpp i686 4.4.4-2.fc13 fedora 3.3 M
fakeroot i686 1.12.4-1.fc13 fedora 74 k
fakeroot-libs i686 1.12.4-1.fc13 fedora 51 k
gcc i686 4.4.4-2.fc13 fedora 8.1 M
glibc-devel i686 2.12-2 updates 960 k
glibc-headers i686 2.12-2 updates 599 k
kernel-devel i686 188.8.131.52-124.fc13 updates 6.3 M
kernel-headers i686 184.108.40.206-124.fc13 updates 764 k
kmodtool noarch 1-18.fc11 rpmfusion-free 13 k
livna-config-display noarch 0.0.23-1.fc11 rpmfusion-nonfree 68 k
nvidia-settings i686 1.0-4.fc13 rpmfusion-nonfree 657 k
nvidia-xconfig i686 1.0-2.fc13 rpmfusion-nonfree 74 k
ppl i686 0.10.2-10.fc12 fedora 1.1 M
rpm-build i686 4.8.0-14.fc13 fedora 125 k
rpmdevtools noarch 7.8-1.fc13 fedora 109 k
system-config-display i686 2.2-1.fc12 fedora 184 k
xorg-x11-drv-nvidia i686 1:195.36.24-1.fc13 rpmfusion-nonfree 1.6 M
xorg-x11-drv-nvidia-libs i686 1:195.36.24-1.fc13 rpmfusion-nonfree 13 M
Install 21 Package(s)
Upgrade 0 Package(s)
Total download size: 43 M
Installed size: 124 M
Is this ok [y/N]: y
Normally, your akmods are automatically rebuilt into kmods when you 1) install a NEW kernel for which no kmod yet exists, or 2) reboot into an old kernel for which no kmod yet exists, or 3) reboot and there's an updated akmod version to be rebuilt for the same (or newer) kernel version.
You can either reboot now to have the kmod rebuilt by the "akmods" service scripts, or, you can force it to rebuild now:
[root@f13 ~]# service akmods restart
Checking kmods exist for 220.127.116.11-124.fc13.i686 [WARNING]
Building and installing nvidia-kmod [ OK ]
The "[WARNING]" is to inform you that the kmod doesn't exist, so it's being rebuilt and installed. It should take less than a minute to build on decent hardware. If it just says "[OK]" then you either already have the rpmfusion kmod installed, or have already rebuilt the akmod previously. If it says "[FAILED]", then something went horribly wrong, but the first thing to check is that you have also installed "kernel-devel".To verify that your kmod was built and installed locally, check the rpm info. The "Build Host" should match your hostname, not rpmfusion's, and the "Build Date" should be very recent:
[root@f13 ~]# rpm -qai kmod-nvidia-$(uname -r)
Name : kmod-nvidia-18.104.22.168-124.fc13.i686 Relocations: (not relocatable)
Version : 195.36.24 Vendor: (none)
Release : 2.fc13 Build Date: Thu 24 Jun 2010 05:19:22 PM EDT
Install Date: Thu 24 Jun 2010 05:19:47 PM EDT Build Host: ion
Group : System Environment/Kernel Source RPM: nvidia-kmod-195.36.24-2.fc13.src.rpm
Size : 13257320 License: Redistributable, no modification permitted
Signature : (none)
URL : http://www.nvidia.com/
Summary : nvidia kernel module(s) for 22.214.171.124-124.fc13.i686
This package provides the nvidia kernel modules built for the Linux
kernel 126.96.36.199-124.fc13.i686 for the i686 family of processors.
That's it. Leave it on autopilot. No more kmod headaches.
How does it work (in general)?
How does the kmod get rebuilt immediately after a kernel is installed? By the postinstall script in /etc/kernel/postinst.d/akmods (note: the only other postinst script currently is supplied by "dkms")
We test this stuff on our own machines - really we do - but you may run into problems; if you do, come to #fedora on irc.freenode.net