Jonathan Thomas [2012-05-30 9:41 -0400]:
> Glad to see that resolved, and no hard feelings at any rate.
> So if I understand correctly, detect.py currently loads a backend
> plugin from /usr/share/ubuntu-drivers-common/detect/ (currently the
> PackageKit plugin) and uses the what_provides_modalias() and
> system_driver_packages() methods in PackageKit.py for discovering
> which packages need to be installed?
UbuntuDrivers.detect is fully self-contained and only needs apt. What
it does is (1) finding all modaliases in the system by parsing /sys,
(2) mapping modaliases to packages with the help of packages'
"Modalises:" headers, and a few other stuff around that.
We try hard to make most packages just declare proper "Modaliases:"
headers. However, for some special cases that's not possible.
/usr/share/ubuntu-drivers-common/detect/ has python snippets that
these special cases can provide; for example, sl-modem-daemon needs to
decide whether or not it should be installed based on checks of
/proc/asound/cards and "aplay -l". But this should remain an internal
implementation detail of system_driver_packages().
The PackageKit plugin (UbuntuDrivers.PackageKit) is just an adapter to
use the what_provides_modalias() function (which is Ubuntu specific)
in PackageKit/aptdaemon, so that WhatProvides(MODALIAS, pci:12345)
works on Ubuntu; i. e. PackageKit/aptdaemon will call
what_provides_modalias() through that plugin.
> And then if I were to write a backend for QApt I could write a
> analogous QApt.py that implements those two functions and install
> that to /usr/share/ubuntu-drivers-common/detect/?
I don't think you need to write anything in that regard. If you
implement a GUI for KDE which displays available drivers and offers to
install them, you should either use the PackageKit WhatProvides() API
(which allows you to submit that code upstream, as it works for all
distros), or directly use the methods in UbuntuDrivers.detect (they do
not need any special privileges) to get the list of packages, and then
use QApt to get these packages installed.
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
kubuntu-devel mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel