Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
e05dca0825
!54 Fix-filter-support-for-subtrees-in-tree-mode
From: @noodlesland 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-09-27 02:17:21 +00:00
Wang_M
14728417be fix-filter-support-for-subtress-in-tree-mode 2024-09-27 01:59:58 +00:00
openeuler-ci-bot
62e6defadd
!33 update to 3.8.0
From: @lyn1001 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2023-11-09 01:39:35 +00:00
lyn1001
b0b5e5741f Update to 3.8.0 2023-11-07 15:00:24 +08:00
openeuler-ci-bot
0ea9573fd2 !8 pciutils: solve i686 dependency problem and set release num to 4 for CI
From: @liuzhiqiang26
Reviewed-by: @volcanodragon
Signed-off-by: @wubo009
2021-03-05 15:35:05 +08:00
Zhiqiang Liu
5686ed24c0 pciutils: solve i686 dependency problem and set release num to 4 for CI
solve i686 dependency problem and set release num to 4 for CI

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-03-05 15:14:00 +08:00
openeuler-ci-bot
560a3990ad !4 update pciutils to 3.6.4
Merge pull request !4 from lfl/master
2020-05-13 10:58:54 +08:00
wubo009
82455c63c1 update pkg in lts branch 2020-05-12 23:02:39 +08:00
openeuler-ci-bot
4933cf6f6b !3 add patches for displaying more information while running lspci
Merge pull request !3 from hy/master
2020-03-17 22:58:45 +08:00
eulerstorage
187c3be5d1 add fedora patches for displaying more information while run lspci 2020-03-17 22:44:59 +08:00
6 changed files with 283 additions and 8 deletions

View File

@ -2,7 +2,7 @@ diff -up pciutils-3.0.0/Makefile.idpath pciutils-3.0.0/Makefile
--- pciutils-3.0.0/Makefile.idpath 2008-04-10 21:19:43.000000000 +0200
+++ pciutils-3.0.0/Makefile 2008-09-01 15:16:19.000000000 +0200
@@ -27,7 +27,7 @@ ABI_VERSION=.3
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
SBINDIR=$(PREFIX)/sbin
SHAREDIR=$(PREFIX)/share
-IDSDIR=$(SHAREDIR)

View File

@ -0,0 +1,42 @@
From 0478e1f3928bfaa34eb910ba2cbaf1dda8f84aab Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Wed, 10 Aug 2022 13:34:28 +0700
Subject: [PATCH] Avoid adding multiple version tags to the same symbol
This is apparently forbidden in most versions of binutils.
---
lib/filter.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -303,21 +303,25 @@ pci_filter_match_v30(struct pci_filter_v
// (their positions in struct pci_filter were declared as RFU).
STATIC_ALIAS(void pci_filter_init(struct pci_access *a, struct pci_filter *f), pci_filter_init_v38(a, f));
+DEFINE_ALIAS(void pci_filter_init_v33(struct pci_access *a, struct pci_filter *f), pci_filter_init_v38);
SYMBOL_VERSION(pci_filter_init_v30, pci_filter_init@LIBPCI_3.0);
-SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@LIBPCI_3.3);
+SYMBOL_VERSION(pci_filter_init_v33, pci_filter_init@LIBPCI_3.3);
SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@@LIBPCI_3.8);
STATIC_ALIAS(char *pci_filter_parse_slot(struct pci_filter *f, char *str), pci_filter_parse_slot_v38(f, str));
+DEFINE_ALIAS(char *pci_filter_parse_slot_v33(struct pci_filter *f, char *str), pci_filter_parse_slot_v38);
SYMBOL_VERSION(pci_filter_parse_slot_v30, pci_filter_parse_slot@LIBPCI_3.0);
-SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@LIBPCI_3.3);
+SYMBOL_VERSION(pci_filter_parse_slot_v33, pci_filter_parse_slot@LIBPCI_3.3);
SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@@LIBPCI_3.8);
STATIC_ALIAS(char *pci_filter_parse_id(struct pci_filter *f, char *str), pci_filter_parse_id_v38(f, str));
+DEFINE_ALIAS(char *pci_filter_parse_id_v33(struct pci_filter *f, char *str), pci_filter_parse_id_v38);
SYMBOL_VERSION(pci_filter_parse_id_v30, pci_filter_parse_id@LIBPCI_3.0);
-SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@LIBPCI_3.3);
+SYMBOL_VERSION(pci_filter_parse_id_v33, pci_filter_parse_id@LIBPCI_3.3);
SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@@LIBPCI_3.8);
STATIC_ALIAS(int pci_filter_match(struct pci_filter *f, struct pci_dev *d), pci_filter_match_v38(f, d));
+DEFINE_ALIAS(int pci_filter_match_v33(struct pci_filter *f, struct pci_dev *d), pci_filter_match_v38);
SYMBOL_VERSION(pci_filter_match_v30, pci_filter_match@LIBPCI_3.0);
-SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@LIBPCI_3.3);
+SYMBOL_VERSION(pci_filter_match_v33, pci_filter_match@LIBPCI_3.3);
SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@@LIBPCI_3.8);

View File

@ -0,0 +1,206 @@
From 82dfc66797637859ca86b45b6b6007dd7c06a226 Mon Sep 17 00:00:00 2001
From: Pali Rohar <pali@kernel.org>
Date: Sat, 29 Oct 2022 14:09:51 +0200
Subject: [PATCH] lspci: Fix filter support (-s/-d) for subtrees in tree mode
(-t)
---
ls-tree.c | 127 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 93 insertions(+), 34 deletions(-)
diff --git a/ls-tree.c b/ls-tree.c
index cc65ac47..af1e6591 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -219,7 +219,7 @@ print_it(char *line, char *p)
*p = ' ';
}
-static void show_tree_bridge(struct bridge *, char *, char *);
+static void show_tree_bridge(struct pci_filter *filter, struct bridge *, char *, char *);
static char * FORMAT_CHECK(printf, 3, 4)
tree_printf(char *line, char *p, char *fmt, ...)
@@ -252,7 +252,7 @@ tree_printf(char *line, char *p, char *fmt, ...)
}
static void
-show_tree_dev(struct device *d, char *line, char *p)
+show_tree_dev(struct pci_filter *filter, struct device *d, char *line, char *p)
{
struct pci_dev *q = d->dev;
struct bridge *b;
@@ -268,7 +268,7 @@ show_tree_dev(struct device *d, char *line, char *p)
p = tree_printf(line, p, "-[%02x]-", b->secondary);
else
p = tree_printf(line, p, "-[%02x-%02x]-", b->secondary, b->subordinate);
- show_tree_bridge(b, line, p);
+ show_tree_bridge(filter, b, line, p);
return;
}
if (verbose)
@@ -279,53 +279,127 @@ show_tree_dev(struct device *d, char *line, char *p)
print_it(line, p);
}
+static int
+check_bus_filter(struct pci_filter *filter, struct bus *b);
+
+static int
+check_dev_filter(struct pci_filter *filter, struct device *d)
+{
+ struct bridge *br;
+ struct bus *b;
+
+ if (!filter)
+ return 1;
+
+ if (pci_filter_match(filter, d->dev))
+ return 1;
+
+ for (br = &host_bridge; br; br = br->chain)
+ if (br->br_dev == d)
+ {
+ for (b = br->first_bus; b; b = b->sibling)
+ if (check_bus_filter(filter, b))
+ return 1;
+ break;
+ }
+
+ return 0;
+}
+
+static int
+check_bus_filter(struct pci_filter *filter, struct bus *b)
+{
+ struct device *d;
+
+ if (!filter)
+ return 1;
+
+ for (d = b->first_dev; d; d = d->bus_next)
+ if (check_dev_filter(filter, d))
+ return 1;
+
+ return 0;
+}
+
static void
-show_tree_bus(struct bus *b, char *line, char *p)
+show_tree_bus(struct pci_filter *filter, struct bus *b, char *line, char *p)
{
if (!b->first_dev)
print_it(line, p);
else if (!b->first_dev->bus_next)
{
- p = tree_printf(line, p, "--");
- show_tree_dev(b->first_dev, line, p);
+ if (check_dev_filter(filter, b->first_dev))
+ {
+ p = tree_printf(line, p, "--");
+ show_tree_dev(filter, b->first_dev, line, p);
+ }
+ else
+ print_it(line, p);
}
else
{
+ int empty = 1;
struct device *d = b->first_dev;
while (d->bus_next)
{
- char *p2 = tree_printf(line, p, "+-");
- show_tree_dev(d, line, p2);
+ if (check_dev_filter(filter, d))
+ {
+ char *p2 = tree_printf(line, p, "+-");
+ show_tree_dev(filter, d, line, p2);
+ empty = 0;
+ }
d = d->bus_next;
}
- p = tree_printf(line, p, "\\-");
- show_tree_dev(d, line, p);
+ if (check_dev_filter(filter, d))
+ {
+ p = tree_printf(line, p, "\\-");
+ show_tree_dev(filter, d, line, p);
+ empty = 0;
+ }
+ if (empty)
+ print_it(line, p);
}
}
static void
-show_tree_bridge(struct bridge *b, char *line, char *p)
+show_tree_bridge(struct pci_filter *filter, struct bridge *b, char *line, char *p)
{
*p++ = '-';
if (!b->first_bus->sibling)
{
- if (b == &host_bridge)
- p = tree_printf(line, p, "[%04x:%02x]-", b->domain, b->first_bus->number);
- show_tree_bus(b->first_bus, line, p);
+ if (check_bus_filter(filter, b->first_bus))
+ {
+ if (b == &host_bridge)
+ p = tree_printf(line, p, "[%04x:%02x]-", b->domain, b->first_bus->number);
+ show_tree_bus(filter, b->first_bus, line, p);
+ }
+ else
+ print_it(line, p);
}
else
{
+ int empty = 1;
struct bus *u = b->first_bus;
char *k;
while (u->sibling)
{
- k = tree_printf(line, p, "+-[%04x:%02x]-", u->domain, u->number);
- show_tree_bus(u, line, k);
+ if (check_bus_filter(filter, u))
+ {
+ k = tree_printf(line, p, "+-[%04x:%02x]-", u->domain, u->number);
+ show_tree_bus(filter, u, line, k);
+ empty = 0;
+ }
u = u->sibling;
}
- k = tree_printf(line, p, "\\-[%04x:%02x]-", u->domain, u->number);
- show_tree_bus(u, line, k);
+ if (check_bus_filter(filter, u))
+ {
+ k = tree_printf(line, p, "\\-[%04x:%02x]-", u->domain, u->number);
+ show_tree_bus(filter, u, line, k);
+ empty = 0;
+ }
+ if (empty)
+ print_it(line, p);
}
}
@@ -333,20 +407,5 @@ void
show_forest(struct pci_filter *filter)
{
char line[LINE_BUF_SIZE];
- if (filter == NULL)
- show_tree_bridge(&host_bridge, line, line);
- else
- {
- struct bridge *b;
- for (b=&host_bridge; b; b=b->chain)
- {
- if (b->br_dev && pci_filter_match(filter, b->br_dev->dev))
- {
- struct pci_dev *d = b->br_dev->dev;
- char *p = line;
- p = tree_printf(line, p, "%04x:%02x:", d->domain_16, d->bus);
- show_tree_dev(b->br_dev, line, p);
- }
- }
- }
+ show_tree_bridge(filter, &host_bridge, line, line);
}

