* Hotplug is obsolete (replaced by udev).

svn path=/nixpkgs/trunk/; revision=8834
This commit is contained in:
Eelco Dolstra 2007-06-05 13:49:24 +00:00
parent 1da5e7fd89
commit cd44dd8aaa
6 changed files with 0 additions and 371 deletions

View File

@ -1,50 +0,0 @@
source $stdenv/setup
preBuild=preBuild
preBuild() {
sed -e "s^@bash\@^$bash^g" \
< etc/hotplug/dasd.agent > etc/hotplug/dasd.agent.tmp
mv etc/hotplug/dasd.agent.tmp etc/hotplug/dasd.agent
sed -e "s^@bash\@^$bash^g" \
< etc/hotplug/tape.agent > etc/hotplug/tape.agent.tmp
mv etc/hotplug/tape.agent.tmp etc/hotplug/tape.agent
sed -e "s^@coreutils\@^$coreutils^g" \
-e "s^@utillinux\@^$utillinux^g" \
-e "s^@gnugrep\@^$gnugrep^g" \
-e "s^@module-init-tools\@^$module_init_tools^g" \
< etc/hotplug/hotplug.functions > etc/hotplug/hotplug.functions.tmp
mv etc/hotplug/hotplug.functions.tmp etc/hotplug/hotplug.functions
sed -e "s^@coreutils\@^$coreutils^g" \
< etc/hotplug/input.rc > etc/hotplug/input.rc.tmp
mv etc/hotplug/input.rc.tmp etc/hotplug/input.rc
sed -e "s^@coreutils\@^$coreutils^g" \
< etc/hotplug/pci.rc > etc/hotplug/pci.rc.tmp
mv etc/hotplug/pci.rc.tmp etc/hotplug/pci.rc
sed -e "s^@gnused\@^$gnused^g" \
-e "s^@coreutils\@^$coreutils^g" \
< etc/hotplug/usb.agent > etc/hotplug/usb.agent.tmp
mv etc/hotplug/usb.agent.tmp etc/hotplug/usb.agent
sed -e "s^@coreutils\@^$coreutils^g" \
-e "s^@gnugrep\@^$gnugrep^g" \
-e "s^@utillinux\@^$utillinux^g" \
-e "s^@module_init_tools\@^$module_init_tools^g" \
-e "s^@gnused\@^$gnused^g" \
-e "s^@procps\@^$procps^g" \
< etc/hotplug/usb.rc > etc/hotplug/usb.rc.tmp
mv etc/hotplug/usb.rc.tmp etc/hotplug/usb.rc
sed -e "s^@bash\@^$bash^g" \
-e "s^@gnused\@^$gnused^g" \
-e "s^@coreutils\@^$coreutils^g" \
< etc/hotplug.d/default/default.hotplug > etc/hotplug.d/default/default.hotplug.tmp
mv etc/hotplug.d/default/default.hotplug.tmp etc/hotplug.d/default/default.hotplug
}
genericBuild

View File

@ -1,12 +0,0 @@
{stdenv, fetchurl, bash, gnused, coreutils, utillinux, gnugrep, module_init_tools}:
stdenv.mkDerivation {
name = "hotplug-2004_03_29";
builder = ./builder.sh;
src = fetchurl {
url = http://nix.cs.uu.nl/dist/tarballs/hotplug-2004_03_29.tar.gz;
md5 = "167bd479a1ca30243c51ca088e0942b3";
};
patches = [./hotplug-install-path.patch ./hotplug-install.patch ./hotplug-2004_03_29.patch];
inherit bash gnused coreutils utillinux gnugrep module_init_tools;
}

View File

