Sync from SUSE:SLFO:Main pciutils revision 4aecf888c58139d7d0bee024b4444d5e

This commit is contained in:
Adrian Schröter 2024-05-03 17:44:17 +02:00
commit a2583108f1
10 changed files with 1548 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

7
baselibs.conf Normal file
View File

@ -0,0 +1,7 @@
libpci3
obsoletes "pciutils-<targettype> < <version>"
provides "pciutils-<targettype> = <version>"
pciutils-devel
requires -pciutils-<targettype>
requires "libpci3-<targettype> = <version>"

View File

@ -0,0 +1,10 @@
--- pciutils-3.8.0/lib/libpci.pc.in.orig 2022-04-21 09:11:03.305072096 +0200
+++ pciutils-3.8.0/lib/libpci.pc.in 2022-04-21 09:13:06.166040080 +0200
@@ -6,6 +6,5 @@
Name: libpci
Description: libpci
Version: @VERSION@
-Libs: -L${libdir} -lpci
+Libs: -lpci @LDLIBS@
Libs.private: @LDLIBS@ @WITH_LIBS@
-Cflags: -I${includedir}

7
pciutils-3.10.0.tar.sign Normal file
View File

@ -0,0 +1,7 @@
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQz3UIWM8X/rMLSHFIVf/JNR+6nIAUCZE+4LAAKCRAVf/JNR+6n
IP3iAQC5EVpB/DKLbVgwQzlObDoCzlmofoD/4BM/y7mQF2kxbQD/ccDvY3J7c/BB
hergbAe6CWKV+75S12aPHjlOv9jaEQc=
=yRjb
-----END PGP SIGNATURE-----

BIN
pciutils-3.10.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

104
pciutils-endianh.patch Normal file
View File

@ -0,0 +1,104 @@
--- pciutils-3.8.0/lib/sysdep.h.orig 2022-04-21 09:44:42.293087550 +0200
+++ pciutils-3.8.0/lib/sysdep.h 2022-04-21 09:48:40.958962299 +0200
@@ -20,97 +20,10 @@
typedef u8 byte;
typedef u16 word;
-#ifdef PCI_OS_WINDOWS
-#define strcasecmp _strcmpi
-#define strncasecmp _strnicmp
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#endif
-#endif
-
-#ifdef PCI_HAVE_LINUX_BYTEORDER_H
-
-#include <asm/byteorder.h>
-#define cpu_to_le16 __cpu_to_le16
-#define cpu_to_le32 __cpu_to_le32
-#define le16_to_cpu __le16_to_cpu
-#define le32_to_cpu __le32_to_cpu
-
-#else
-
-#ifdef PCI_OS_LINUX
-#include <endian.h>
-#define BYTE_ORDER __BYTE_ORDER
-#define BIG_ENDIAN __BIG_ENDIAN
-#endif
-
-#ifdef PCI_OS_SUNOS
-#include <sys/byteorder.h>
-#if defined(__i386) && defined(LITTLE_ENDIAN)
-# define BYTE_ORDER LITTLE_ENDIAN
-#elif defined(__sparc) && defined(BIG_ENDIAN)
-# define BYTE_ORDER BIG_ENDIAN
-#else
-#define BIG_ENDIAN 4321
-#endif
-#ifndef BYTE_ORDER
-#ifdef _LITTLE_ENDIAN
-#define BYTE_ORDER 1234
-#else
-#define BYTE_ORDER 4321
-#endif
-#endif /* BYTE_ORDER */
-#endif /* PCI_OS_SUNOS */
-
-#ifdef PCI_OS_WINDOWS
-#ifdef __MINGW32__
- #include <sys/param.h>
-#else
- #include <io.h>
- #define BIG_ENDIAN 4321
- #define LITTLE_ENDIAN 1234
- #define BYTE_ORDER LITTLE_ENDIAN
-#endif
-#endif
-
-#ifdef PCI_OS_SYLIXOS
#include <endian.h>
-#endif
-
-#ifdef PCI_OS_DJGPP
- #define BIG_ENDIAN 4321
- #define LITTLE_ENDIAN 1234
- #define BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-#if !defined(BYTE_ORDER)
-#error "BYTE_ORDER not defined for your platform"
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define cpu_to_le16 swab16
-#define cpu_to_le32 swab32
-#define le16_to_cpu swab16
-#define le32_to_cpu swab32
-
-static inline word swab16(word w)
-{
- return (w << 8) | ((w >> 8) & 0xff);
-}
-static inline u32 swab32(u32 w)
-{
- return ((w & 0xff000000) >> 24) |
- ((w & 0x00ff0000) >> 8) |
- ((w & 0x0000ff00) << 8) |
- ((w & 0x000000ff) << 24);
-}
-#else
-#define cpu_to_le16(x) (x)
-#define cpu_to_le32(x) (x)
-#define le16_to_cpu(x) (x)
-#define le32_to_cpu(x) (x)
-#endif
+#define cpu_to_le16 htole16
+#define cpu_to_le32 htole32
+#define le16_to_cpu le16toh
+#define le32_to_cpu le32toh
-#endif

