RFE: smart upgrade automatically installing kernel modules for new kernels?

Gustavo Niemeyer gustavo at niemeyer.net
Sun May 20 12:47:36 PDT 2007


Hey again Axel,

> The pseudo-code is simple:
> 
> package foo-kmdl-somekernelA and kernelB are installed (*): If
> foo-kmdl-somekernelB exists pull it in.
> 
> (*) Replace "installed" with "installed or to be installed in this
>     smart transaction" for the more correct relationship.
> 
> It is a bit more involved because the "uname -r" in kernel packages is
> sometimes split, e.g. it isn't kernel-2.6.22smp, but
> kernel-smp-2.6.22. This mapping must either be known to the plugin or
> instead of using the kernel rpm name one could use the
> /lib/modules/uname-r directories.

I've just implemented two new hooks in Smart, and committed to the
development trunk. They are "cache-loaded" and "cache-loaded-pre-link".
The one you want is the second. It will be run after all packages have
been loaded into the cache, but before relationships have been linked
to build the in-memory graph.

The test in tests/load-hooks.txt artificially inserts an upgrade relation
between two packages, in a way similar to what you want to do, and should
give you a hint about how to do it. For RPM packages, you can get the real
upgrades relation from

    smart.backends.rpm.base.RPMUpgrades

You can also use the cache that is passed as the first argument to the
hook to investigate which packages are available, to conditionally
insert the relationship the way you want.

Please let me know if you managed to build the plugin you wanted with
this, or if you need any help.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the Smart mailing list