Ubuntu kernel updates
Matt Domsch
Matt_Domsch at dell.com
Tue Jun 12 07:35:56 CDT 2007
On Tue, Jun 12, 2007 at 08:11:24AM +0200, Alexander Brinkman wrote:
> On Mon, 2007-06-11 at 16:25 -0500, Matt Domsch wrote:
> > For Ubuntu, we're looking at using the /etc/kernel/postinst.d/
> > directory which lets dkms drop in a script that's run on install of a
> > new linux-image-* deb. We might be able to catch the now-broken state
> > of affairs and fix it up...
>
> Unfortunatly it can't be used for building new kernel modules, but if
> it's just for fixing a broken state it's the right place...
We've found that we can cleanly use /etc/kernel/preinst.d/dkms, a new
script, to uninstall all dkms modules for $kernelversion, the version
of the linux-image-$kernelversion being installed, (they're going to
get get overwritten anyhow, so might as well uninstall). Then we can
use /etc/kernel/postinst.d/dkms, a new script, to invoke
dkms_autoinstaller to install or reinstall modules. This works fine
for the upgrade from 2.6.20-15.X -> 2.6.20-15.Y case, but as you point
out, won't necessarily work going from 2.6.20-15.X to 2.6.20-16.Z
because linux-headers-2.6.20-16-generic isn't necessarily installed
yet.
Now, I think we've got a solution to this too. Lucky for us, there's
another hook we can use. The linux-headers package lets us define:
header_postinst_hook=/etc/kernel/postinst.d/dkms
in /etc/kernel-img.conf. This gets called at runtime after
linux-headers gets installed; and we can use it to invoke the
dkms_autoinstaller again.
This means, you'll need AUTOINSTALL=yes in your dkms.conf files, but
with that, it should all work automagically. I think...
So, dkms_autoinstaller will get invoked twice now; once after
linux-image is installed, and once after linux-headers is installed.
Thoughts?
Thanks to Mike Morgan for helping me with the preinst/postinst
scripting and thought processes.
Thanks,
Matt
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
More information about the DKMS-devel
mailing list