From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander E. Patrakov" Date: Sat, 09 Oct 2004 08:51:35 +0000 Subject: Re: [patch] pnp rc Message-Id: <4167A697.6000300@ums.usu.ru> List-Id: References: <416695D2.2050405@free.fr> In-Reply-To: <416695D2.2050405@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Alexander E. Patrakov wrote: > 1) I have to coordinate my actions with Marco d'Itri (from Debian). I > remember his words about the idea with aliases being modern, progressive > and right. The question is whether it is possible and good to apply this > idea to pci.rc also. I think it is, but I want to know his opinion. (in fact what I try to do here is to test this approach on a well-supported PCI bus and, in the case of success, drop pnp.rc in favour of isapnp.rc maintained at Debian). Found a problem with this approach. If this idea with aliases is applied to the PCI case, let's see what happens to a user with an Intel EtherExpress 100 network card and some sort of a blg bloated modular "distribution" kernel. There are two official drivers for this sort of card, e100 and eepro100. In order to choose one, the user currently has to blacklist the other by adding a line to /etc/hotplug/blacklist. Then the first non-blacklisted driver gets loaded. With the approach based on the aliases (and blacklisting based on modprobe output, as currently done in Debian in isapnp.rc), it is difficult to implement. First, Debian-like solution: # Generate $ALIAS from the PCI ID MODULE=$(modprobe --show-depends -q $ALIAS | sed -e '$!d;s/.*\/\(.*\)\.ko .*/\1/') [ "$MODULE" ] || continue # and now check the module against the blacklist This fails because modprobe will resolve only one of the candidate modules. E.g., suppose that it would (unwantedly) pick e100. I blacklist e100. $MODULE will still be e100, and as a result nothing will be loaded. So we have either to ask Rusty Russel to add an option to modprobe to print all possible resolutions of an alias (BTW which list should this go to?), or implement that by grepping the output of "modprobe -c", like this: # obtain $VENDOR and $DEVICE MODULES=$(modprobe -c | grep "alias pci:v0000${VENDOR}d0000${DEVICE}" | grep -o '[^ ]*$') # check against the blacklist (yes, I know that I have to check subvendor and subdevice too). Does this grepping sound like a good idea? -- Alexander E. Patrakov ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel