DKMS on Ubuntu

Matt Domsch Matt_Domsch at dell.com
Tue Dec 5 07:42:42 CST 2006


On Tue, Dec 05, 2006 at 10:55:33AM +0100, Alexander Brinkman wrote:
> Hi all,
> 
> We are using Ubuntu (6.06 LTS) on our Dell Precisions which (for the
> newer models) requires an updated tg3 (NIC) driver. Using DKMS for this
> works fine, however we've noticed a minor issue: when no driver is found
> during boot the module is compiled, but it is done too late in the boot
> process to have any effect. Though an extra reboot solves this it is not
> the most graceful solution ;).
> 
> For our tg3 module there seem to be two changes that solve this
> permanently:
> 
> First, the dkms_autoinstaller script in init.d needs to run as early as
> possible; on Ubuntu 6.06 this would probably be in runlevel S, number
> 23. Though I know nothing of debian packaging if I'm not mistaken this
> can be done in the rules file with:
> 
> dh_installinit --name dkms_autoinstaller --params start 23 S .
> 
> Second, the new compiled module is not automatically loaded by Ubuntu
> (perhaps because of the old one, though at build time it is not in
> memory). Adding the following code after the depmod stuff in the dkms
> script makes it work though:
> 
> if ! [ "`lsmod | grep -w $module`" = "" ]; then
>   rmmod $module
> fi
> modprobe $module
> 
> Brgds,
>   Alexander Brinkman,
>   MARIN.

Thanks much, I'll look at incorporating these.  As removing modules at
runtime can be occasionally dangerous (or just plain fail - witness
ipv6's gratituous bumping of the module reference count to ensure it
can't ever be unloaded), the even more ideal solution would be to run
dkms_autoinstaller at new kernel install time so the autoinstaller at
boot has nothing to do. :-) Is anyone familiar enough with
Debian/Ubuntu's kernel packages to know when the initrds are made?
It's before /sbin/installkernel is invoked I think.  We need to add
something like:

[ -x /usr/sbin/dkms ] && /etc/init.d/dkms_autoinstaller start

before making the initrds.
(and yes, we'd like to do this for other distros too...)

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