diff options
author | bapt <bapt@FreeBSD.org> | 2015-09-13 07:15:45 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-09-13 07:15:45 +0000 |
commit | 44b5ad695538d1ce6a4e50da128435775460329a (patch) | |
tree | ae07535d260f4f1c03844adfe4ed12523c82fb4d | |
parent | 312f8936e8f9983804df0fefddc4a55202c721ab (diff) | |
download | FreeBSD-src-44b5ad695538d1ce6a4e50da128435775460329a.zip FreeBSD-src-44b5ad695538d1ce6a4e50da128435775460329a.tar.gz |
MFC: r287522
Prefer pciids database from ports if present
Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3391
-rw-r--r-- | usr.sbin/pciconf/pathnames.h | 1 | ||||
-rw-r--r-- | usr.sbin/pciconf/pciconf.8 | 6 | ||||
-rw-r--r-- | usr.sbin/pciconf/pciconf.c | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pciconf/pathnames.h b/usr.sbin/pciconf/pathnames.h index 719615a..61c0993 100644 --- a/usr.sbin/pciconf/pathnames.h +++ b/usr.sbin/pciconf/pathnames.h @@ -1,3 +1,4 @@ /* $FreeBSD$ */ #define _PATH_DEVPCI "/dev/pci" #define _PATH_PCIVDB "/usr/share/misc/pci_vendors" +#define _PATH_LPCIVDB "/usr/local/share/pciids/pci.ids" diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8 index e0caf1f..8dbb2a6 100644 --- a/usr.sbin/pciconf/pciconf.8 +++ b/usr.sbin/pciconf/pciconf.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2014 +.Dd September 06, 2015 .Dt PCICONF 8 .Os .Sh NAME @@ -281,7 +281,9 @@ indicates a halfword (two-byte) operation. The default is to read or write a longword (four bytes). .Sh ENVIRONMENT -The PCI vendor/device information database is normally read from +PCI vendor and device information is read from +.Pa /usr/local/share/pciids/pci.ids . +If that file is not present, it is read from .Pa /usr/share/misc/pci_vendors . This path can be overridden by setting the environment variable .Ev PCICONF_VENDOR_DATABASE . diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 22bb61d..ad709db 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -542,9 +542,12 @@ load_vendors(void) */ TAILQ_INIT(&pci_vendors); if ((dbf = getenv("PCICONF_VENDOR_DATABASE")) == NULL) + dbf = _PATH_LPCIVDB; + if ((db = fopen(dbf, "r")) == NULL) { dbf = _PATH_PCIVDB; - if ((db = fopen(dbf, "r")) == NULL) - return(1); + if ((db = fopen(dbf, "r")) == NULL) + return(1); + } cv = NULL; cd = NULL; error = 0; |