[Toybox] lspci

scsijon scsijon at lamiaworks.com.au
Tue Jul 23 18:09:50 PDT 2013



On 07/23/2013 01:57 PM, Isaac wrote:
> On Tue, Jul 23, 2013 at 11:40:46AM +1000, scsijon wrote:
>> Can I take it that even though you've not mentioned them to date
>> that you are including the three double character switches. They are
>> absolutely magic when debugging a build with a device problem.
>>
>> -vv 		for very verbose
>> -nn		Show both textual and numeric ID's (names & numbers)
>> -qq		Query the PCI ID database for unknown ID's via DNS, but
>> 		re-query with the locally cached entries
>>
>> Pretty please with fresh honey on the crumpets.
>
> Not included, all of them presume functionality I haven't included,
> and I haven't a clue how to implement much of it.
>
> I don't know if toybox has support for double-character switches
> (--longopts and -s are supported).
>
> What I wrote is just a little better than busybox:
> busybox has -m and -k, and outputs only numeric ID's (like lspci-FULL -n).
> I added a do-nothing -n since that's what I output already,
> and -e for the full class width.
> -v and -q are not supported.
>
> -v displays all the textual information in sysfs, including an expanded
> version of any magic numbers. But what's a little trickier than that is
> displaying "Kernel modules:".  It means looking up the modalias (find
> all modules containing "alias=%s",modalias); this could be done via a
> search of the tree, a search of modules.alias, or of bb.modules.alias.
> Which to do depends on your modprobe/depmod. And to look through the tree
> may mean supporting any type of compression.
> But really, find_modalias() would be useful for modinfo, modprobe, and I
> guess lspci.
>
> Textual ID's require parsing the database (/usr/share/misc/pci.ids{,gz}),
> which I have hardly looked at.
> But it looks like it's search for ^vendor, then while line[0] == '\t'
> look for ^\tdevice.
> If support is conditional, looking this up seems reasonable...
>
> As far as query via DNS goes, I have not done any netwrk programming,
> and if I had I would still want to say "that doesn't belong in lspci -
> update your local database!" ;)
>
> Sorry I couldn't be of more help.
> Isaac Dunham
>
>> thanks and regards
>> jon
>
Fair enough,

FYI, the -qq is best used for us poor satellite users where the ISP's 
tend to keep a copy in their systems cache and you get that instead of 
the one from the real source 'updating' your system. It ocasionally gets 
left behind an update or worse when the ISP's server crashes and you get 
a very old one appearing for a day or so until someone that knows about 
these things yells about it or it finally automatically updates. 
'!Absolutely Great' when your in the middle of debugging a system as I 
was last year and I had one that had no usb3 device codes appear.

It just means I keep including and using the full lspci package. 
Considering the number of packages i've been able to trim by adding 
toybox, I have absolutely no problem with that.

thanks for all your work and regards
jon

 1374628190.0


More information about the Toybox mailing list