Using akmods
How & why to use livna's "automagical" akmods instead of regular 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+
Requirements
-
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 --en updates-testing install kernel kernel-devel kernel-headersORyum --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 2.6.25.11-92.fc9.x86_64
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".
- Install livna's yum repo, if it is not already installed.
-
Determine which pre-built kmods you already have installed, if any. It's important to note that the livna-built kmods in the livna repo will take precedence over your locally-built akmods for the same kernel version, because the "lvn9" tag is "newer" than "fc9" in the package name comparison. All this really means is that for official kernel releases, livna's kmods will eventually update your akmod kmods as soon as they're available, so your akmod only served to fill in the gap while it was unavailable, but for custom kernels, where no livna kmod will ever be 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 livna's version and bring in the kmod-nvidia meta-package dependency as well.)
[root@f9-64vm1 ~]# rpm -qa kmod-\*
kmod-nvidia-173.14.09-2.lvn9.x86_64
kmod-nvidia-2.6.25.9-76.fc9.x86_64-173.14.09-2.lvn9.x86_64 - Determine the available akmod kernel modules you want to use. For this howto, we'll be using the nvidia kmod for example:
[root@f9-64vm1 ~]# yum list akmod-\*
akmod-em8300.x86_64 0.17.0-0.3.rc1 livna
akmod-gspca.x86_64 1.00.20-10.lvn9 livna
akmod-iscsitarget.x86_64 1:0.4.15-31.svn147.lvn livna
akmod-kqemu.x86_64 1.3.0-0.32.lvn9 livna
akmod-madwifi.x86_64 0.9.4-32.lvn9 livna
akmod-ndiswrapper.x86_64 1.52-31.lvn9 livna
akmod-nvidia.x86_64 173.14.09-2.lvn9 livna
akmod-qc-usb.x86_64 0.6.6-31.lvn9 livna - 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 livna; the rest from fedora):
[root@f9-64vm1 ~]# yum install akmod-nvidia
...
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
akmod-nvidia x86_64 173.14.09-2.lvn9 livna 4.8 M
Installing for dependencies:
akmods noarch 0.3.1-1.lvn9 livna 14 k
elfutils x86_64 0.133-3.fc9 fedora 214 k
elfutils-libs x86_64 0.133-3.fc9 fedora 173 k
fakeroot x86_64 1.6.4-16.fc9 fedora 76 k
gcc x86_64 4.3.0-8 fedora 10 M
gcc-c++ x86_64 4.3.0-8 fedora 4.3 M
glibc-devel x86_64 2.8-3 fedora 2.5 M
glibc-headers x86_64 2.8-3 fedora 602 k
kernel-devel x86_64 2.6.25.9-76.fc9 updates 5.2 M
kernel-headers x86_64 2.6.25.9-76.fc9 updates 718 k
kmodtool noarch 1-11.lvn9 livna 11 k
libstdc++-devel x86_64 4.3.0-8 fedora 3.8 M
redhat-rpm-config noarch 9.0.2-1.fc9 fedora 54 k
rpm-build x86_64 4.4.2.3-2.fc9 fedora 306 k
rpmdevtools noarch 6.6-1.fc9 fedora 71 k
Transaction Summary
=============================================================================
Install 16 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 33 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@f9-64vm1 ~]# service akmods restart
Checking kmods exist for 2.6.25.9-76.fc9.x86_64 [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 livna 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. "Build Host" should match your hostname, not livna's; the "Release" should say "fc9", not "lvn9", and the "Build Date" should be very recent:[root@f9-64vm1 ~]# rpm -qa kmod-nvidia\*
kmod-nvidia-2.6.25.9-76.fc9.x86_64-173.14.09-2.fc9.x86_64
[root@f9-64vm1 ~]# rpm -qai kmod-nvidia\*76\*
Name : kmod-nvidia-2.6.25.9-76.fc9.x86_64 Relocations: (not relocatable)
Version : 173.14.09 Vendor: (none)
Release : 2.fc9 Build Date: Wed 02 Jul 2008 10:26:38 AM EDT
Install Date: Wed 02 Jul 2008 10:26:49 AM EDT Build Host: f9-64vm1
Group : System Environment/Kernel Source RPM: nvidia-kmod-173.14.09-2.fc9.src.rpm
Size : 10318720 License: Redistributable, no modification permitted
Signature : (none)
URL : http://www.nvidia.com/
Summary : nvidia kernel module(s) for 2.6.25.9-76.fc9.x86_64
Description :
This package provides the nvidia kernel modules built for the Linux
kernel 2.6.25.9-76.fc9.x86_64 for the x86_64 family of processors.
That's it. Leave it on autopilot. No more kmod headaches.
More Information
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")
Disclaimer
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

