Просмотр исходного кода

pciutils: Import 3.2.0 from packages and update to 3.2.1.

Álvaro Fernández Rojas 10 лет назад
Родитель
Сommit
67c1ac973d

+ 68
- 0
utils/pciutils/Makefile Просмотреть файл

@@ -0,0 +1,68 @@
1
+#
2
+# Copyright (C) 2007-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=pciutils
11
+PKG_VERSION:=3.2.1
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
+PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16
+PKG_MD5SUM:=425b1acad6854cc2bbb06ac8e48e76fc
17
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
18
+
19
+PKG_INSTALL:=1
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/pciutils
24
+  SECTION:=utils
25
+  CATEGORY:=Utilities
26
+  TITLE:=Linux PCI Utilities
27
+  URL:=http://mj.ucw.cz/pciutils.shtml
28
+  DEPENDS:=+zlib
29
+endef
30
+
31
+define Package/pciutils/description
32
+ contains collection of programs for inspecting and manipulating configuration
33
+ of PCI devices
34
+endef
35
+
36
+define Package/pciutils/postinst
37
+#!/bin/sh
38
+[ -z "$${IPKG_INSTROOT}" ] || \
39
+(cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids; rm pci.ids.gz.old)
40
+exit 0
41
+endef
42
+
43
+MAKE_FLAGS += \
44
+	CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
45
+	PREFIX="/usr" \
46
+	HOST="$(GNU_TARGET_NAME)" \
47
+	ZLIB="yes" \
48
+
49
+ifneq ($(CONFIG_USE_EGLIBC),)
50
+TARGET_LDFLAGS += -lresolv
51
+endif
52
+
53
+define Build/InstallDev
54
+	$(INSTALL_DIR) $(1)/usr/lib
55
+	$(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
56
+	$(INSTALL_DIR) $(1)/usr/include/pci
57
+	$(CP) $(foreach i,pci.h config.h header.h types.h, \
58
+		$(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
59
+endef
60
+
61
+define Package/pciutils/install
62
+	$(INSTALL_DIR) $(1)/usr/sbin
63
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
64
+	$(INSTALL_DIR) $(1)/usr/share
65
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
66
+endef
67
+
68
+$(eval $(call BuildPackage,pciutils))

+ 11
- 0
utils/pciutils/patches/100-remove-no-timestamping.patch Просмотреть файл

@@ -0,0 +1,11 @@
1
+--- a/update-pciids.sh
2
++++ b/update-pciids.sh
3
+@@ -33,7 +33,7 @@ if which curl >/dev/null 2>&1 ; then
4
+ 	DL="curl -o $DEST.new $SRC"
5
+     ${quiet} && DL="$DL -s -S"
6
+ elif which wget >/dev/null 2>&1 ; then
7
+-	DL="wget --no-timestamping -O $DEST.new $SRC"
8
++	DL="wget -O $DEST.new $SRC"
9
+ 	${quiet} && DL="$DL -q"
10
+ elif which lynx >/dev/null 2>&1 ; then
11
+ 	DL="eval lynx -source $SRC >$DEST.new"

+ 11
- 0
utils/pciutils/patches/101-no-strip.patch Просмотреть файл

@@ -0,0 +1,11 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -108,7 +108,7 @@ distclean: clean
4
+ install: all
5
+ # -c is ignored on Linux, but required on FreeBSD
6
+ 	$(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
7
+-	$(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR)
8
++	$(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR)
9
+ 	$(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
10
+ 	$(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
11
+ 	$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8

+ 31
- 0
utils/pciutils/patches/102-compressed-ids.patch Просмотреть файл

@@ -0,0 +1,31 @@
1
+--- a/update-pciids.sh
2
++++ b/update-pciids.sh
3
+@@ -6,9 +6,8 @@ set -e
4
+ SRC="http://pci-ids.ucw.cz/v2.2/pci.ids"
5
+ DEST=pci.ids
6
+ PCI_COMPRESSED_IDS=
7
+-GREP=grep
8
+ 
9
+-# if pci.ids is read-only (because the filesystem is read-only),
10
++# if pci.ids.gz is read-only (because the filesystem is read-only),
11
+ # then just skip this whole process.
12
+ if ! touch ${DEST} >/dev/null 2>&1 ; then
13
+ 	${quiet} || echo "${DEST} is read-only, exiting." 1>&2
14
+@@ -18,7 +17,7 @@ fi
15
+ if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then
16
+ 	DECOMP="cat"
17
+ 	SRC="$SRC.gz"
18
+-	GREP=zgrep
19
++	DEST="$DEST.gz"
20
+ elif which bzip2 >/dev/null 2>&1 ; then
21
+ 	DECOMP="bzip2 -d"
22
+ 	SRC="$SRC.bz2"
23
+@@ -53,7 +52,7 @@ if ! $DECOMP <$DEST.new >$DEST.neww ; th
24
+ 	exit 1
25
+ fi
26
+ 
27
+-if ! $GREP >/dev/null "^C " $DEST.neww ; then
28
++if ! zcat $DEST.neww | grep >/dev/null "^C " ; then
29
+ 	echo >&2 "update-pciids: missing class info, probably truncated file"
30
+ 	exit 1
31
+ fi

+ 11
- 0
utils/pciutils/patches/103-relative-path-ids.patch Просмотреть файл

@@ -0,0 +1,11 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -85,7 +85,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
4
+ ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
5
+ 
6
+ update-pciids: update-pciids.sh
7
+-	sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
8
++	sed <$< >$@ "s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
9
+ 	chmod +x $@
10
+ 
11
+ # The example of use of libpci

+ 11
- 0
utils/pciutils/patches/104-resolv.patch Просмотреть файл

@@ -0,0 +1,11 @@
1
+--- a/lib/configure
2
++++ b/lib/configure
3
+@@ -57,7 +57,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t
4
+ echo >$m 'WITH_LIBS='
5
+ 
6
+ echo_n "Looking for access methods..."
7
+-LIBRESOLV=-lresolv
8
++LIBRESOLV=
9
+ 
10
+ case $sys in
11
+ 	linux*)