@ -1,281 +0,0 @@
diff -ruN hotplug-2004_03_29/etc/hotplug/dasd.agent hotplug-2004_03_29.new/etc/hotplug/dasd.agent
--- hotplug-2004_03_29/etc/hotplug/dasd.agent 2002-08-08 12:05:17.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/dasd.agent 2006-01-07 23:10:53.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@/bin/bash
#
# Dasd hotplug policy agent for Linux 2.4 kernels
#
diff -ruN hotplug-2004_03_29/etc/hotplug/dasd.permissions hotplug-2004_03_29.new/etc/hotplug/dasd.permissions
--- hotplug-2004_03_29/etc/hotplug/dasd.permissions 2002-08-08 11:53:23.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/dasd.permissions 2006-01-07 23:10:53.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@/bin/bash
#
# Copyright (c) 2002 SuSE Linux AG, Nuremberg
#
@@ -27,4 +27,4 @@
*)
die "dasd_permissions: don't know what permissions to give $NODE-$MAJOR-$MINOR-$MISC"
esac
-}
\ No newline at end of file
+}
diff -ruN hotplug-2004_03_29/etc/hotplug/hotplug.functions hotplug-2004_03_29.new/etc/hotplug/hotplug.functions
--- hotplug-2004_03_29/etc/hotplug/hotplug.functions 2004-03-29 21:25:59.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/hotplug.functions 2006-01-08 00:11:10.000000000 +0100
@@ -11,9 +11,9 @@
#
# DEBUG=yes; export DEBUG
-PATH=/bin:/sbin:/usr/sbin:/usr/bin
+#PATH=/bin:/sbin:/usr/sbin:/usr/bin
-KERNEL=`uname -r`
+KERNEL=`@coreutils@/bin/uname -r`
MODULE_DIR=/lib/modules/$KERNEL
HOTPLUG_DIR=/etc/hotplug
@@ -22,10 +22,10 @@
. /etc/sysconfig/hotplug
fi
-if [ -x /usr/bin/logger ]; then
- LOGGER=/usr/bin/logger
-elif [ -x /bin/logger ]; then
- LOGGER=/bin/logger
+if [ -x @utillinux@/bin/logger ]; then
+ LOGGER=@utillinux@/bin/logger
+#elif [ -x /bin/logger ]; then
+ #LOGGER=/bin/logger
else
unset LOGGER
fi
@@ -38,7 +38,7 @@
}
else
mesg () {
- $LOGGER -t $(basename $0)"[$$]" "$@"
+ $LOGGER -t $(@coreutils@/bin/basename $0)"[$$]" "$@"
}
fi
@@ -54,7 +54,7 @@
# Autocleaning happens if none of the devices are open, once any of
# them gets opened; wrong timing.
#
-MODPROBE="/sbin/modprobe -s -q"
+MODPROBE="@module-init-tools@/sbin/modprobe -s -q"
#MODPROBE="/sbin/modprobe -vs"
@@ -128,8 +128,8 @@
do
# maybe driver modules need loading
LOADED=false
- if ! lsmod | grep -q "^$MODULE " > /dev/null 2>&1; then
- if grep -q "^$MODULE\$" $HOTPLUG_DIR/blacklist \
+ if ! @module-init-tools@/sbin/lsmod | @gnugrep@/bin/grep -q "^$MODULE " > /dev/null 2>&1; then
+ if @gnugrep@/bin/grep -q "^$MODULE\$" $HOTPLUG_DIR/blacklist \
>/dev/null 2>&1; then
debug_mesg "... blacklisted module: $MODULE"
continue
@@ -166,7 +166,7 @@
if [ $LOADED = false ]; then
mesg "missing kernel or user mode driver $MODULE "
fi
- if echo "$MODULE" | grep -q "usb-storage" > /dev/null 2>&1 ; then
+ if echo "$MODULE" | @gnugrep@/bin/grep -q "usb-storage" > /dev/null 2>&1 ; then
[ -x /usr/sbin/updfstab ] && /usr/sbin/updfstab
fi
done
@@ -185,7 +185,7 @@
echo "HOTPLUG_TIME='$(/bin/date)'"
fi
- env | egrep -v '^PATH=|^PWD=|^_=|^OLDPWD=|^SHLVL=|^HOME='
+ @coreutils@/bin/env | @gnugrep@/bin/egrep -v '^PATH=|^PWD=|^_=|^OLDPWD=|^SHLVL=|^HOME='
echo ''
# empty line terminates events
}
diff -ruN hotplug-2004_03_29/etc/hotplug/input.rc hotplug-2004_03_29.new/etc/hotplug/input.rc
--- hotplug-2004_03_29/etc/hotplug/input.rc 2004-03-26 23:34:34.000000000 +0100
+++ hotplug-2004_03_29.new/etc/hotplug/input.rc 2006-01-07 23:10:53.000000000 +0100
@@ -119,7 +119,7 @@
: not supported currently
;;
status)
- echo $"INPUT status for kernel: " `uname -srm`
+ echo $"INPUT status for kernel: " `@coreutils@/bin/uname -srm`
echo ''
echo "INPUT devices:"
diff -ruN hotplug-2004_03_29/etc/hotplug/pci.rc hotplug-2004_03_29.new/etc/hotplug/pci.rc
--- hotplug-2004_03_29/etc/hotplug/pci.rc 2004-03-26 23:34:24.000000000 +0100
+++ hotplug-2004_03_29.new/etc/hotplug/pci.rc 2006-01-07 23:10:53.000000000 +0100
@@ -70,7 +70,7 @@
# echo $"pci stop -- ignored"
;;
status)
- echo $"PCI Status for kernel: " `uname -srm`
+ echo $"PCI Status for kernel: " `@coreutils/bin/uname -srm`
echo ''
if [ -f /proc/bus/pci/devices ]; then
diff -ruN hotplug-2004_03_29/etc/hotplug/tape.agent hotplug-2004_03_29.new/etc/hotplug/tape.agent
--- hotplug-2004_03_29/etc/hotplug/tape.agent 2002-10-10 15:43:24.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/tape.agent 2006-01-07 23:10:53.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@/bin/bash
###############################################################################
# Tape hotplug agent for Linux 2.4 kernels
#
diff -ruN hotplug-2004_03_29/etc/hotplug/tape.permissions hotplug-2004_03_29.new/etc/hotplug/tape.permissions
--- hotplug-2004_03_29/etc/hotplug/tape.permissions 2002-10-08 13:09:14.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/tape.permissions 2006-01-07 23:10:53.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@/bin/bash
#
# Copyright (c) 2002 IBM Development Germany, Boeblingen
#
diff -ruN hotplug-2004_03_29/etc/hotplug/usb.agent hotplug-2004_03_29.new/etc/hotplug/usb.agent
--- hotplug-2004_03_29/etc/hotplug/usb.agent 2004-03-26 23:36:38.000000000 +0100
+++ hotplug-2004_03_29.new/etc/hotplug/usb.agent 2006-01-07 23:59:02.000000000 +0100
@@ -143,7 +143,7 @@
if [ ! -f $SYSFS/$DEVPATH/bNumConfigurations ]; then
exit 0
fi
- TMP=$(cat $SYSFS/$DEVPATH/bNumConfigurations)
+ TMP=$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bNumConfigurations)
if [ $TMP -ne 1 -a "$ACTION" = add ]; then
mesg Keeping default configuration with $SYSFS/$DEVPATH
fi
@@ -174,10 +174,10 @@
# work around 2.2.early brokenness
# munges the usb_bcdDevice such that it is a integer rather
# than a float: e.g. 1.0 become 0100
- PRODUCT=`echo $PRODUCT | sed -e "s+\.\([0-9]\)$+.\10+" -e "s/\.$/00/" \
+ PRODUCT=`echo $PRODUCT | @gnused@/bin/sed -e "s+\.\([0-9]\)$+.\10+" -e "s/\.$/00/" \
-e "s+/\([0-9]\)\.\([0-9][0-9]\)+/0\1\2+" \
-e "s+/\([0-9][0-9]\)\.\([0-9][0-9]\)+/\1\2+"`
- set $(echo $PRODUCT | sed -e 's+\([^/]*\)/\([^/]*\)/\(.*\)+\1 \2 \3+')
+ set $(echo $PRODUCT | @gnused@/bin/sed -e 's+\([^/]*\)/\([^/]*\)/\(.*\)+\1 \2 \3+')
usb_idVendor=$((0x$1))
usb_idProduct=$((0x$2))
usb_bcdDevice=$((0x$3))
@@ -190,9 +190,9 @@
usb_bDeviceProtocol=$3
IFS="$DEFAULT_IFS"
elif [ -r $SYSFS/$DEVPATH/bDeviceClass ]; then
- usb_bDeviceClass=$((0x$(cat $SYSFS/$DEVPATH/bDeviceClass)))
- usb_bDeviceSubClass=$((0x$(cat $SYSFS/$DEVPATH/bDeviceSubClass)))
- usb_bDeviceProtocol=$((0x$(cat $SYSFS/$DEVPATH/bDeviceProtocol)))
+ usb_bDeviceClass=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bDeviceClass)))
+ usb_bDeviceSubClass=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bDeviceSubClass)))
+ usb_bDeviceProtocol=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bDeviceProtocol)))
else
# out-of-range values
usb_bDeviceClass=1000
@@ -208,9 +208,9 @@
usb_bInterfaceProtocol=$3
IFS="$DEFAULT_IFS"
elif [ -r $SYSFS/$DEVPATH/bInterfaceClass ]; then
- usb_bInterfaceClass=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceClass)))
- usb_bInterfaceSubClass=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceSubClass)))
- usb_bInterfaceProtocol=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceProtocol)))
+ usb_bInterfaceClass=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bInterfaceClass)))
+ usb_bInterfaceSubClass=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bInterfaceSubClass)))
+ usb_bInterfaceProtocol=$((0x$(@coreutils@/bin/cat $SYSFS/$DEVPATH/bInterfaceProtocol)))
else
# out-of-range values
usb_bInterfaceClass=1000
@@ -340,9 +340,9 @@
# remover, or that the remove action can use to execute a remover.
#
if [ "$DEVICE" = "" ]; then
- REMOVER=/var/run/usb/`echo "$INTERFACE/$PRODUCT/$TYPE" | sed -e 's;/;%;g'`
+ REMOVER=/var/run/usb/`echo "$INTERFACE/$PRODUCT/$TYPE" | @gnused@/bin/sed -e 's;/;%;g'`
else
- REMOVER=/var/run/usb/`echo $DEVICE | sed -e 's;/;%;g'`
+ REMOVER=/var/run/usb/`echo $DEVICE | @gnused@/bin/sed -e 's;/;%;g'`
fi
export REMOVER
@@ -365,13 +365,13 @@
FOUND=false
if [ -f $SYSFS/$DEVPATH/manufacturer ]; then
- LABEL="USB `cat $SYSFS/$DEVPATH/manufacturer` `cat $SYSFS/$DEVPATH/product`"
+ LABEL="USB `@coreutils@/bin/cat $SYSFS/$DEVPATH/manufacturer` `@coreutils@/bin/cat $SYSFS/$DEVPATH/product`"
else
LABEL="USB product $PRODUCT"
fi
if [ -e "$REMOVER" ]; then
- rm -f "$REMOVER"
+ @coreutils@/bin/rm -f "$REMOVER"
fi
# on 2.4 systems, modutils 2.4.2+ maintains MAP_CURRENT
@@ -430,7 +430,7 @@
if [ -x $REMOVER ]; then
$REMOVER
fi
- rm -f $REMOVER
+ @coreutils@/bin/rm -f $REMOVER
if [ -x /usr/sbin/updfstab ]; then
/usr/sbin/updfstab
diff -ruN hotplug-2004_03_29/etc/hotplug/usb.rc hotplug-2004_03_29.new/etc/hotplug/usb.rc
--- hotplug-2004_03_29/etc/hotplug/usb.rc 2004-03-29 21:34:30.000000000 +0200
+++ hotplug-2004_03_29.new/etc/hotplug/usb.rc 2006-01-07 23:10:53.000000000 +0100
@@ -19,7 +19,8 @@
# system console can't be removed by accident.
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
+#PATH=/sbin:/bin:/usr/sbin:/usr/bin
+PATH=@coreutils@/bin:@gnugrep@/bin:@utillinux@/bin:@module_init_tools@/sbin:@gnused@/bin:@procps@/bin
unset I_WANT_A_BROKEN_PS
PS_PERSONALITY=linux
@@ -331,7 +332,7 @@
maybe_stop_usb
;;
status)
- echo $"USB Status for kernel: " `uname -srm`
+ echo $"USB Status for kernel: " `@coreutils@/bin/uname -srm`
echo ''
if [ -f /proc/bus/usb/devices ]; then
diff -ruN hotplug-2004_03_29/etc/hotplug.d/default/default.hotplug hotplug-2004_03_29.new/etc/hotplug.d/default/default.hotplug
--- hotplug-2004_03_29/etc/hotplug.d/default/default.hotplug 2004-03-26 23:34:34.000000000 +0100
+++ hotplug-2004_03_29.new/etc/hotplug.d/default/default.hotplug 2006-01-07 23:10:53.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@/bin/bash
#
# This version of /sbin/hotplug should works on most GNU/Linux systems
# using Linux 2.2.18+ or 2.4.* kernels. On 2.2.*, only USB has such
@@ -32,7 +32,7 @@
# DEBUG=yes export DEBUG
-debug_mesg "arguments ($*) env (`env`)"
+debug_mesg "arguments ($*) env (`@coreutils@/bin/env`)"
#
# Only one required argument: event type type being dispatched.
@@ -47,7 +47,7 @@
AGENTS=""
for AGENT in /etc/hotplug/*.agent ; do
- TYPE=`basename $AGENT | sed s/.agent//`
+ TYPE=`@coreutils@/bin/basename $AGENT | @gnused@/bin/sed s/.agent//`
if [ -x $AGENT ]; then
AGENTS="$AGENTS $TYPE"
else

