summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-10-07 11:07:09 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-10-07 11:07:09 +0000
commita237433c40e8964b66c28dd4a0b579bb613aaf6c (patch)
tree859faf6f1e2ed4ef7f33b0c643b304a6a51e3ed1 /sys-apps/pciutils
parentNew major version. Adds function to guess language for a given filename and m... (diff)
downloadhistorical-a237433c40e8964b66c28dd4a0b579bb613aaf6c.tar.gz
historical-a237433c40e8964b66c28dd4a0b579bb613aaf6c.tar.bz2
historical-a237433c40e8964b66c28dd4a0b579bb613aaf6c.zip
Implement pciparm init.d per bug #173347.
Package-Manager: portage-2.2_rc11/cvs/Linux 2.6.27-rc1-10246-gca5de40 x86_64
Diffstat (limited to 'sys-apps/pciutils')
-rw-r--r--sys-apps/pciutils/ChangeLog6
-rw-r--r--sys-apps/pciutils/Manifest6
-rw-r--r--sys-apps/pciutils/files/conf.d-pciparm28
-rw-r--r--sys-apps/pciutils/files/init.d-pciparm76
-rw-r--r--sys-apps/pciutils/pciutils-3.0.2.ebuild5
5 files changed, 117 insertions, 4 deletions
diff --git a/sys-apps/pciutils/ChangeLog b/sys-apps/pciutils/ChangeLog
index 0b70a7e43465..d8a31053ed06 100644
--- a/sys-apps/pciutils/ChangeLog
+++ b/sys-apps/pciutils/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/pciutils
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/ChangeLog,v 1.145 2008/10/07 10:13:18 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/ChangeLog,v 1.146 2008/10/07 11:07:05 robbat2 Exp $
+
+ 07 Oct 2008; Robin H. Johnson <robbat2@gentoo.org> +files/conf.d-pciparm,
+ +files/init.d-pciparm, pciutils-3.0.2.ebuild:
+ Implement pciparm init.d per bug #173347.
*pciutils-3.0.2 (07 Oct 2008)
diff --git a/sys-apps/pciutils/Manifest b/sys-apps/pciutils/Manifest
index 1ba319b3a4e5..a2f8e30b69cc 100644
--- a/sys-apps/pciutils/Manifest
+++ b/sys-apps/pciutils/Manifest
@@ -1,3 +1,5 @@
+AUX conf.d-pciparm 988 RMD160 47d31ca9710c1be47e060e235394784b7831a6e0 SHA1 740ff1012c2fa2211357f707d17875c8d1ca66a5 SHA256 ffdec7d6c510a502d212129d31a9b37c3b9c75393a48a8b1ee6010b7d4aa1887
+AUX init.d-pciparm 1742 RMD160 7bb8ff462ae0b314a565652b1aac949389220c15 SHA1 7f18c35aa06ec7fcb151e7faa6fb02ddd9ca154c SHA256 921f9dfe5851763b90a76e668ea94dc449e4209ddc1d1553977404642dd90bad
AUX pcimodules-pciutils-2.2.6.patch 10096 RMD160 5a89bed94911789ed99e52f5b6fade90027ea050 SHA1 fef276e0b650dd66aab821941a6f433667c53e8b SHA256 993eca5530ac3b9a1f210b9f8d5df7cc37a2a1958f391554aabb1fb9a26c2f5b
AUX pcimodules-pciutils-3.0.0.patch 9041 RMD160 ab4a9d7cc3df5f3492a72d1ce54013891223730f SHA1 a22d0eb22a8042bcb6efc1face16fa9987ca1c7d SHA256 a18b6e41c1e0c4b295ecba923541ae1206889f82893c7edddc588c091ee8164c
AUX pciutils-2.2.7-build.patch 716 RMD160 f142d0fbfaed97d4b75d479ac295757befd9935a SHA1 33f5b05c97dd0e74a6cd08ebf8495c55fb4eca81 SHA256 43c963ac3af01878a4a2303a657a3fbecc0c9a1cc545cc724ba2edaa3a14bf45
@@ -11,6 +13,6 @@ DIST pciutils-3.0.0.tar.gz 244756 RMD160 e0ac0d4f4da0732a159520d8ca4fdea547d9723
DIST pciutils-3.0.2.tar.gz 270474 RMD160 bab0a8261267dd7be50c29984c1d813174c4a0f7 SHA1 4591785f6f70ed44e593933bb34012d83b4c3853 SHA256 ab11bd88c7e20b2bc4801df044086be69b6d728dc88cf6e73db47cdd02c46584
EBUILD pciutils-2.2.10.ebuild 1489 RMD160 e526319da981149203c7de5f11fddb743a08a33b SHA1 703e8af045ea0b1b00e83b33bf284a4f465e70f5 SHA256 7571bcaa536bf6b68905f1b8c8259ab6279dfeb4ce181ecb2ee88db28dac5b38
EBUILD pciutils-3.0.0.ebuild 1808 RMD160 fde67a9da9a2b664e3a789100d3d0af0e6f23d64 SHA1 bc9d0b1d73a8ed78c0acff8869ef4662db31d8bd SHA256 88be7fc27de6b5aeb4af9b6fdf1a3b7fa93c78e5bde9d2a1d0be72c3db240221
-EBUILD pciutils-3.0.2.ebuild 1881 RMD160 3e3a83d4bc5c833509874901535eadef54f77d5b SHA1 aaa72d1e701c3af08a1e8028f99706ce5d301cef SHA256 359b670c1e872ec2896a9abf67e16ad9462832d7ba4f8d00775d9f0f5983cf81
-MISC ChangeLog 19037 RMD160 b1296847d4ace2a00b4ead27644ddae43f930037 SHA1 05ec53076413990b561a1f25edd6aaafe7fbbec1 SHA256 d5858a60c9c082ac9b4fe281829fec39b6d0bb87fe19510ce75455de05252490
+EBUILD pciutils-3.0.2.ebuild 1976 RMD160 6812c5d2fc0416957657441cfefb25eeb939d8ef SHA1 808de6f1bc35440124c0be27fb83fce104aa7f97 SHA256 fc2f120c5110c813b29ea44eb0a6fa9c5f48fb03aa88a483e4ea35f2f91982ad
+MISC ChangeLog 19206 RMD160 209586f7f6fb43c85891a808895b4f1cbbecee7f SHA1 c0276b7b3d94cb500781704784541fa449d8aee2 SHA256 83523a0522a9e350a5c9ec44f761c3b3503a4d4339b8f4dd5b2ed876217f2adb
MISC metadata.xml 257 RMD160 bda78cd844850cace7d31b3bff6de2d1a7a298d5 SHA1 d754bc91dd7fc7496f5c3aa307879ae74ce3b465 SHA256 665e73270ac904a5c3989d16be4ad8e3d3b492049adebb76621f772d60647a97
diff --git a/sys-apps/pciutils/files/conf.d-pciparm b/sys-apps/pciutils/files/conf.d-pciparm
new file mode 100644
index 000000000000..f036b15ad20c
--- /dev/null
+++ b/sys-apps/pciutils/files/conf.d-pciparm
@@ -0,0 +1,28 @@
+# PCI tweaking article:
+# http://www.gentoo.org/doc/en/articles/hardware-stability-p2.xml
+#
+# Apply to all devices:
+# PCIPARM_ALL="...."
+# Cards also can be addressed by vid:pid or by bus:slot.func
+# (see setpci man page relative to -d and -s options)
+# PCIPARM_(BUS|VENDOR)_#="...."
+# Where # is sequentially numbered from zero.
+
+# Examples:
+# "open up" the PCI bus by allowing fairly long bursts
+# for all devices, increasing performance
+# (equivalent to: setpci -v -d *:* latency_timer=b0)
+#PCIPARM_ALL="latency_timer=b0"
+
+# maximize latency timers for network and audio,
+# allowing them to transmit more data per burst,
+# preventing buffer over/under-run conditions
+#PCIPARM_BUS_0="00:04.0 latency_timer=ff"
+#PCIPARM_BUS_1="01:04.0 latency_timer=ff"
+#PCIPARM_VENDOR_0="1057:3410 latency_timer=ff"
+
+# -v : whether to be verbose about changes
+# -D : dry-run, no commit
+# -f : do not warn if the change is already set
+# (see the setpci manpage for more advanced options)
+SETPCI_OPT="-f"
diff --git a/sys-apps/pciutils/files/init.d-pciparm b/sys-apps/pciutils/files/init.d-pciparm
new file mode 100644
index 000000000000..d31eefdeeb9e
--- /dev/null
+++ b/sys-apps/pciutils/files/init.d-pciparm
@@ -0,0 +1,76 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/files/init.d-pciparm,v 1.1 2008/10/07 11:07:09 robbat2 Exp $
+
+depend() {
+ before bootmisc hdparm
+ after localmount
+}
+
+checkconfig() {
+ if [ ! -f /etc/conf.d/pciparm ]; then
+ ewarn "/etc/conf.d/pciparm does not exist, skipping"
+ return 1
+ fi
+
+ if [ -z "${PCIPARM_ALL}" -a -z "${PCIPARM_BUS_0}" -a -z "${PCIPARM_VENDOR_0}" ]; then
+ ewarn "None of PCIPARM_ALL, PCIPARM_BUS_* or PCIPARM_VENDOR_* set in /etc/conf.d/pciparm"
+ return 1
+ fi
+}
+
+do_setpci() {
+ #ewarn "do_setpci: /usr/sbin/setpci $SETPCI_OPT $@"
+ SWITCH=$1
+ case "$SWITCH" in
+ -d) DESC="(vendor)" ;;
+ -s) DESC="(bus)" ;;
+ *) eerror "Unknown setpci type!" ; return 1 ;;
+ esac
+ shift
+ SPEC_ID=$1
+ shift
+ if [[ -z "$SPEC_ID" ]]; then
+ eerror "Missing device specifier!"
+ return 1
+ fi
+ if [[ -z "$@" ]]; then
+ eerror "Missing configuration to set for $DESC $SPEC_ID!"
+ return 1
+ fi
+ ebegin "Setting PCI params for $DESC $SPEC_ID to $@"
+ /usr/sbin/setpci $SETPCI_OPT $SWITCH $SPEC_ID "$@"
+ eend $?
+ SWITCH=""
+ SPEC_ID=""
+}
+
+start() {
+ if get_bootparam "nopciparm" ; then
+ ewarn "Skipping pciparm init as requested in kernel cmdline"
+ return 0
+ fi
+
+ checkconfig || return 1
+
+ if [ -n "$PCIPARM_ALL" ]; then
+ do_setpci -d '*:*' $PCIPARM_ALL
+ fi
+
+ SEQ_BUS=0
+ while true; do
+ BUS_OPT=`eval echo '$'PCIPARM_BUS_${SEQ_BUS}`
+ [[ -z "$BUS_OPT" ]] && break
+ do_setpci -s $BUS_OPT
+ SEQ_BUS=$(($SEQ_BUS+1))
+ done
+
+ SEQ_VENDOR=0
+ while true; do
+ VENDOR_OPT=`eval echo '$'PCIPARM_VENDOR_${SEQ_VENDOR}`
+ [[ -z "$VENDOR_OPT" ]] && break
+ do_setpci -d $VENDOR_OPT
+ SEQ_VENDOR=$(($SEQ_VENDOR+1))
+ done
+}
diff --git a/sys-apps/pciutils/pciutils-3.0.2.ebuild b/sys-apps/pciutils/pciutils-3.0.2.ebuild
index b5f93751581d..37394cd6629e 100644
--- a/sys-apps/pciutils/pciutils-3.0.2.ebuild
+++ b/sys-apps/pciutils/pciutils-3.0.2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-3.0.2.ebuild,v 1.1 2008/10/07 10:13:18 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-3.0.2.ebuild,v 1.2 2008/10/07 11:07:05 robbat2 Exp $
inherit eutils flag-o-matic toolchain-funcs multilib
@@ -61,4 +61,7 @@ src_install() {
elog "Providing a backwards compatibility non-compressed pci.ids"
gzip -d <"${sharedir}"/pci.ids.gz >"${sharedir}"/pci.ids
fi
+
+ newinitd "${FILESDIR}"/init.d-pciparm pciparm
+ newconfd "${FILESDIR}"/conf.d-pciparm pciparm
}