jaypipes / pcidb

Small golang library for querying PCI database (pciids) information
Apache License 2.0
33 stars 15 forks source link

Support for Windows #1

Closed jaypipes closed 5 years ago

jaypipes commented 6 years ago

Since ghw is a Linux-centric library (for now at least) and the pcidb library originated from ghw, there is no support for pcidb on Windows.

This should be a relatively easy problem to solve. Just need to figure out where Windows stores its local copies of the pciids database files and if not, download them from the Internet at known locations.

jaypipes commented 6 years ago

Doesn't seem like Windows has a local pciids database file cache. So, we'll need to download a copy of https://pci-ids.ucw.cz/v2.2/pci.ids.gz to a cache folder in Windows, gunzip it and use that.

charles-dawes commented 6 years ago

I threw together a quick script that scrapes that list and saves it to the filesystem on Win10. I tested it using some of the code from the current library and it seems to work with the scraped file. I'm no good at this whole GitHub thing so I'm not sure how to get that to you.

jaypipes commented 6 years ago

No worries @charles-dawes, I'll probably have something up for you to test out later tonight or this weekend. I'll give you instructions for how to pull the code and test it.

charles-dawes commented 6 years ago

https://github.com/charles-dawes/pcidb/blob/master/pci_list_windows.go If this is at all useful to you, feel free to use it.

jaypipes commented 6 years ago

OK, @charles-dawes, I believe I've got this working for Windows (and any non-Linux platform) with this pull request:

https://github.com/jaypipes/pcidb/pull/2

Can you pull the code to your Windows host and see if all is OK now?

jaypipes commented 5 years ago

This was done with PR #2.

jaypipes commented 5 years ago

Currently playing around with Travis building on a Windows build env... re-opening and will close when that is all gating master.

jaypipes commented 5 years ago

OK, with PR #7 we're now gating on Windows and Linux. :)