Tiny Core Extensions > TCE Bugs

lshw does not show product or vendor information

<< < (2/4) > >>

GNUser:
I figured out the problem: The lshw binary in the extension looks for data files in /usr/share/lshw. However, the extension puts those data files in /usr/local/share/lshw:


--- Code: ---$ sudo strace -e trace=file /usr/local/sbin/lshw -c network 2>&1 | grep -F share/lshw
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pci.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pnp.ids.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pnp.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pnpid.txt.gz", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lshw/pnpid.txt", O_RDONLY) = -1 ENOENT (No such file or directory)

--- End code ---

If I create a link, then  lshw  works as expected:

--- Code: ---$ sudo ln -s /usr/local/share/lshw /usr/share/lshw
$ sudo /usr/local/sbin/lshw -c network
...
  *-network
       description: Wireless interface
       product: AR93xx Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
...
--- End code ---

Maybe the root issue goes back to when lshw was compiled (missing "--prefix=/usr/local"). The fix would be to recompile  lshw  or to include link from /usr/share/lshw to /usr/local/share/lshw in the extension.

Rich, to prevent duplicating effort: Do you want to fix this issue or should I?

Juanito:

--- Quote from: GNUser on July 01, 2020, 08:48:57 AM ---Maybe the root issue goes back to when lshw was compiled (missing "--prefix=/usr/local"). The fix would be to recompile  lshw  or to include link from /usr/share/lshw to /usr/local/share/lshw in the extension.

--- End quote ---

It would be better to find the hard coded address in the code and fix it. Is there an option to use the data in pci-utils?

GNUser:
A simple fix would be to move the four database files up from the /usr/local/share/lshw directory to the /usr/local/share directory.
/usr/local/share (but not /usr/local/share/lshw) is already one of the places where lshw looks for the data files :)


--- Code: ---$ strings /usr/local/sbin/lshw | grep share
...
/usr/local/share/pci.ids:/usr/share/lshw/pci.ids:/usr/local/share/pci.ids:/usr/share/pci.ids:/etc/pci.ids:/usr/share/hwdata/pci.ids:/usr/share/misc/pci.ids
/usr/local/share/pnp.ids:/usr/share/lshw/pnp.ids:/usr/share/hwdata/pnp.ids
/usr/local/share/pnpid.txt:/usr/share/lshw/pnpid.txt:/usr/share/hwdata/pnpid.txt
/usr/local/share/usb.ids:/usr/share/lshw/usb.ids:/usr/local/share/usb.ids:/usr/share/usb.ids:/etc/usb.ids:/usr/share/hwdata/usb.ids:/usr/share/misc/usb.ids

--- End code ---

It would therefore be trivial to fix the existing extensions.
@Rich - I see you were the last one to submit the lshw extension. Would you like to do this, or should I?

GNUser:
Since I'm the one that seems to be the most bothered by this, I went ahead and fixed it for TCL10 (32 and 64 bit) and TCL11 (32 and 64 bit).

I did not recompile, just moved the .gz data archives from /usr/local/share/lshw/ to /usr/local/share/

The four adjusted extensions have been submitted :)

Rich:
Hi Juanito

--- Quote from: Juanito on July 01, 2020, 10:42:50 AM --- ... It would be better to find the hard coded address in the code and fix it. ...
--- End quote ---
I modified the build script to search the  .cc  files and fix them. Updated to newer version:

--- Code: ---* lshw B.02.19
  detection of NVMe disks
  detection of SD/MMC and SDIO devices
  bug fixes
  code cleanup
  updated data files
--- End code ---

Newly compiled extensions submitted.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version