jaypipes / pcidb

Small golang library for querying PCI database (pciids) information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support PCIDB_CHROOT

chiptus opened this issue · comments

related to jaypipes/ghw#56 and to portainer/agent#34

It seems like the paths in https://github.com/jaypipes/pcidb/blob/master/discover.go#L92-L95 are hardcoded without respecting the GHW_CHROOT and because of that, ghw tries to load pci info from internet.
You can add support for the GHW_CHROOT env variable or take hostRoot as an option when calling pcidb.New()

I'll make a PR, let me know what you think

Hi! :)

So, since we've now separated pcidb from ghw (it's a wholly-independent lib now), let's go ahead and add support in pcidb for a new PCIDB_CHROOT env variable. As much as possible, I don't want to rely on any env var from ghw in this library.

I'll add more comments to your PR...

@chiptus once your PR #11 merges with the new PCIDB_CHROOT env var, yes, let's make a change to ghw to automatically set PCIDB_CHROOT to GHW_CHROOT. ++