View File

@ -1,12 +0,0 @@
diff -ruN hotplug-2004_03_29/Makefile hotplug-2004_03_29.new/Makefile
--- hotplug-2004_03_29/Makefile 2003-06-28 02:13:10.000000000 +0200
+++ hotplug-2004_03_29.new/Makefile 2005-08-17 19:35:53.000000000 +0200
@@ -5,7 +5,7 @@
REV=$(shell date "+%Y_%m_%d"| awk '{print $$1}')
# System locations
-prefix =
+prefix = ${out}
exec_prefix = ${prefix}
etcdir = ${prefix}/etc
sbindir = ${exec_prefix}/sbin

View File

@ -1,12 +0,0 @@
diff -ruN hotplug-2004_03_29/Makefile hotplug-2004_03_29.new/Makefile
--- hotplug-2004_03_29/Makefile 2003-06-28 02:13:10.000000000 +0200
+++ hotplug-2004_03_29.new/Makefile 2006-01-04 23:48:15.000000000 +0100
@@ -12,7 +12,7 @@
mandir = ${prefix}/usr/share/man
srcdir = .
-INSTALL = /usr/bin/install -c
+INSTALL = install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}

View File

@ -2234,10 +2234,6 @@ rec {
inherit fetchurl stdenv;
};
hotplug = import ../os-specific/linux/hotplug {
inherit fetchurl stdenv bash gnused coreutils utillinux gnugrep module_init_tools;
};
hwdata = import ../os-specific/linux/hwdata {
inherit fetchurl stdenv;
};