From 2a619b7d62f884027c0a81078780776771cc2ece Mon Sep 17 00:00:00 2001 From: frank Date: Sat, 28 Jan 2012 21:04:53 +0100 Subject: [PATCH] committing changes in /etc after emerge run Package changes: +sys-apps/pciutils-3.1.7 --- .etckeeper | 3 ++ conf.d/pciparm | 28 +++++++++++++ cron.monthly/update-pciids | 2 + init.d/pciparm | 80 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 conf.d/pciparm create mode 100755 cron.monthly/update-pciids create mode 100755 init.d/pciparm diff --git a/.etckeeper b/.etckeeper index dbd000f..3e3df0c 100755 --- a/.etckeeper +++ b/.etckeeper @@ -129,6 +129,7 @@ maybe chmod 0644 './conf.d/net' maybe chmod 0644 './conf.d/network' maybe chmod 0644 './conf.d/ntp-client' maybe chmod 0644 './conf.d/ntpd' +maybe chmod 0644 './conf.d/pciparm' maybe chmod 0644 './conf.d/pydoc-2.7' maybe chmod 0644 './conf.d/pydoc-3.1' maybe chmod 0644 './conf.d/rsyncd' @@ -235,6 +236,7 @@ maybe chmod 0644 './cron.hourly/.keep_sys-process_cronbase-0' maybe chmod 0755 './cron.hourly/sysstat' maybe chmod 0750 './cron.monthly' maybe chmod 0644 './cron.monthly/.keep_sys-process_cronbase-0' +maybe chmod 0755 './cron.monthly/update-pciids' maybe chmod 0750 './cron.weekly' maybe chmod 0644 './cron.weekly/.keep_sys-process_cronbase-0' maybe chmod 0644 './crontab' @@ -492,6 +494,7 @@ maybe chmod 0755 './init.d/nscd' maybe chmod 0755 './init.d/ntp-client' maybe chmod 0755 './init.d/ntpd' maybe chmod 0755 './init.d/numlock' +maybe chmod 0755 './init.d/pciparm' maybe chmod 0755 './init.d/php-fpm' maybe chmod 0755 './init.d/procfs' maybe chmod 0755 './init.d/pwcheck' diff --git a/conf.d/pciparm b/conf.d/pciparm new file mode 100644 index 0000000..f036b15 --- /dev/null +++ b/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/cron.monthly/update-pciids b/cron.monthly/update-pciids new file mode 100755 index 0000000..4c69423 --- /dev/null +++ b/cron.monthly/update-pciids @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/sbin/update-pciids -q diff --git a/init.d/pciparm b/init.d/pciparm new file mode 100755 index 0000000..705b647 --- /dev/null +++ b/init.d/pciparm @@ -0,0 +1,80 @@ +#!/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.3 2008/10/11 02:47:50 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 + SPEC_ID=$2 + shift 2 + case "$SWITCH" in + -d) DESC=vendor ;; + -s) DESC=bus ;; + *) eerror "Unknown setpci type: $SWITCH" ; return 1 ;; + esac + + 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 "$@" + rc=$? + eend $rc + return $rc +} + +do_setpci_array() { + name=$1 + shift + i=0 + while true; do + eval opt="\$${name}_$i" + # End of loop + [ -z "${opt}" ] && break + # Pass in all other parameters here, in case we want to use multiple + # arguments later. + do_setpci "$@" $opt #|| return 1 + i=$(($i+1)) + done +} + +start() { + if get_bootparam "nopciparm" ; then + ewarn "Skipping pciparm init as requested in kernel cmdline" + return 0 + fi + + checkconfig || return 1 + + # We do not exit after any errors presently, because it might be a + # stability-related fix after a failure. + [ -n "$PCIPARM_ALL" ] && \ + do_setpci -d '*:*' $PCIPARM_ALL #|| return 1 + + do_setpci_array PCIPARM_BUS -s #|| return 1 + do_setpci_array PCIPARM_VENDOR -d #|| return 1 +} -- 2.39.5