[Toybox] [TOY] lspci

Felix Janda felix.janda at posteo.de
Wed Jul 24 11:47:23 PDT 2013


Isaac wrote:
[...]
> On Mon, Jul 22, 2013 at 09:05:26PM +0200, Felix Janda wrote:
> > Are there any more options you have in mind that should be implemented?
> 
> -s DEVICE is highly desireable, but I didn't get it working right.
> (-s shows only the device that has a matching end to its name:
> -s 03:00.0 shows 0000:03:00.0)

Ok. pciutils lspci -s also accepts something like -s 03:*.0 to match
e.g. something like 0000:03:01.0. Also if only one number is given it
matches the device (-s 3 and -s 3. are equivalent).

Is piping the output to grep not sufficient for many purposes or is
this option used by a lot of scripts?

> > Just out of curiosity: Could you post a link to the forum post?
> > 
> http://www.murga-linux.com/puppy/viewtopic.php?t=63971&start=30
> "It seems that bb-lspci is not able to replace elspci because it shows 
> [ like lspci-FULL ] only the 4 middle chars of /sys/bus/pci/devices/*/class,
>  while elspci shows the last 6 chars."

Thanks.

> In which case it should be readat_name.  The "p" is because pread()
> accepts an offset.
> (I named it for the similarities/diferences from the standard functions:
> it's similar to pread(), but it takes a parent directory like openat() and
> uses a filename.)

Of course feel free to fix that and post a new version.

> The down side is the longer printf...but that's not worth mentioning, 
> I think.

One could reintroduce the last argument and instead of seeking just add the
offset to the return value. But then the 2 just appears at another place.

Thanks,
Felix

 1374691643.0


More information about the Toybox mailing list