[Yum-devel] RE: [Yum] [RFC] Automatic driver package resolution

Michael_E_Brown at Dell.com Michael_E_Brown at Dell.com
Thu Feb 22 17:46:07 UTC 2007


 All,
	Attached are three files. The first,
"find_packages_for_my_hardware", is a python program that uses Yum and
/sys/devices/ to find all of the 'provides:' that are in the repository
that match hardware present on the system.

	The second file, find-provides.modalias, is a find-provides
extention that I would like to get into the distributions. For all
packages that include *.ko files in /lib/modules/, it will add
"Provides:" tags for the modalias lines for those modules. These lines
are what the "find_packages_for_my_hardware" program uses. It is
intended that this will work for KMP modules. 

	The third file, testrpm.spec, is a small file-less RPM that you
can use to test this whole mechanism. Basically, you can find a module
you already have in your system, run "modinfo" on that module and cut
and paste the info into the specfile. Then make the RPM and put it in a
repo to test the 'find_packages_for_my_hardware" program.

	I will be shortly mailing out patches for DKMS to implement the
'find-provides' functionality for DKMS, as well as a sample KMP spec
file that you can use until the distros pick up find-provides.modalias.

	Anybody have any comments?
--
Michael

> -----Original Message-----
> From: yum-bounces at lists.dulug.duke.edu 
> [mailto:yum-bounces at lists.dulug.duke.edu] On Behalf Of 
> Michael_E_Brown at Dell.com
> Sent: Tuesday, February 20, 2007 4:05 PM
> To: yum at lists.dulug.duke.edu; driver-updates at redhat.com; 
> dkms-devel-Lists
> Cc: agruen at suse.de
> Subject: [Yum] [RFC] Automatic driver package resolution
> 
> I have cross-posted this message to the three lists where I 
> think this is extremely relevant. 
> 
> 
> Problem statement:
> 	Given a new machine, it is not possible to 
> automatically determine which kernel driver RPMs are needed 
> to drive hardware on that machine.
> 
> 	For example, my new laptop has the Intel IPW 3945 wireless card.
> If I, as a novice user, do not specifically know that I need 
> to configure livna/freshrpms/etc and manually "yum install 
> ipw3945 (and friends)", I cannot get my wireless working.
> 
> 	This proposal outlines a method to create a yum utility 
> that can do automatic hardware detection and automatically 
> install the correct set of kernel modules for your current 
> system. The purpose of this proposal is to arrive at a 
> consensus that something like this is acceptable to the 
> yum/dkms/driver-updates people so it can become part of 
> future distributions out of the box (and not some addon thing 
> that is forever-maintained out-of-tree.)
> 
> 
> Solution Summary:
> 	
> 	The solution consists of two parts: 1) a 
> specially-formatted "Provides:" tag on all hardware driver 
> RPMS, and 2) a small utility that can match this new tag with 
> the local hardware to pull down the correct RPM via yum.
> 
> 
> "Provides:" Tag:
> 	All kernel driver RPMs contain kernel driver module
> (/lib/modules/.../*.ko) files. This is pretty much a given. 
> With these driver modules, you can run the "modinfo" program 
> to extract data from them. For all PCI and USB drivers, the 
> module contains "alias" lines which have the PCI ID or USB ID 
> of the devices which this module supports. This proposal 
> would extract these alias lines and, after formatting them, 
> add them to the RPM as "Provides:" tags. This is done 
> automatically by a "find-provides" extension script (attached 
> - find-provides.modalias).
>       Proposal (long-term): Add the attached 
> find-provides.modinfo to the distribution RPM macro set.
> 	Proposal (short-term):  Add the attached 
> find-provides.modinfo script to the SOURCES of RPM DKMS or 
> KMP packages and override the builtin RPM %{__find_provides} script
> 
> 
> Yum utility:
> 	This part has not been completed, but I am working on a 
> prototype. It will be called "find-hardware-driver-packages". 
> The basic conceptual outline is that it would do a "yum list 
> all modalias*". Then it would find matches in that list 
> against the /sys/devices/{pci|usb}*/$device/modalias file 
> using the built-in globbing present in the modalias tag. It 
> would find a candidate list of packages that with matching 
> modaliases. It could then narrow this list down by matching 
> ksym() provides tags against the currently running and 
> currently installed kernels to install the correct list of 
> driver RPMs. 
> 	
> 
> 	I am looking for feedback. I believe that this method 
> is conceptually very simple, and yet it should be robust 
> enough to handle the situations I can envision. I would like 
> to produce something that will work for Fedora, Red Hat 
> Enterprise, and SUSE, at the least. I believe that this 
> concept can also be extended to work with the Debian-based 
> distributions.
> 
> --
> Michael Brown
> Linux OS Engineering
> Dell Inc
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find_packages_for_my_hardware
Type: application/octet-stream
Size: 5036 bytes
Desc: find_packages_for_my_hardware
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070222/3eb6c059/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find-provides.modalias
Type: application/octet-stream
Size: 2070 bytes
Desc: find-provides.modalias
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070222/3eb6c059/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testrpm.spec
Type: application/octet-stream
Size: 2423 bytes
Desc: testrpm.spec
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070222/3eb6c059/attachment-0002.obj 


More information about the Yum-devel mailing list