newbie questions

Matt Domsch Matt_Domsch at dell.com
Fri Dec 7 22:25:30 CST 2007


On Fri, Dec 07, 2007 at 03:41:12AM -0500, Jon Masters wrote:
> On Fri, 2007-12-07 at 08:10 +0700, Fajar A. Nugraha wrote:
> 
> > - forcing a call to /etc/init.d/dkms_autoinstaller during kernel upgrade
> > (using %post, or in my case by hijacking /sbin/weak-modules) might not
> > work, due to the fact that kernel-devel for that kernel version might
> > not be installed yet.
> 
> That's an interesting point.
> 
> I'm working on modifying weak-modules in RHEL5 to be more friendly with
> DKMS users, so that it'll let you call your own scripts automatically.
> But you're right that we might not have the -devel package installed at
> the moment that we call the weak-modules script. That possibly means we
> need to do something ugly...but I need to think some more :-)
> 
> Matt, do you have any particular preference about when/how this happens?

In Ubuntu, we cheat.  Seriously. :-)

Both the linux and linux-headers packages have post-install scripts
that get run.  I run dkms_autoinstaller in both, and it simply fails
the on the first run (when only one of the two is present), but
succeeds on the second (when both are now present).  It's a hack, but
it works.

Going forward, we should use dpkg triggers.  They're new starting with
Gutsy, but we can have dkms "listen" for a trigger, and have the linux
and linux-headers packages call dpkg-trigger in their postinst script.
Triggers get run once, at the end of the package install transaction,
which is exactly what we would want.

In RPM, we can use %posttrans in kernel and kernel-devel to invoke the
dkms_autoinstaller, but it'll run twice then (succeed the first time,
and ignore the second time), which is better, but not ideal.

We don't have an equivalent of %posttrans-runonce in RPM that I know of.

-Matt

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux



More information about the DKMS-devel mailing list