Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ghw_chroot #11

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

chiptus
Copy link
Contributor

@chiptus chiptus commented Nov 8, 2018

closes #10

This PR gets the value of GHW_CHROOT as the host root to look for pci info.

It also fixes a bug where search paths weren't added to slice (pass reference instead of value)

Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, @chiptus thanks so much for your PR! Please go ahead and make the change to the env var I've requested inline.

Also, if you wouldn't mind editing the README.md file to mention how to use the PCIDB_CHROOT env var, that would be great. Feel free to use similar text as what is in the ghw README. Something like this would be good:

NOTE: The default root mountpoint that pcidb uses when looking for information about the host system is /. So, for example, when looking up CPU information on Linux, pcidb will attempt to discover a pciids DB file at /usr/share/misc/pci.ids. If you are calling pcidb from a system that has an alternate root mountpoint, you can set the PCIDB_CHROOT environment variable to that alternate path. for example, if you are executing from within an application container that has bind-mounted the root host filesystem to the mount point /host, you would set PCIDB_CHROOT to /host so that pcidb can find files like /usr/share/misc/pci.ids at /host/usr/share/misc/pci.ids.

discover.go Outdated Show resolved Hide resolved
@jaypipes jaypipes mentioned this pull request Nov 8, 2018
@jaypipes
Copy link
Owner

jaypipes commented Nov 8, 2018

I'll go ahead and add the README bits. Thanks, @chiptus! 👍

@jaypipes jaypipes merged commit 9e7cb0c into jaypipes:master Nov 8, 2018
@chiptus
Copy link
Contributor Author

chiptus commented Nov 8, 2018 via email

@jaypipes
Copy link
Owner

jaypipes commented Nov 8, 2018

LOL, not problem at all, @chiptus! I've added a note to the README now: cfc6258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support PCIDB_CHROOT
2 participants