128
pciutils-ocloexec.patch Normal file
View File

@ -0,0 +1,128 @@
Index: pciutils-3.8.0/lib/dump.c
===================================================================
--- pciutils-3.8.0.orig/lib/dump.c
+++ pciutils-3.8.0/lib/dump.c
@@ -64,7 +64,7 @@ dump_init(struct pci_access *a)
if (!name)
a->error("dump: File name not given.");
- if (!(f = fopen(name, "r")))
+ if (!(f = fopen(name, "re")))
a->error("dump: Cannot open %s: %s", name, strerror(errno));
while (fgets(buf, sizeof(buf)-1, f))
{
Index: pciutils-3.8.0/lib/names-cache.c
===================================================================
--- pciutils-3.8.0.orig/lib/names-cache.c
+++ pciutils-3.8.0/lib/names-cache.c
@@ -63,7 +63,7 @@ pci_id_cache_load(struct pci_access *a,
return 0;
}
- f = fopen(name, "rb");
+ f = fopen(name, "rbe");
if (!f)
{
a->debug("Cache file does not exist\n");
@@ -136,7 +136,7 @@ pci_id_cache_flush(struct pci_access *a)
tmpname = pci_malloc(a, strlen(name) + strlen(hostname) + 64);
sprintf(tmpname, "%s.tmp-%s-%d", name, hostname, this_pid);
- f = fopen(tmpname, "wb");
+ f = fopen(tmpname, "wbe");
if (!f)
{
a->warning("Cannot write to %s: %s", name, strerror(errno));
Index: pciutils-3.8.0/lib/names-parse.c
===================================================================
--- pciutils-3.8.0.orig/lib/names-parse.c
+++ pciutils-3.8.0/lib/names-parse.c
@@ -52,7 +52,7 @@ static pci_file pci_open(struct pci_acce
typedef FILE * pci_file;
#define pci_gets(f, l, s) fgets(l, s, f)
#define pci_eof(f) feof(f)
-#define pci_open(a) fopen(a->id_file_name, "r")
+#define pci_open(a) fopen(a->id_file_name, "re")
#define pci_close(f) fclose(f)
#define PCI_ERROR(f, err) if (!err && ferror(f)) err = "I/O error";
#endif
Index: pciutils-3.8.0/lib/proc.c
===================================================================
--- pciutils-3.8.0.orig/lib/proc.c
+++ pciutils-3.8.0/lib/proc.c
@@ -63,7 +63,7 @@ proc_scan(struct pci_access *a)
if (snprintf(buf, sizeof(buf), "%s/devices", pci_get_param(a, "proc.path")) == sizeof(buf))
a->error("File name too long");
- f = fopen(buf, "r");
+ f = fopen(buf, "re");
if (!f)
a->error("Cannot open %s", buf);
while (fgets(buf, sizeof(buf)-1, f))
@@ -147,7 +147,7 @@ proc_setup(struct pci_dev *d, int rw)
if (e < 0 || e >= (int) sizeof(buf))
a->error("File name too long");
a->fd_rw = a->writeable || rw;
- a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY);
+ a->fd = open(buf, (a->fd_rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
if (a->fd < 0)
{
e = snprintf(buf, sizeof(buf), "%s/%04x:%02x/%02x.%d",
@@ -155,7 +155,7 @@ proc_setup(struct pci_dev *d, int rw)
d->domain, d->bus, d->dev, d->func);
if (e < 0 || e >= (int) sizeof(buf))
a->error("File name too long");
- a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY);
+ a->fd = open(buf, (a->fd_rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
}
if (a->fd < 0)
a->warning("Cannot open %s", buf);
Index: pciutils-3.8.0/lib/sysfs.c
===================================================================
--- pciutils-3.8.0.orig/lib/sysfs.c
+++ pciutils-3.8.0/lib/sysfs.c
@@ -96,7 +96,7 @@ sysfs_get_string(struct pci_dev *d, char
void (*warn)(char *msg, ...) = (mandatory ? a->error : a->warning);
sysfs_obj_name(d, object, namebuf);
- fd = open(namebuf, O_RDONLY);
+ fd = open(namebuf, O_RDONLY|O_CLOEXEC);
if (fd < 0)
{
if (mandatory || errno != ENOENT)
@@ -160,7 +160,7 @@ sysfs_get_resources(struct pci_dev *d)
have_bar_bases = have_rom_base = have_bridge_bases = 0;
sysfs_obj_name(d, "resource", namebuf);
- file = fopen(namebuf, "r");
+ file = fopen(namebuf, "re");
if (!file)
a->error("Cannot open %s: %s", namebuf, strerror(errno));
for (i = 0; i < 7+6+4+1; i++)
@@ -300,7 +300,7 @@ sysfs_fill_slots(struct pci_access *a)
n = snprintf(namebuf, OBJNAMELEN, "%s/%s/%s", dirname, entry->d_name, "address");
if (n < 0 || n >= OBJNAMELEN)
a->error("File name too long");
- file = fopen(namebuf, "r");
+ file = fopen(namebuf, "re");
/*
* Old versions of Linux had a fakephp which didn't have an 'address'
* file. There's no useful information to be gleaned from these
@@ -503,7 +503,7 @@ sysfs_setup(struct pci_dev *d, int inten
if (a->fd_vpd < 0)
{
sysfs_obj_name(d, "vpd", namebuf);
- a->fd_vpd = open(namebuf, O_RDONLY);
+ a->fd_vpd = open(namebuf, O_RDONLY|O_CLOEXEC);
/* No warning on error; vpd may be absent or accessible only to root */
}
return a->fd_vpd;
@@ -513,7 +513,7 @@ sysfs_setup(struct pci_dev *d, int inten
{
sysfs_obj_name(d, "config", namebuf);
a->fd_rw = a->writeable || intent == SETUP_WRITE_CONFIG;
- a->fd = open(namebuf, a->fd_rw ? O_RDWR : O_RDONLY);
+ a->fd = open(namebuf, (a->fd_rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
if (a->fd < 0)
a->warning("Cannot open %s", namebuf);
a->fd_pos = 0;

1068
pciutils.changes Normal file

File diff suppressed because it is too large Load Diff

74
pciutils.keyring Normal file
View File

@ -0,0 +1,74 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: C466 A56C ADA9 81F4 297D 20C3 1F3D 0761 D9B6 5F0B
Comment: Martin Mares <mares@kam.mff.cuni.cz>
Comment: Martin Mares <mj@ucw.cz>
xsFNBGEsBf4BEADIWvGdkJ6ng9pJrAuKCKbyQ15PQLyKE+0vG2Uok1/JYQVMWOPk
y276Kg389+Mi38nxumJ0L22Ef0rcGbsCLMOTY0BAGuPpFA7c9703sV8+wP8XdZdf
YCd9Hw/TrrDKwLmNQQYEeiralyG0IV0sCsBJQqPMFGljOhUJHM6MzvN7/gd2nbh+
i0YlNTTDmBoSxFhi8+YaS2+M1ILZUCmR3zAokqEeOlBzpKr+tXwX8FlygD0S4TWR
BJvgxZGjlVArCbzIyQDM++WA3BHcM4r7l/f6h6jZYGejXyIqkAtKTUHa1jEKcidT
9u/G3CQAnuJBLgpZXlbQ8MaeAwRHruDUiy/3OMcOiK8qz32nM0HY9DdSytGcS9L6
0YKu7VfyieVSaDGSU1vRjQEzo9CfsLYAPWLMSuzwQaziePTGS8zggrvz75LV8Kwa
CtUxoEmPG48gJlwpR2P5+4b3ZZUFdL1yq1i2oQqlFkwGxwrCkUXs+UCZBKYvC3+l
m1dtSNBE7sucaQ0UgPsvEdxkoWeGAMa3y+N+KLdxDcEBZGoYUL5OmNH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gHMYCgqBstU1rLCbNveb6Bp6LtDfrAazhrAAi393eeJeTO3ALazMgeejPf
+pJTd6CDXOkPZ+lt/2JjrlKFswm4nYww6aI/K1HzHmttAvzH8fUGM/QnRpsRvm7h
IFQ+vc3gle2eYVmI/OAEUiiowBR7VYOIK5Doz9o1E882HRqausjk8W+rf5a7ItlT
DMEr5m3fK3eLC6YHYjaYnoA3u2pud8B0isk4qR8ZZXkvVPH6ygPE82kfA4t+qlcv
n6PfHDPSdOvoOWy+4EOtOtxwh57ZtfgkmeVYraHJ9Qy9EjxxntDnw4O43rQyJq1Q
2EtlJrWrObLgbTkGxWzpSbUn8O5nj/apZsJ6JVH0ofYXN1WNAVNdgcDtsO43u87/
B8KeRizsVsdRUTGcIlIDk6B+CY9TFHipcm0PzqFZneHD9f+OrQpUG4RcjoTc6IxK
lcoIA83N6PMQEG8FnAAd7NxBP0iNnZBO+ghHg1YG3R6co9bj6M+eFJTc8//+3qo2
/BoqS5I=
=ZjUa
-----END PGP PUBLIC KEY BLOCK-----

124
pciutils.spec Normal file
View File

@ -0,0 +1,124 @@
#
# spec file for package pciutils
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define sover 3
%define lname libpci%{sover}
Name: pciutils
Version: 3.10.0
Release: 0
Summary: PCI utilities for the Linux Kernel
License: GPL-2.0-or-later
Group: Hardware/Other
URL: https://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
Source: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.xz
Source1: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.sign
Source2: baselibs.conf
Source3: https://keys.openpgp.org/vks/v1/by-fingerprint/C466A56CADA981F4297D20C31F3D0761D9B65F0B#/pciutils.keyring
Patch0: pciutils-3.1.9_pkgconfig.patch
Patch1: pciutils-endianh.patch
Patch2: pciutils-ocloexec.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libkmod)
BuildRequires: pkgconfig(zlib)
Requires: hwdata
%description
lspci: This program displays detailed information about all PCI busses
and devices in the system, replacing the original /proc/pci interface.
setpci: This program allows reading from and writing to PCI device
configuration registers. For example, you can adjust the latency timers
with it.
update-pciids: This program downloads the current version of the
pci.ids file.
%package -n %{lname}
Summary: PCI utility library
Group: System/Libraries
%description -n %{lname}
libpci offers access to the PCI configuration space.
%package devel
Summary: Library and Include Files of the PCI utilities
Group: Development/Libraries/C and C++
Requires: %{lname} = %{version}
%description devel
This package contains the files that are necessary for software
development using the PCI utilities.
%prep
%autosetup -p1
%build
%make_build OPT="%{optflags}" PREFIX=%{_prefix} LIBDIR=%{_libdir} SBINDIR=%{_bindir} STRIP="" SHARED="yes"
%install
make install PREFIX=%{buildroot}%{_prefix} SBINDIR=%{buildroot}%{_bindir} \
ROOT=%{buildroot} MANDIR=%{buildroot}%{_mandir} STRIP="" \
SHARED="yes" LIBDIR=%{buildroot}%{_libdir}
chmod 0755 %{buildroot}%{_libdir}/libpci.so.%{sover}
mkdir -p %{buildroot}%{_includedir}/pci
cp -p lib/{pci,header,config,types}.h %{buildroot}%{_includedir}/pci
rm -rf %{buildroot}%{_datadir}/pci.ids*
install -D -m 0644 lib/libpci.pc %{buildroot}%{_libdir}/pkgconfig/libpci.pc
ln -sf %{_libdir}/libpci.so.3 %{buildroot}%{_libdir}/libpci.so
%if 0%{?suse_version} < 1550
mkdir %{buildroot}/sbin
ln -s %{_bindir}/{lspci,setpci} %{buildroot}/sbin
%endif
mkdir %{buildroot}%{_sbindir}
ln -s %{_bindir}/{lspci,setpci} %{buildroot}%{_sbindir}
rm %{buildroot}%{_bindir}/update-pciids
rm %{buildroot}%{_mandir}/man8/update-pciids.8
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files
%license COPYING
%doc README
%if 0%{?suse_version} < 1550
/sbin/lspci
/sbin/setpci
%endif
%{_bindir}/lspci
%{_bindir}/setpci
%{_sbindir}/lspci
%{_sbindir}/setpci
%{_mandir}/man7/pcilib.7%{?ext_man}
%{_mandir}/man8/lspci.8%{?ext_man}
%{_mandir}/man8/setpci.8%{?ext_man}
%{_mandir}/man5/pci.ids.5%{?ext_man}
%files -n %{lname}
%license COPYING
%{_libdir}/libpci.so.*
%files devel
%license COPYING
%{_includedir}/pci
%{_libdir}/libpci.so
%{_libdir}/pkgconfig/libpci.pc
%changelog