[Demudi-commits] r520 - in packages: . rtirq rtirq/trunk rtirq/trunk/debian rtirq/trunk/debian/patches rtirq/trunk/debian/realtime rtirq/trunk/debian/realtime/etc rtirq/trunk/debian/realtime/etc/default
Free Ekanayaka
free-guest@costa.debian.org
Mon, 11 Apr 2005 13:06:44 +0000
Author: free-guest
Date: 2005-04-11 13:06:43 +0000 (Mon, 11 Apr 2005)
New Revision: 520
Added:
packages/rtirq/
packages/rtirq/tags/
packages/rtirq/trunk/
packages/rtirq/trunk/debian/
packages/rtirq/trunk/debian/changelog
packages/rtirq/trunk/debian/compat
packages/rtirq/trunk/debian/control
packages/rtirq/trunk/debian/copyright
packages/rtirq/trunk/debian/patches/
packages/rtirq/trunk/debian/patches/00list
packages/rtirq/trunk/debian/patches/rtirq.conf.dpatch
packages/rtirq/trunk/debian/patches/rtirq.sh.dpatch
packages/rtirq/trunk/debian/realtime/
packages/rtirq/trunk/debian/realtime/etc/
packages/rtirq/trunk/debian/realtime/etc/default/
packages/rtirq/trunk/debian/realtime/etc/default/realtime-lsm.conf
packages/rtirq/trunk/debian/rules
packages/rtirq/trunk/rtirq.conf
packages/rtirq/trunk/rtirq.sh
packages/rtirq/trunk/rtirq.spec
Log:
[svn-inject] Installing original source of rtirq
Added: packages/rtirq/trunk/debian/changelog
===================================================================
--- packages/rtirq/trunk/debian/changelog 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/changelog 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,5 @@
+rtirq (20041118-1) unstable; urgency=low
+
+ * First release.
+
+ -- Free Ekanayaka <free@agnula.org> Mon, 11 Apr 2005 14:57:57 +0200
Added: packages/rtirq/trunk/debian/compat
===================================================================
--- packages/rtirq/trunk/debian/compat 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/compat 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1 @@
+4
Added: packages/rtirq/trunk/debian/control
===================================================================
--- packages/rtirq/trunk/debian/control 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/control 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,12 @@
+Source: rtirq
+Section: base
+Priority: optional
+Maintainer: Free Ekanayaka <free@agnula.org>
+Build-Depends-Indep: debhelper (>= 4.1.0), dpatch
+Standards-Version: 3.6.0
+
+Package: rtirq
+Architecture: all
+Description: Realtime IRQ
+ This package contains scripts to prioritize IRQ thread handlers
+ on a realtime-preemptible kernel
Added: packages/rtirq/trunk/debian/copyright
===================================================================
--- packages/rtirq/trunk/debian/copyright 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/copyright 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,10 @@
+This package was debianized by Free Ekanayaka <free@agnula.org> on
+Mon, 11 Apr 2005 12:32:42 +0100.
+
+Download site: http://lalists.stanford.edu/lau/2005/03/0137.html
+Author: Rui Nuno Capela
+
+Copyright:
+
+This software is distributed under the General Public Lisense, version 2
+(see /usr/share/common-licenses/GPL-2 for more information)
Added: packages/rtirq/trunk/debian/patches/00list
===================================================================
--- packages/rtirq/trunk/debian/patches/00list 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/patches/00list 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,2 @@
+rtirq.conf.dpatch
+rtirq.sh.dpatch
Added: packages/rtirq/trunk/debian/patches/rtirq.conf.dpatch
===================================================================
--- packages/rtirq/trunk/debian/patches/rtirq.conf.dpatch 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/patches/rtirq.conf.dpatch 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## rtirq.conf.dpatch by Free Ekanayaka <free@agnula.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad rtirq-20041118/rtirq.conf /tmp/dpep.QESeKk/rtirq-20041118/rtirq.conf
+--- rtirq-20041118/rtirq.conf 2004-11-11 19:17:41.000000000 +0100
++++ /tmp/dpep.QESeKk/rtirq-20041118/rtirq.conf 2005-04-11 12:46:55.000000000 +0200
+@@ -3,7 +3,7 @@
+ # Copyright (c) 2004 rncbc aka Rui Nuno Capela.
+ # All rights reserved.
+ #
+-# /etc/sysconfig/rtirq
++# /etc/default/rtirq
+ #
+ # Configuration for IRQ thread tunning,
+ # for realtime-preempt enabled kernels,
Property changes on: packages/rtirq/trunk/debian/patches/rtirq.conf.dpatch
___________________________________________________________________
Name: svn:executable
+
Added: packages/rtirq/trunk/debian/patches/rtirq.sh.dpatch
===================================================================
--- packages/rtirq/trunk/debian/patches/rtirq.sh.dpatch 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/patches/rtirq.sh.dpatch 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## rtirq.sh.dpatch by Free Ekanayaka <free@agnula.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad rtirq-20041118/rtirq.sh /tmp/dpep.1xSZvl/rtirq-20041118/rtirq.sh
+--- rtirq-20041118/rtirq.sh 2004-11-18 15:11:49.000000000 +0100
++++ /tmp/dpep.1xSZvl/rtirq-20041118/rtirq.sh 2005-04-11 14:12:40.000000000 +0200
+@@ -43,7 +43,7 @@
+ }
+
+ # Check for existence of needed config file and read it.
+-RTIRQ_CONFIG=/etc/sysconfig/rtirq
++RTIRQ_CONFIG=/etc/default/rtirq
+ [ -r ${RTIRQ_CONFIG} ] || {
+ echo "`basename $0`: ${RTIRQ_CONFIG}: not found."
+ [ "${RTIRQ_ACTION}" = "stop" ] && exit 0 || exit 6
+@@ -74,7 +74,7 @@
+ IRQ=$4
+ PID=`${RTIRQ_PIDOF} "IRQ ${IRQ}"`
+ if [ $((${PID})) -gt 0 ]; then
+- PREPEND="`basename $0`: ${ACTION} [${NAME}] irq=${IRQ} pid=${PID}"
++ PREPEND="Setting IRQ priorities: ${ACTION} [${NAME}] irq=${IRQ} pid=${PID}"
+ case ${ACTION} in
+ start)
+ PREPEND="${PREPEND} prio=${PRI2}"
Property changes on: packages/rtirq/trunk/debian/patches/rtirq.sh.dpatch
___________________________________________________________________
Name: svn:executable
+
Added: packages/rtirq/trunk/debian/realtime/etc/default/realtime-lsm.conf
===================================================================
--- packages/rtirq/trunk/debian/realtime/etc/default/realtime-lsm.conf 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/realtime/etc/default/realtime-lsm.conf 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,14 @@
+# Configuration file for the realtime LSM module
+# PARAMETERS can be one or more of:
+#
+# gid=xx (allow realtime capabilities for gid xx only)
+# any=1|0 (allow any user and process to have realtime)
+# mlock=1|0 (allow/disallow mlocking)
+# allcaps=1|0 (allow setpcap functionality (dangerous!))
+
+# enable loading of module at startup
+ENABLE=yes
+
+# parameter settings for module
+PARAMETERS="gid=29"
+
Added: packages/rtirq/trunk/debian/rules
===================================================================
--- packages/rtirq/trunk/debian/rules 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/debian/rules 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,57 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+
+# module-assistant rules
+
+include /usr/share/dpatch/dpatch.make
+
+PACKAGE=rtirq
+
+# Here we do not have to build
+build: patch-stamp
+ cp rtirq.conf debian/rtirq.default
+ cp rtirq.sh debian/rtirq.init
+
+clean: unpatch
+ dh_testdir
+ dh_testroot
+
+ # Add here commands to clean up after the build process.
+ -rm debian/rtirq.default
+ -rm debian/rtirq.init
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k -i
+ dh_installdirs -i
+ dh_install -i
+
+binary:
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installinit --name=$(PACKAGE) -- defaults 15
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture independant packages using the common target.
+binary-indep: install-indep
+
+binary: binary-indep
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
Property changes on: packages/rtirq/trunk/debian/rules
___________________________________________________________________
Name: svn:executable
+
Added: packages/rtirq/trunk/rtirq.conf
===================================================================
--- packages/rtirq/trunk/rtirq.conf 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/rtirq.conf 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Copyright (c) 2004 rncbc aka Rui Nuno Capela.
+# All rights reserved.
+#
+# /etc/sysconfig/rtirq
+#
+# Configuration for IRQ thread tunning,
+# for realtime-preempt enabled kernels,
+#
+
+# IRQ Thread service names
+# (space separeted list, from higher to lower priority).
+RTIRQ_NAME_LIST="timer rtc snd usb i8042"
+
+# Highest priority.
+RTIRQ_PRIO_HIGH=90
+
+# Priority decrease step.
+RTIRQ_PRIO_DECR=10
+
+# Whether to reset all IRQ threads to SCHED_OTHER.
+RTIRQ_RESET_ALL=0
+
Added: packages/rtirq/trunk/rtirq.sh
===================================================================
--- packages/rtirq/trunk/rtirq.sh 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/rtirq.sh 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,194 @@
+#!/bin/sh
+#
+# Copyright (c) 2004 rncbc aka Rui Nuno Capela.
+# All rights reserved.
+#
+# /etc/init.d/rtirq
+#
+# Startup script for realtime-preempt enabled kernels.
+#
+# chkconfig: 35 81 19
+# description: Realtime IRQ thread tunning.
+#
+### BEGIN INIT INFO
+# Provides: rtirq
+# Required-Start: $syslog $local_fs
+# Should-Start: $time alsa alsasound hotplug
+# Required-Stop: $syslog $local_fs
+# Should-Stop: $time alsa alsasound hotplug
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Realtime IRQ thread tunning.
+# Description: Change the realtime scheduling policy
+# and priority of relevant system driver IRQ handlers.
+### END INIT INFO
+#
+
+
+# Won't work without those binaries.
+for DIR in /sbin /usr/sbin /bin /usr/bin /usr/local/bin; do
+ [ -z "${RTIRQ_CHRT}" -a -x ${DIR}/chrt ] && RTIRQ_CHRT=${DIR}/chrt
+ [ -z "${RTIRQ_PIDOF}" -a -x ${DIR}/pidof ] && RTIRQ_PIDOF=${DIR}/pidof
+done
+
+# Check for missing binaries (stale symlinks should not happen)
+[ -n "${RTIRQ_CHRT}" -a -x ${RTIRQ_CHRT} ] || {
+ echo "`basename $0`: chrt: not installed."
+ [ "$1" = "stop" ] && exit 0 || exit 5
+}
+
+[ -n "${RTIRQ_PIDOF}" -a -x ${RTIRQ_PIDOF} ] || {
+ echo "`basename $0`: pidof: not installed."
+ [ "$1" = "stop" ] && exit 0 || exit 5
+}
+
+# Check for existence of needed config file and read it.
+RTIRQ_CONFIG=/etc/sysconfig/rtirq
+[ -r ${RTIRQ_CONFIG} ] || {
+ echo "`basename $0`: ${RTIRQ_CONFIG}: not found."
+ [ "${RTIRQ_ACTION}" = "stop" ] && exit 0 || exit 6
+}
+
+# Read configuration.
+. ${RTIRQ_CONFIG}
+
+
+#
+# Reset policy of all IRQ threads out there.
+#
+function rtirq_reset () {
+# PIDS=`ps -eo pid,class | egrep '(FF|RR)' | awk '{print $1}'`
+ PIDS=`ps -eo pid,comm | grep IRQ | awk '{print $1}'`
+ for PID in ${PIDS}; do
+ ${RTIRQ_CHRT} --pid --other 0 ${PID}
+ done
+}
+
+#
+# IRQ thread handler policy prioritizer by number.
+#
+function rtirq_exec_num () {
+ ACTION=$1
+ NAME=$2
+ PRI2=$3
+ IRQ=$4
+ PID=`${RTIRQ_PIDOF} "IRQ ${IRQ}"`
+ if [ $((${PID})) -gt 0 ]; then
+ PREPEND="`basename $0`: ${ACTION} [${NAME}] irq=${IRQ} pid=${PID}"
+ case ${ACTION} in
+ start)
+ PREPEND="${PREPEND} prio=${PRI2}"
+ if ${RTIRQ_CHRT} --pid --fifo ${PRI2} ${PID}; then
+ echo "${PREPEND}: OK."
+ else
+ echo "${PREPEND}: FAILED."
+ fi
+ ;;
+ stop)
+ if ${RTIRQ_CHRT} --pid --other 0 ${PID}; then
+ echo "${PREPEND}: OK."
+ else
+ echo "${PREPEND}: FAILED."
+ fi
+ ;;
+ status)
+ echo "${PREPEND}: " && ${RTIRQ_CHRT} --pid --verbose ${PID}
+ ;;
+ *)
+ echo "${PREPEND}: ERROR."
+ ;;
+ esac
+ fi
+}
+
+#
+# IRQ thread handler policy prioritizer by name.
+#
+function rtirq_exec_name () {
+ ACTION=$1
+ NAME=$2
+ PRI1=$3
+ IRQS=`grep "${NAME}" /proc/interrupts | awk -F: '{print $1}'`
+ for IRQ in ${IRQS}; do
+ rtirq_exec_num ${ACTION} ${NAME} ${PRI1} ${IRQ}
+ PRI1=$((${PRI1} - 1))
+ done
+}
+
+
+#
+# Main executive.
+#
+function rtirq_exec () {
+ ACTION=$1
+ # Check configured base priority.
+ PRI0=${RTIRQ_PRIO_HIGH}
+ [ $((${PRI0})) -gt 90 ] && PRI0=90
+ [ $((${PRI0})) -lt 10 ] && PRI0=10
+ # Check configured priority decrease step.
+ DECR=${RTIRQ_PRIO_DECR}
+ [ $((${DECR})) -gt 20 ] && DECR=20
+ [ $((${DECR})) -lt 1 ] && DECR=1
+ # Process all configured service names...
+ for NAME in ${RTIRQ_NAME_LIST}; do
+ case ${NAME} in
+ snd)
+ IRQS=`grep irq /proc/asound/cards | sed 's/.* irq \(.*\)/\1/'`
+ for IRQ in ${IRQS}; do
+ rtirq_exec_num ${ACTION} ${NAME} ${PRI0} ${IRQ}
+ done
+ ;;
+ usb)
+ rtirq_exec_name ${ACTION} "ohci_hcd" ${PRI0}
+ rtirq_exec_name ${ACTION} "uhci_hcd" ${PRI0}
+ rtirq_exec_name ${ACTION} "ehci_hcd" ${PRI0}
+ ;;
+ *)
+ rtirq_exec_name ${ACTION} ${NAME} ${PRI0}
+ ;;
+ esac
+ [ ${PRI0} -gt ${DECR} ] && PRI0=$((${PRI0} - ${DECR}))
+ done
+}
+
+
+#
+# Main procedure line.
+#
+case $1 in
+ *start)
+ if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]; then
+ rtirq_reset
+ fi
+ rtirq_exec start
+ ;;
+ stop)
+ if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]; then
+ rtirq_reset
+ #else
+ # rtirq_exec stop
+ fi
+ ;;
+ reset)
+ if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]; then
+ rtirq_reset
+ else
+ rtirq_exec stop
+ fi
+ ;;
+ status)
+ echo
+ #rtirq_exec status
+ ps -eo pid,class,rtprio,ni,pri,pcpu,stat,comm --sort -rtprio \
+ | egrep '(^[ ]*PID|IRQ)'
+ echo
+ ;;
+ *)
+ echo
+ echo " Usage: $0 {[re]start|stop|reset|status}"
+ echo
+ exit 1
+ ;;
+esac
+
+exit 0
Property changes on: packages/rtirq/trunk/rtirq.sh
___________________________________________________________________
Name: svn:executable
+
Added: packages/rtirq/trunk/rtirq.spec
===================================================================
--- packages/rtirq/trunk/rtirq.spec 2005-04-11 09:45:51 UTC (rev 519)
+++ packages/rtirq/trunk/rtirq.spec 2005-04-11 13:06:43 UTC (rev 520)
@@ -0,0 +1,63 @@
+%define name rtirq
+%define version 20041118
+%define release 1
+
+Summary: Realtime IRQ thread system tunning.
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Copyright: GPL
+Packager: rncbc
+Group: System Environment/Base
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: /var/tmp/%{name}-%{version}-buildroot
+Requires: /bin/sh,schedutils
+
+Requires(post,preun): /sbin/chkconfig
+
+%description
+Startup scripts for tunning the realtime scheduling policy and priority
+of relevant IRQ service threads, featured for a realtime-preempt enabled
+kernel configuration.
+
+%prep
+
+%setup
+
+%build
+
+%install
+if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
+install -vD rtirq.sh -m 0755 $RPM_BUILD_ROOT/etc/init.d/rtirq
+install -vD rtirq.conf -m 0644 $RPM_BUILD_ROOT/etc/sysconfig/rtirq
+
+%post
+# only run on install, not upgrade
+if [ "$1" = "1" ]; then
+ chkconfig --add rtirq
+ chkconfig rtirq on
+fi
+
+%preun
+# only run if this is the last instance to be removed
+if [ "$1" = "0" ]; then
+ chkconfig rtirq off
+ chkconfig --del rtirq
+fi
+
+%clean
+if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
+
+%files
+%defattr(-,root,root)
+%config /etc/sysconfig/rtirq
+/etc/init.d/rtirq
+
+%changelog
+* Thu Nov 12 2004 Rui Nuno Capela <rncbc@users.sourceforge.net>
+- Bumped to 20041112 version.
+* Thu Nov 8 2004 Rui Nuno Capela <rncbc@users.sourceforge.net>
+- Update for the new 20041108 version.
+* Thu Nov 4 2004 Rui Nuno Capela <rncbc@users.sourceforge.net>
+- Created initial rtirq.spec
+