Binary file not shown.

BIN
pciutils-3.8.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,16 +1,27 @@
Name: pciutils
Version: 3.6.2
Release: 5
Version: 3.8.0
Release: 2
Summary: PCI bus related utilities
License: GPLv2+
URL: http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
Source0: https://mirrors.edge.kernel.org/pub/software/utils/pciutils/%{name}-%{version}.tar.gz
Patch0: 0000-pciutils-2.2.1-idpath.patch
Patch1: 0001-pciutils-dir-d.patch
# patch0 is from fedora, change pci.ids directory from /usr/share to /usr/share/hwdata
Patch0000: 0000-pciutils-2.2.1-idpath.patch
# patch1 is from fedora, rhbz#195327
Patch0001: 0001-pciutils-dir-d.patch
#https://github.com/openwrt/packages/pull/19215
Patch0002: 0002-avoid-addng-multiple-version-tags.patch
#https://github.com/pciutils/pciutils/pull/112
Patch0003: 0003-lspci-fix-filter-support-for-subtress-in-tree-mode.patch
ExclusiveOS: Linux
BuildRequires: gcc git sed kmod-devel pkgconfig zlib-devel
BuildRequires: gcc sed kmod-devel pkgconfig zlib-devel
%ifarch i686
BuildRequires: which kmod-libs
%endif
Requires: hwdata
Provides: %{name}-libs
Obsoletes: %{name}-libs
@ -47,7 +58,7 @@ Requires: man
This contains man files for the using of pciutils.
%prep
%autosetup -Sgit -n %{name}-%{version}
%autosetup -n %{name}-%{version} -p1
%build
make SHARED="no" ZLIB="no" LIBKMOD=yes STRIP="" OPT="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" PREFIX="/usr" %{?_smp_mflags}
@ -82,7 +93,7 @@ rm -rf $RPM_BUILD_ROOT/usr/share/hwdata/pci.ids*
%files
%defattr(-,root,root,-)
%doc README ChangeLog pciutils.lsm COPYING
/sbin/lspci
/usr/bin/lspci
/sbin/setpci
/sbin/update-pciids
/%{_lib}/libpci.so.*
@ -95,6 +106,7 @@ rm -rf $RPM_BUILD_ROOT/usr/share/hwdata/pci.ids*
%{_libdir}/libpci.a
%files help
%{_mandir}/man5/*
%{_mandir}/man7/*
%{_mandir}/man8/*
@ -102,6 +114,21 @@ rm -rf $RPM_BUILD_ROOT/usr/share/hwdata/pci.ids*
rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Sep 25 2024 wangmian <wangmian@h-partners.com> - 3.8.0-2
- Fix filter support (-s/-d) for subtrees in tree mode
* Tue Nov 7 2023 liyanan <liyanan61@h-partners.com> - 3.8.0-1
- update to v3.8.0
* Tue Feb 9 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 3.6.4-4
- solve i686 dependency problem and set release num to 4 for CI
* Tue Apr 14 2020 linfeilong<linfeilong@huawei.com> - 3.6.4-1
- Type:enhancemnet
- ID:NA
- SUG:NA
- DESC:update to 3.6.4
* Tue Mar 17 2020 hy-euler <eulerstoragemt@huawei.com> - 3.6.2-5
- Type:enhancemnet
- ID:NA