Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37903419
en ru br
Репозитории ALT
4.1: 2004_09_23-alt17
4.0: 2004_09_23-alt17
3.0: 2004_09_23-alt14
+updates:2004_09_23-alt14.1
www.altlinux.org/Changes

Группа :: Система/Настройка/Оборудование
Пакет: hotplug

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: hotplug-2004_09_23-alt.patch
Скачать


diff -urN hotplug-2004_09_23.orig/etc/dev.d/sound/sound.dev hotplug-2004_09_23/etc/dev.d/sound/sound.dev
--- hotplug-2004_09_23.orig/etc/dev.d/sound/sound.dev	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/dev.d/sound/sound.dev	2005-07-14 15:13:12 +0400
@@ -0,0 +1,94 @@
+#!/bin/sh -x
+#
+# SOUND hotplug agent for 2.6 kernels 
+#
+#	ACTION=add
+#	DEVPATH=/class/sound/*
+#
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" -o "$SOUNDPLUG" == "no" ];then
+    exit 0
+fi
+
+
+STATEPATH=/var/lib/hotplug
+
+
+AMIXER=/usr/bin/amixer
+ALSACTL=/usr/sbin/alsactl
+
+[ -x $AMIXER -a -x $ALSACTL ] || exit 0
+
+function mixer() {
+    $AMIXER -c $CARDN set "$1" "$2" >/dev/null 2>&1
+    $AMIXER -c $CARDN set "$1" unmute >/dev/null 2>&1
+}
+
+function set_mixer_default() {
+    mesg "Set default mixer values for $DEVPATH ($CARDN)"
+    mixer Master 75%
+    mixer PCM 90%
+    mixer Synth 90%
+    mixer CD 90%
+    # mute mic
+    $AMIXER -c $CARDN set Mic 0% mute >/dev/null 2>&1
+    # ESS 1969 chipset has 2 PCM channels
+    mixer PCM,1 90%
+    # Trident/YMFPCI/emu10k1
+    mixer Wave 100%
+    mixer Music 100%
+    mixer AC97 100%
+    # CS4237B chipset:
+    mixer 'Master Digital' 75%
+    # Envy24 chips with analog outs
+    mixer DAC 90%
+    mixer DAC,0 90%
+    mixer DAC,1 90%
+    # some notebooks use headphone instead of master
+    mixer Headphone 75%
+    mixer Playback 100%
+    save_mixer
+    exit 0
+}
+
+function restore_mixer() {
+    mesg "Restore mixer values for $DEVPATH ($CARDN)"
+    ret=`$ALSACTL -f "$STATEPATH/asound$CARDN.state" restore $CARDN 2>&1`
+    [ "$ret" == "" ] || return 1
+}
+
+function save_mixer() {
+    rm -f "$STATEPATH/asound$CARDN.state"
+    $ALSACTL -f "$STATEPATH/asound$CARDN.state" store $CARDN
+    ret=$?
+    mesg "Saving mixer values for $DEVPATH ($CARDN): $ret" 
+    return $ret
+}
+
+case $ACTION in
+
+add)
+    [ "${DEVPATH:0:21}" == "/class/sound/controlC" ] || exit 0
+    CARDN=${DEVPATH#'/class/sound/controlC'}
+    [ -f "$STATEPATH/asound$CARDN.state" ] || set_mixer_default
+    restore_mixer || set_mixer_default
+    exit 0
+    ;;
+remove)
+    [ "${DEVPATH:0:21}" == "/class/sound/controlC" ] || exit 0
+    for i in /sys/class/sound/controlC*;do
+	CARDN=${i#'/sys/class/sound/controlC'}
+        save_mixer
+    done
+    ;;
+*)
+    debug_mesg SOUND $ACTION event not supported
+    exit 1
+    ;;
+
+esac
diff -urN hotplug-2004_09_23.orig/etc/hotplug/acpi.rc hotplug-2004_09_23/etc/hotplug/acpi.rc
--- hotplug-2004_09_23.orig/etc/hotplug/acpi.rc	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/hotplug/acpi.rc	2005-05-16 17:35:53 +0400
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+cd /etc/hotplug
+
+SYSFS="needed"
+
+. ./hotplug.functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
+fi
+
+# start this script only for 2.6 kernel and if acpi namespace enabled
+[ -d $SYSFS/firmware/acpi/namespace/ACPI ] || exit 0
+
+
+start()
+{
+	MODULES=`/usr/bin/acpiscan -r 2>/dev/null|sort -u`
+	for i in $MODULES
+	do
+	    /sbin/modprobe $i >/dev/null
+	done
+}
+
+stop()
+{
+	MODULES=`/usr/bin/acpiscan -r 2>/dev/null|sort -u`
+	for i in $MODULES
+	do
+	    /sbin/modprobe -r $i >/dev/null
+	done
+}
+
+status()
+{
+    /usr/bin/acpiscan 2>/dev/null
+}
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  status)
+	status
+	;;
+  stop)
+        ;;
+  restart)
+	stop
+	start
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart}"
+        exit 1
+esac
diff -urN hotplug-2004_09_23.orig/etc/hotplug/blacklist hotplug-2004_09_23/etc/hotplug/blacklist
--- hotplug-2004_09_23.orig/etc/hotplug/blacklist	2004-03-12 02:32:59 +0300
+++ hotplug-2004_09_23/etc/hotplug/blacklist	2005-07-14 13:10:30 +0400
@@ -21,3 +21,48 @@
 
 #evbug is a debug tool and should be loaded explicitly
 evbug
+
+# for hid loading
+usbkbd
+usbmouse
+irusb
+
+# disabling 1394 network interface
+eth1394
+
+# don't load i8xx watchdog
+i8xx_tco
+
+# disabled *fb
+radeonfb
+rivafb
+aty128fb
+atyfb
+radeonfb
+i810fb
+intelfb
+cirrusfb
+kyrofb
+cyber2000fb
+rivafb
+savagefb
+neofb
+pm2fb
+sisfb
+tridentfb
+sstfb
+tdfxfb
+vga16fb
+vfb
+nvidiafb
+
+# block all mtd devices
+ichxrom
+amd76xrom
+
+#
+matrox_w1
+
+#usb oss audio disabled
+audio
+usb-midi
diff -urN hotplug-2004_09_23.orig/etc/hotplug/block.rc hotplug-2004_09_23/etc/hotplug/block.rc
--- hotplug-2004_09_23.orig/etc/hotplug/block.rc	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/hotplug/block.rc	2005-05-16 17:35:53 +0400
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+SYSFS="needed"
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
+fi
+
+
+
+start()
+{
+    for i in `storagescan -r 2>/dev/null|uniq`;do
+	modprobe $i
+    done
+}
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  status)
+	;;
+  stop)
+        ;;
+  restart)
+	start
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart}"
+        exit 1
+esac
+
diff -urN hotplug-2004_09_23.orig/etc/hotplug/cpu.rc hotplug-2004_09_23/etc/hotplug/cpu.rc
--- hotplug-2004_09_23.orig/etc/hotplug/cpu.rc	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/hotplug/cpu.rc	2005-05-16 17:35:53 +0400
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+SYSFS="needed"
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
+fi
+
+start()
+{
+	MODULES=`/usr/bin/cpuscan -r 2>/dev/null|sort -u`
+	for i in $MODULES
+	do
+	    /sbin/modprobe $i >/dev/null
+	done
+}
+
+stop()
+{
+	MODULES=`/usr/bin/cpuscan -r 2>/dev/null|sort -u`
+	for i in $MODULES
+	do
+	    /sbin/modprobe -r $i >/dev/null
+	done
+}
+
+status()
+{
+    /usr/bin/cpuscan 2>/dev/null
+}
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  status)
+	status
+	;;
+  stop)
+        ;;
+  restart)
+	stop
+	start
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart}"
+        exit 1
+esac
diff -urN hotplug-2004_09_23.orig/etc/hotplug/firmware.agent hotplug-2004_09_23/etc/hotplug/firmware.agent
--- hotplug-2004_09_23.orig/etc/hotplug/firmware.agent	2004-09-21 01:23:51 +0400
+++ hotplug-2004_09_23/etc/hotplug/firmware.agent	2005-05-16 17:35:53 +0400
@@ -15,20 +15,15 @@
 # $Id: firmware.agent,v 1.4 2004/09/20 21:23:51 kroah Exp $
 #
 
+SYSFS="needed"
 cd /etc/hotplug
 . ./hotplug.functions
 # DEBUG=yes export DEBUG
 
 # directory of the firmware files
-FIRMWARE_DIR=/lib/firmware
+FIRMWARE_DIRS="/lib/firmware /usr/lib/hotplug/firmware /usr/local/lib/firmware"
 
 # mountpoint of sysfs
-SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
-
-# use /proc for 2.4 kernels
-if [ "$SYSFS" = "" ]; then
-    SYSFS=/proc
-fi
 
 #
 # What to do with this firmware hotplug event?
@@ -40,13 +35,13 @@
         sleep 1
     fi
 
-    if [ -f "$FIRMWARE_DIR/$FIRMWARE" ]; then
+    for DIR in $FIRMWARE_DIRS; do
+        [ -e "$DIR/$FIRMWARE" ] || continue
         echo 1 > $SYSFS/$DEVPATH/loading
-        cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data
+        cat "$DIR/$FIRMWARE" > $SYSFS/$DEVPATH/data
         echo 0 > $SYSFS/$DEVPATH/loading
-    else
-        echo -1 > $SYSFS/$DEVPATH/loading
-    fi
+        exit
+    done
 
     ;;
 
diff -urN hotplug-2004_09_23.orig/etc/hotplug/hotplug.functions hotplug-2004_09_23/etc/hotplug/hotplug.functions
--- hotplug-2004_09_23.orig/etc/hotplug/hotplug.functions	2004-09-21 03:12:07 +0400
+++ hotplug-2004_09_23/etc/hotplug/hotplug.functions	2005-05-16 17:35:53 +0400
@@ -17,10 +17,46 @@
 MODULE_DIR=/lib/modules/$KERNEL
 
 HOTPLUG_DIR=/etc/hotplug
+UPDFSTAB=/usr/sbin/updfstab
 
-if [ -f /etc/sysconfig/hotplug ]; then
-    . /etc/sysconfig/hotplug
+# mount point for sysfs
+if [ -f /proc/mounts ]; then
+    while read MNTPT MNTDIR MNTSYS MNTTYPE; do
+        if test "$MNTSYS" = "sysfs"; then
+            SYSFS="$MNTDIR"
+            break;
+        fi 
+    done </proc/mounts
 fi
+if [ "$SYSFS" = needed ] ; then
+    debug_mesg "Sysfs not mounted, cannot execute"
+    exit 0
+fi
+
+
+SourceIfNotEmpty()
+{
+	local f
+	f="$1"
+	shift
+	[ -s "$f" ] && . "$f" "$@"
+}
+
+LockWait()
+{
+	LOCKFILE="/var/lock/subsys/hotplug_$1"
+	while [ -f "$LOCKFILE" ];do sleep 1;done
+	touch "$LOCKFILE"
+}
+
+RmLock()
+{
+    LOCKFILE="/var/lock/subsys/hotplug_$1"
+    [ ! -f "$LOCKFILE" ] || rm -f "$LOCKFILE"
+}
+
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
 
 if [ -x /usr/bin/logger ]; then
     LOGGER=/usr/bin/logger
@@ -55,7 +91,6 @@
 # them gets opened; wrong timing.
 #
 MODPROBE="/sbin/modprobe -s -q"
-#MODPROBE="/sbin/modprobe -vs"
 
 
 ####################################################################
@@ -77,42 +112,28 @@
     FILENAME=$2
     DESCRIPTION=$3
 
-    # should we use usbmodules, pcimodules?  not on 2.5+, because sysfs
-    # ought to expose the data we need to find all candidate drivers.
-    # (on 2.5.48 it does for usb; but maybe not yet for pci.)
-    case "$KERNEL" in
-    2.2*|2.3*|2.4*)	LISTER=`which ${TYPE}modules` ;;
-    *)			LISTER="" ;;
+    case $TYPE in
+    usb)
+	# lister for usb incompleted :-(
+	;;
+    pci)
+	PCI_SLOT=`echo "$PCI_SLOT_NAME"|sed -s "s,^0*:,,"`
+        debug_mesg "pciscan is scanning modules for $PCI_SLOT ..."
+	DRIVERS=`pciscan -r -s$PCI_SLOT 2>/dev/null`
+	# return if drivers marked by "Card:","Bad:", "ISDN:" or "Server:" (for old hwdatabase format)
+	[ "${DRIVERS:0:5}" == "Card:" ] && return;
+	[ "${DRIVERS:0:4}" == "Bad:" ] && return;
+	[ "${DRIVERS:0:5}" == "ISDN:" ] && return;
+	[ "${DRIVERS:0:7}" == "Server:" ] && return;
+	;;
     esac
 
-    if [ "$LISTER" != "" ]; then
-	# lister programs MIGHT be preferable to parsing from shell scripts:
-	# - usbmodules used for (a) multi-interface devices, (b) coldplug
-	# - pcimodules used only for coldplug
-	case $TYPE in
-	usb)
-	    # "usbutils-0.8" (or later) is needed in $PATH
-	    # only works if we have usbfs
-	    # ... reads more descriptors than are passed in env
-	    # ... doesn't handle comment syntax either
-	    if [ "$DEVICE" = "" -o ! -f "$DEVICE" ]; then
-		LISTER=
-	    else
-		DRIVERS=`$LISTER --mapfile $FILENAME --device $DEVICE`
-	    fi ;;
-
-	pci)
-	    debug_mesg "pcimodules is scanning more than $PCI_SLOT ..."
-	    DRIVERS=`$LISTER`
-	    ;;
-	esac
-    fi
-
     # try parsing by shell scripts if no luck yet
-    if [ "$DRIVERS" = "" ]; then
-	${TYPE}_map_modules < $FILENAME
+    if [ "$DRIVERS" = "" ] && [ "$TYPE" != "pci" ]; then
+        ${TYPE}_map_modules < $FILENAME
     fi
 
+
     # FIXME remove dups and blacklisted modules from $DRIVERS here
 
     if [ "$DRIVERS" = "" ]; then
@@ -135,18 +156,22 @@
 		debug_mesg "... blacklisted module:  $MODULE"
 		continue
 	    fi
-
-	    # statically linked modules aren't shown by 'lsmod',
-	    # and user mode drivers will ONLY have a setup script;
-	    # it's not an error if a module doesn't exist or won't load.
-	    if $MODPROBE -n $MODULE >/dev/null 2>&1 &&
-		    ! $MODPROBE $MODULE >/dev/null 2>&1 ; then
-		mesg "... can't load module $MODULE"
+	    
+	    # skip if module missing for current kernel
+	    if ! $MODPROBE -n $MODULE >/dev/null 2>&1; then
+		debug_mesg "module missing:  $MODULE"
 	    else
-		# /etc/modules.conf may have set non-default module
-		# parameters ... handle per-device parameters in apps
-		# (ioctls etc) not in setup scripts or modules.conf
-		LOADED=true
+		# statically linked modules aren't shown by 'lsmod',
+		# and user mode drivers will ONLY have a setup script;
+		# it's not an error if a module doesn't exist or won't load.
+		if ! $MODPROBE $MODULE >/dev/null 2>&1 ; then
+			mesg "... can't load module $MODULE"
+		else
+		    # /etc/modules.conf may have set non-default module
+		    # parameters ... handle per-device parameters in apps
+		    # (ioctls etc) not in setup scripts or modules.conf
+		    LOADED=true
+		fi
 	    fi
 	else
 	    # This module is already loaded
@@ -167,9 +192,6 @@
 	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
-	    [ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab
-	fi
     done
 }
 
diff -urN hotplug-2004_09_23.orig/etc/hotplug/ieee1394.agent hotplug-2004_09_23/etc/hotplug/ieee1394.agent
--- hotplug-2004_09_23.orig/etc/hotplug/ieee1394.agent	2004-09-21 01:43:37 +0400
+++ hotplug-2004_09_23/etc/hotplug/ieee1394.agent	2005-05-16 17:35:53 +0400
@@ -27,6 +27,13 @@
 . ./hotplug.functions
 # DEBUG=yes export DEBUG
 
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" -o "$IEEE1394PLUG" == "no" ];then
+    exit 0
+fi
+
+
 # generated by modutils 2.4.9 or later, for 2.4.10 and later kernels
 MAP_CURRENT=$MODULE_DIR/modules.ieee1394map
 
diff -urN hotplug-2004_09_23.orig/etc/hotplug/misc.rc hotplug-2004_09_23/etc/hotplug/misc.rc
--- hotplug-2004_09_23.orig/etc/hotplug/misc.rc	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/hotplug/misc.rc	2005-05-16 17:35:53 +0400
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+SYSFS="needed"
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+
+if [ "$HOTPLUG" == "no" ] || [ ! -d /sys/class ] ;then
+    exit 0
+fi
+
+start()
+{
+    /usr/bin/mousescan -l 2>/dev/null >/dev/null
+}
+
+stop()
+{
+    /usr/bin/mousescan 2>/dev/null >/dev/null
+}
+
+status()
+{
+    /usr/bin/mousescan 2>/dev/null
+}
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  status)
+	status
+	;;
+  stop)
+        ;;
+  restart)
+	stop
+	start
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart}"
+        exit 1
+esac
diff -urN hotplug-2004_09_23.orig/etc/hotplug/net.agent hotplug-2004_09_23/etc/hotplug/net.agent
--- hotplug-2004_09_23.orig/etc/hotplug/net.agent	2004-09-21 03:02:34 +0400
+++ hotplug-2004_09_23/etc/hotplug/net.agent	2005-05-16 17:35:53 +0400
@@ -25,7 +25,46 @@
     exit 1
 fi
 
+SourceIfNotEmpty /etc/sysconfig/hotplug
+SourceIfNotEmpty /etc/sysconfig/network
+
+if [ "$HOTPLUG" == "no" -o "$NETPLUG" == "no" ];then
+    exit 0
+fi
+
+# Define network agent hooks for traditional net-scripts configuration
+# system and for /etc/net.
+case $CONFMETHOD in
+	etcnet)
+		IFUP_HOOK=/etc/net/scripts/ifup-removable
+		IFDOWN_HOOK=/etc/net/scripts/ifdown-removable
+	;;
+	*)
+		IFUP_HOOK=/etc/sysconfig/network-scripts/ifup
+		IFDOWN_HOOK=/etc/sysconfig/network-scripts/ifdown
+	;;
+esac
+
 case $ACTION in
+remove|unregister)
+    case $INTERFACE in
+	# interfaces that are unregistered after being "down" (?)
+	ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
+	    debug_mesg assuming $INTERFACE is already down
+	    exit 0
+	    ;;
+	# interfaces that are unregistered then brought down
+	*)
+
+	    # RedHat and similar
+	    export IN_HOTPLUG=1
+	    if [ -x $IFDOWN_HOOK ]; then
+		debug_mesg invoke $IFDOWN_HOOK $INTERFACE hotplug
+		exec $IFDOWN_HOOK $INTERFACE hotplug
+	    fi
+	    ;;
+    esac
+    ;;
 add|register)
     # Red Hat specific hack...
     if [ -f /etc/redhat-release ]; then
@@ -53,9 +92,9 @@
 	    # This needs to be done before ifup otherwise ifup will get
 	    # confused by the name changed and because iface need to be
 	    # down to change its name.
-	    if [ -x /usr/sbin/ifrename ] && [ -r /etc/iftab ]; then
+	    if [ -x /sbin/ifrename ] && [ -r /etc/iftab ]; then
 		debug_mesg invoke ifrename for $INTERFACE
-		NEWNAME=`/usr/sbin/ifrename -i $INTERFACE`
+		NEWNAME=`/sbin/ifrename -i $INTERFACE`
 		if [ -n "$NEWNAME" ]; then
 		    debug_mesg iface $INTERFACE is remapped to $NEWNAME
 		    INTERFACE=$NEWNAME
@@ -64,9 +103,9 @@
 
 	    # RedHat and similar
 	    export IN_HOTPLUG=1
-	    if [ -x /sbin/ifup ]; then
-		debug_mesg invoke ifup $INTERFACE
-		exec /sbin/ifup $INTERFACE
+	    if [ -x $IFUP_HOOK ]; then
+		debug_mesg invoke $IFUP_HOOK $INTERFACE hotplug
+		exec $IFUP_HOOK $INTERFACE hotplug
 
 	    # Gentoo
 	    elif [ -f /etc/gentoo-release ]; then
@@ -82,29 +121,6 @@
     esac
     mesg $1 $ACTION event not handled
     ;;
-
-remove|unregister)
-    case $INTERFACE in
-	# interfaces that are unregistered after being "down" (?)
-	ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
-	    debug_mesg assuming $INTERFACE is already down
-	    exit 0
-	    ;;
-	*)
-	    # right now it looks like only Gentoo wants to care about
-	    # unregistering network devices...
-	    if [ -f /etc/gentoo-release ]; then
-	    	script=/etc/init.d/net.$INTERFACE
-		if [ -x "$script" ]; then
-		    debug_mesg invoke "$script" --quiet stop
-		    exec "$script" --quiet stop
-		fi
-	    fi
-	    ;;
-    esac
-    mesg $1 $ACTION event not handled
-    ;;
-
 *)
     debug_mesg NET $ACTION event for $INTERFACE not supported
     exit 1 ;;
diff -urN hotplug-2004_09_23.orig/etc/hotplug/pci.agent hotplug-2004_09_23/etc/hotplug/pci.agent
--- hotplug-2004_09_23.orig/etc/hotplug/pci.agent	2004-09-21 01:43:37 +0400
+++ hotplug-2004_09_23/etc/hotplug/pci.agent	2005-05-16 17:35:53 +0400
@@ -35,6 +35,13 @@
 cd /etc/hotplug
 . ./hotplug.functions
 
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" -o "$PCIPLUG" == "no" ];then
+    exit 0
+fi
+
+
 # generated by modutils, for current 2.4.x kernels
 MAP_CURRENT=$MODULE_DIR/modules.pcimap
 
diff -urN hotplug-2004_09_23.orig/etc/hotplug/pci.rc hotplug-2004_09_23/etc/hotplug/pci.rc
--- hotplug-2004_09_23.orig/etc/hotplug/pci.rc	2004-09-21 01:36:47 +0400
+++ hotplug-2004_09_23/etc/hotplug/pci.rc	2005-05-16 17:35:53 +0400
@@ -8,9 +8,19 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
+SYSFS="needed"
+
 cd /etc/hotplug
 . ./hotplug.functions
 
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
+fi
+
+
+
 pci_boot_events ()
 {
     # make sure the pci agent will run
@@ -22,14 +32,14 @@
     PCI_SUBSYS_ID=0:0
     export ACTION PCI_CLASS PCI_ID PCI_SLOT PCI_SLOT_NAME PCI_SUBSYS_ID
 
-    if [ -d /sys/bus ]; then
+    if [ -d $SYSFS/bus ]; then
 	# 2.6 kernels
-	if [ -d /sys/bus/pci/devices/ ]; then
-	    cd /sys/bus/pci/devices/
+	if [ -d $SYSFS/bus/pci/devices/ ]; then
+	    cd $SYSFS/bus/pci/devices/
 	    for PCI_DEVICE in *; do
 		set `echo $PCI_DEVICE \
 		    | sed -e 's/\([^:]*\):\(.*\):\(.*\)\.\(.*\)/\1 \2 \3 \4/'`
-		PCI_SLOT_NAME=$2:$3.$4
+		PCI_SLOT_NAME=$1:$2:$3.$4
 		PCI_CLASS="`cat $PCI_DEVICE/class`"
 		PCI_CLASS=${PCI_CLASS#0x}
 		vendor_id=`cat $PCI_DEVICE/vendor`
@@ -38,24 +48,13 @@
 		sub_vendor_id=`cat $PCI_DEVICE/subsystem_vendor`
 		sub_device_id=`cat $PCI_DEVICE/subsystem_device`
 		PCI_SUBSYS_ID="${sub_vendor_id#0x}:${sub_device_id#0x}"
+ 		# skip pci network controllers
+ 		#if [ "${PCI_CLASS:0:2}" == "02" ];then
+ 		#    continue
+ 		#fi
 		/sbin/hotplug pci
 	    done
 	fi
-    else
-	# 2.4 kernels
-	LISTER=`which pcimodules`
-	if [ "$LISTER" = "" ] || [ ! -f /proc/bus/pci/devices ] || [ ! -x pci.agent ]; then
-	    echo $"** can't synthesize pci hotplug events"
-	    return 1
-	fi
-
-	# these notifications will be handled by pcimodules
-	for BUS in `cd /proc/bus/pci;find * -type d -print`; do
-	    for SLOT_FUNC in `cd /proc/bus/pci/$BUS; echo *`; do
-		PCI_SLOT=$BUS:$SLOT_FUNC
-		/sbin/hotplug pci
-	    done
-	done
     fi
 
     return 0
@@ -78,8 +77,8 @@
 	    if [ $COUNT -gt 1 ]; then
 		COUNT=`expr $COUNT - 1`
 		echo $"PCI up; bus count is $COUNT"
-		if [ -x /sbin/lspci ]; then
-		    /sbin/lspci
+		if [ -x /usr/bin/pciscan ]; then
+		    /usr/bin/pciscan -v
 		fi
 	    else
 		echo $"no PCI busses?"
diff -urN hotplug-2004_09_23.orig/etc/hotplug/pnp.rc hotplug-2004_09_23/etc/hotplug/pnp.rc
--- hotplug-2004_09_23.orig/etc/hotplug/pnp.rc	2004-09-23 22:12:49 +0400
+++ hotplug-2004_09_23/etc/hotplug/pnp.rc	2005-05-16 17:35:53 +0400
@@ -23,6 +23,8 @@
 	exit 0
 fi
 
+SYSFS="needed"
+
 cd /etc/hotplug
 . ./hotplug.functions
 
@@ -32,7 +34,7 @@
 # WARNING: od and printf are in /usr/bin
 decode_isapnp_vendor() {
     echo -n $1 | od -A n -t d1 | ( read A B C
-    printf '%x\n' $(( 	( ( $A & 0x3f ) << 2) | \
+    printf '%04x\n' $(( 	( ( $A & 0x3f ) << 2) | \
             		( ( $B & 0x18 ) >> 3) | \
 			( ( $B & 0x07 ) <<13) | \
 			( ( $C & 0x1f ) << 8) )) )
@@ -49,8 +51,7 @@
 isapnp_map_modules ()
 {
     local module ignored
-
-    CHECKED_ID="0x`echo $ISAPNP_ID | cut -b1-4`0x`echo $ISAPNP_ID | cut -b5-8`"
+    
     # comment line lists (current) isapnp_device_id field names
     read ignored
 
@@ -61,39 +62,72 @@
         case "$module" in
 	\#*) continue ;;
 	esac
+	id_temp=""
+	next=""
+	[ "$ISAPNP_CARDID" = "$cardvendor$carddevice " ] || continue
 	: checkmatch $module
 	set $therest
 	while [ $# -gt 0 ] 
 	do
-		id_temp=$2$1
-		if [ "$id_temp" = "$CHECKED_ID" ] ; then
-        	    DRIVERS="$module $DRIVERS"
-        	    : drivers $DRIVERS
-	            break
+		devid=$1$2
+		if [ ! -z "${ISAPNP_ID##*$devid*}" ];then 
+		    next=1
+		    break;
 		fi
 	        shift
 	        shift
 	done
+	[ ! -z "$next" ] && continue
+	DRIVERS="$module $DRIVERS"
+	: drivers $DRIVERS
     done
 }
 
 
-isapnp_boot_events ()
+isapnp_get_devices()
 {
-    cd /sys/bus/pnp/devices/
-    for ISAPNP_DEVICE in * ; do
-	ISAPNP_STRINGS=`cat $ISAPNP_DEVICE/id`
-	for ISAPNP_STRING in $ISAPNP_STRINGS ; do
-	    rawcardvendor=`echo $ISAPNP_STRING | cut -b1-3`
-	    rawcarddevice=`echo $ISAPNP_STRING | cut -b4-7`
-	    cardvendor=`decode_isapnp_vendor $rawcardvendor`
-	    carddevice=`hex_swab $rawcarddevice`
-    	    ISAPNP_ID=$carddevice$cardvendor
-	    LABEL="ISAPNP id $ISAPNP_ID"
-	    load_drivers isapnp $MAP_CURRENT "$LABEL"
-	    load_drivers isapnp /etc/hotplug/pnp.distmap "$LABEL"
+    local DEVICE ISAPNP_STRING ISAPNP_DEVICE
+    DEVICE=$1
+    for ISAPNP_DEVICE in $SYSFS/devices/$DEVICE/*:* ;do
+	for ISAPNP_STRING in `cat $ISAPNP_DEVICE/id` ; do
+	    echo "$ISAPNP_STRING" >>/tmp/2
+    	    decode_card_id $ISAPNP_STRING
 	done
     done
+}
+
+decode_card_id()
+{
+  local ISAPNP_STRING
+  ISAPNP_STRING=$1
+  rawcardvendor=`echo $ISAPNP_STRING | cut -b1-3`
+  rawcarddevice=`echo $ISAPNP_STRING | cut -b4-7`
+  cardvendor=`decode_isapnp_vendor $rawcardvendor`
+  carddevice=`hex_swab $rawcarddevice`
+  echo -n "0x${cardvendor}0x${carddevice} "
+}
+
+isapnp_boot_events ()
+{
+    cd $SYSFS/devices/
+    for ISAPNP_DEVICE in pnp*/*:* ; do
+	ISAPNP_ID=""
+	ISAPNP_CARDID=""
+	if [ -f $ISAPNP_DEVICE/card_id ];then 
+	    ISAPNP_ID=`isapnp_get_devices $ISAPNP_DEVICE`
+	    ISAPNP_STRINGS=`cat $ISAPNP_DEVICE/card_id`
+	    ISAPNP_CARDID=`decode_card_id $ISAPNP_STRINGS`
+	else
+	    ISAPNP_STRINGS=`cat $ISAPNP_DEVICE/id`
+	    ISAPNP_CARDID='0xffff0xffff '
+	    for ISAPNP_STRING in $ISAPNP_STRINGS ; do
+		ISAPNP_ID="$ISAPNP_ID `decode_card_id $ISAPNP_STRING`"
+	    done
+	fi
+	LABEL="ISAPNP cardid $ISAPNP_CARDID deviceid $ISAPNP_ID"
+	load_drivers isapnp $MAP_CURRENT "$LABEL"
+	load_drivers isapnp /etc/hotplug/pnp.distmap "$LABEL"
+    done
     return 0
 }
 
diff -urN hotplug-2004_09_23.orig/etc/hotplug/scsi.agent hotplug-2004_09_23/etc/hotplug/scsi.agent
--- hotplug-2004_09_23.orig/etc/hotplug/scsi.agent	2004-09-21 01:29:54 +0400
+++ hotplug-2004_09_23/etc/hotplug/scsi.agent	2005-05-16 17:35:53 +0400
@@ -9,16 +9,22 @@
 cd /etc/hotplug
 . ./hotplug.functions
 
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" -o "$SCSIPLUG" == "no" ];then
+    exit 0
+fi
+
 case $ACTION in
 
 add)
     # 2.5.50 kernel bug: this happens sometimes
-    if [ ! -d /sys/$DEVPATH ]; then
+    if [ ! -d $SYSFS/$DEVPATH ]; then
 	mesg "bogus sysfs DEVPATH=$DEVPATH"
 	exit 1
     fi
 
-    TYPE_ATTR=/sys$DEVPATH/type
+    TYPE_ATTR=$SYSFS$DEVPATH/type
 
     # Possibly sleep here to try and avoid races with scsi attributes and block
     # devices
diff -urN hotplug-2004_09_23.orig/etc/hotplug/sound.rc hotplug-2004_09_23/etc/hotplug/sound.rc
--- hotplug-2004_09_23.orig/etc/hotplug/sound.rc	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/hotplug/sound.rc	2005-07-14 15:14:10 +0400
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+SYSFS="needed"
+
+cd /etc/hotplug
+
+. ./hotplug.functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
+fi
+
+STATEPATH=/var/lib/hotplug
+
+
+AMIXER=/usr/bin/amixer
+ALSACTL=/usr/sbin/alsactl
+
+start()
+{
+    # make sure the pci agent will run
+    ACTION=add
+    PCI_CLASS=0
+    PCI_ID=0:0
+    PCI_SLOT=0:0.0
+    PCI_SLOT_NAME=0:0.0
+    PCI_SUBSYS_ID=0:0
+    export ACTION PCI_CLASS PCI_ID PCI_SLOT PCI_SLOT_NAME PCI_SUBSYS_ID
+
+    if [ -d $SYSFS/bus ]; then
+	if [ -d $SYSFS/bus/pci/devices/ ]; then
+	    cd $SYSFS/bus/pci/devices/
+	    for PCI_DEVICE in `pciscan -s -c 004 2>/dev/null`; do
+		set `echo $PCI_DEVICE \
+		    | sed -e 's/\([^:]*\):\(.*\):\(.*\)\.\(.*\)/\1 \2 \3 \4/'`
+		PCI_SLOT_NAME=$1:$2:$3.$4
+		PCI_CLASS="`cat $PCI_DEVICE/class`"
+		PCI_CLASS=${PCI_CLASS#0x}
+		vendor_id=`cat $PCI_DEVICE/vendor`
+		device_id=`cat $PCI_DEVICE/device`
+		PCI_ID="${vendor_id#0x}:${device_id#0x}"
+		sub_vendor_id=`cat $PCI_DEVICE/subsystem_vendor`
+		sub_device_id=`cat $PCI_DEVICE/subsystem_device`
+		PCI_SUBSYS_ID="${sub_vendor_id#0x}:${sub_device_id#0x}"
+		/sbin/hotplug pci ||:
+	    done
+	fi
+    fi
+
+}
+
+function save_mixer() {
+    [ -z "$CARDN" ] && return 1
+    rm -f "$STATEPATH/asound$CARDN.state"
+    $ALSACTL -f "$STATEPATH/asound$CARDN.state" store $CARDN
+    ret=$?
+    return $ret
+}
+
+stop()
+{
+    local i
+    for i in `ls -1d /sys/class/sound/controlC* 2>/dev/null`;do
+	CARDN=${i#'/sys/class/sound/controlC'}
+        save_mixer $CARDN
+    done
+}
+
+status()
+{
+	echo "Sound status:"
+	STATEPATH=/var/lib/hotplug
+	NUM=0
+	for i in $SYSFS/class/sound/controlC*
+	do
+	    NUM=$((NUM+1))
+	    DEVPATH=${i#'/sys'}
+	    CARDN=${DEVPATH#'/class/sound/controlC'}
+	    STATUS="not saved"
+	    [ -f "$STATEPATH/asound$CARDN.state" ] && STATUS="$STATEPATH/asound$CARDN.state"
+	    echo "Mixer settings for card #$CARDN ($i): $STATUS"
+	done
+}
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  status)
+	status
+	;;
+  stop)
+	stop
+        ;;
+  restart)
+	stop
+	start
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart}"
+        exit 1
+esac
diff -urN hotplug-2004_09_23.orig/etc/hotplug/usb.agent hotplug-2004_09_23/etc/hotplug/usb.agent
--- hotplug-2004_09_23.orig/etc/hotplug/usb.agent	2004-09-21 02:50:11 +0400
+++ hotplug-2004_09_23/etc/hotplug/usb.agent	2005-05-16 17:35:53 +0400
@@ -74,17 +74,22 @@
 # $Id: usb.agent,v 1.43 2004/09/20 22:50:11 kroah Exp $
 #
 
-if [ -f /etc/sysconfig/usb ]; then
-    . /etc/sysconfig/usb
-fi
-if [ -f /etc/conf.d/usb ]; then
-    . /etc/conf.d/usb
-fi
-
 cd /etc/hotplug
+
+SYSFS="needed"
+
 . ./hotplug.functions
 # DEBUG=yes export DEBUG
 
+SourceIfNotEmpty /etc/sysconfig/usb
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" -o "$USBPLUG" == "no" ];then
+    exit 0
+fi
+
+
 # generated by modutils, for current 2.4.x (and later) kernels
 MAP_CURRENT=$MODULE_DIR/modules.usbmap
 
@@ -122,7 +127,6 @@
 # - per-interface; 2.2/2.4 kernels only reported the first one.
 #	"new" events have nonzero /sys/$DEVPATH/bInterfaceNumber
 # - per-device; "new" events don't have $PRODUCT
-SYSFS=/sys
 if [ "$PRODUCT" = "" ]; then
     # this is either an error, or we're on a 2.5 system...
     if [ "$DEVPATH" = "" ]; then
@@ -250,10 +254,10 @@
 	\#*) continue ;;
 	"") continue ;;
 	esac
-
+	[ "$line" == "" ] && continue
 	set $line
-
 	module=$1
+
 	match_flags=$(($2))
 
 	idVendor=$(($3))
@@ -364,6 +368,7 @@
     # they happen to issue requests at the same time ... it happens easily
     # with slow HID devices and "usbmodules".
     # starting with 2.5 (DEVPATH set), all hcds must queue control traffic.
+    [ "$PRODUCT" == "0/0/0" ] && exit 0;
     if [ "$DEVPATH" = "" ]; then
 	sleep 3
     fi
@@ -439,9 +444,6 @@
     fi
     rm -f $REMOVER
 
-    if [ -x /usr/sbin/updfstab ]; then
-        /usr/sbin/updfstab
-    fi
     ;;
 
 *)
diff -urN hotplug-2004_09_23.orig/etc/hotplug/usb.rc hotplug-2004_09_23/etc/hotplug/usb.rc
--- hotplug-2004_09_23.orig/etc/hotplug/usb.rc	2004-09-21 02:30:35 +0400
+++ hotplug-2004_09_23/etc/hotplug/usb.rc	2005-05-16 17:35:53 +0400
@@ -26,16 +26,26 @@
 
 STATIC_MODULE_LIST=
 X11_USBMICE_HACK=false
+SYSFS="needed"
 
-# override any of the defaults above?
-if [ -f /etc/sysconfig/usb ]; then
-    . /etc/sysconfig/usb
-fi
-if [ -f /etc/conf.d/usb ]; then
-    . /etc/conf.d/usb
+. /etc/hotplug/hotplug.functions || exit 1
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+if [ "$HOTPLUG" == "no" ];then
+    exit 0
 fi
 
 
+# override any of the defaults above?
+SourceIfNotEmpty /etc/sysconfig/usb
+
+grep -iq nousb /proc/cmdline && exit 0
+
+if [ "$USB" = "no" ];then
+    exit 0
+fi
+
 MOUSE_MODULES="mousedev input"
 
 # In its currently-recommended configuration, XFree86 3.3.6 always opens
@@ -84,10 +94,10 @@
 	DEVICE=
 	export ACTION PRODUCT TYPE INTERFACE DEVPATH DEVFS DEVICE
 
-	if [ -d /sys/bus ]; then
-	    if [ -d /sys/bus/usb/devices ]; then
-		cd /sys/bus/usb/devices
-		for device in /sys/bus/usb/devices/[0-9]*; do
+	if [ -d $SYSFS/bus ]; then
+	    if [ -d $SYSFS/bus/usb/devices ]; then
+		cd $SYSFS/bus/usb/devices
+		for device in $SYSFS//bus/usb/devices/[0-9]*; do
 		    devlink=$( readlink -f $device )
 		    DEVPATH=${devlink#/sys}
 		    if [ -f $devlink/../idVendor ]; then
@@ -104,16 +114,6 @@
 		    fi	
 		done
 	    fi
-	else
-	    # we need (non-bash) programs to parse descriptors.
-	    LISTER=`which usbmodules`
-	    if [ "$LISTER" = "" ] || [ ! -f /proc/bus/usb/devices ]; then
-		echo $"** can't synthesize root hub events"
-		return
-	    fi
-	    for DEVICE in /proc/bus/usb/*/*; do
-		/etc/hotplug/usb.agent
-	    done
 	fi
 }
 
@@ -162,21 +162,9 @@
     # /proc or tools (lspci -v|grep USB, etc) to do so.  If hotplugging
     # is enabled on this system, initting a root hub will cause hotplug
     # events to fire for every device on the tree at that root.
-
-    # FIXME: some of this should be driven by PCI hotplugging, and have
-    # the blacklist control which uhci driver gets used (before 2.5).
-
-    # "new style" HCDs ... more common code
-    modprobe -q ehci-hcd >/dev/null 2>&1
-    modprobe -q ohci-hcd >/dev/null 2>&1
-    modprobe -q uhci-hcd >/dev/null 2>&1
-
-    # "old style" HCDs ... more driver-specific bugs
-    modprobe -q usb-ohci >/dev/null 2>&1
-    # NOTE: this prefers "uhci"; you may prefer "usb-uhci".
-    # modprobe -q usb-uhci >/dev/null 2>&1 || modprobe -q uhci >/dev/null 2>&1
-    modprobe -q uhci >/dev/null 2>&1 || modprobe -q usb-uhci >/dev/null 2>&1
-
+    
+    for i in `/usr/bin/pciscan -r -c 00c:03 2>/dev/null|sort -u`;do modprobe $i;done >/dev/null 2>&1
+    
     # ... add any non-PCI HCDS here.  Examples include the
     # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
     # ohci-hcd can handle some non-pci variants.
@@ -222,104 +210,7 @@
 
 maybe_stop_usb ()
 {
-    # call this multiple times if you had to take down components of the
-    # USB subsystem by hand; it cleans up whatever can
-    # be cleaned up, letting the system quiesce further.
-
-    # NOTE:  this list of "all USB modules" is unfortunate, but it seems
-    # inevitable until modutils supports the notion of drivers with use
-    # counts of zero that shouldn't be removed until after their device
-    # gets removed.  Maybe in 2.5 ... of necessity, the list is partial.
-
-    # disconnect all controllers we can, and kernel drivers
-    # HCDs first, so most drivers reduce their use counts.
-    rmmod ehci-hcd >/dev/null 2>&1
-    rmmod ohci-hcd >/dev/null 2>&1
-    rmmod uhci-hcd >/dev/null 2>&1
-    rmmod usb-ohci >/dev/null 2>&1
-    rmmod usb-uhci >/dev/null 2>&1
-    rmmod     uhci >/dev/null 2>&1
-
-    # user mode code may keep usbfs busy for a while yet ...
-
-    # OK, usbcore won't actually be removed unless there happen to be
-    # no USB drivers loaded, and usbfs isn't mounted.  let's force
-    # removal of autocleanable modules before trying to rmmod usbcore
-    rmmod -as
-# note: module-init-tools 0.8a doesn't handle "-as" flags
-
-    # Now let's workaround the fact that some USB modules never increase
-    # their module use counts, so that "rmmod -a" won't unload them.
-    # (And we can't use "modprobe --autoclean" anyway.)
-    rmmod acm              >/dev/null 2>&1
-    rmmod audio            >/dev/null 2>&1
-    rmmod auerswald        >/dev/null 2>&1
-    rmmod belkin_sa        >/dev/null 2>&1
-    rmmod bluetooth        >/dev/null 2>&1
-    rmmod catc             >/dev/null 2>&1
-    rmmod CDCEther         >/dev/null 2>&1
-    rmmod cpia_usb         >/dev/null 2>&1
-    rmmod cyberjack        >/dev/null 2>&1
-    rmmod dabusb           >/dev/null 2>&1
-    rmmod dc2xx            >/dev/null 2>&1
-    rmmod digi_acceleport  >/dev/null 2>&1
-    rmmod dsbr100          >/dev/null 2>&1
-    rmmod emi26            >/dev/null 2>&1
-    rmmod empeg            >/dev/null 2>&1
-    rmmod ftdi_sio         >/dev/null 2>&1
-    rmmod hci_usb          >/dev/null 2>&1
-    rmmod hid              >/dev/null 2>&1
-    rmmod hpusbscsi        >/dev/null 2>&1
-    rmmod ibmcam           >/dev/null 2>&1
-    rmmod iforce           >/dev/null 2>&1
-    rmmod io_edgeport      >/dev/null 2>&1
-    rmmod ipaq             >/dev/null 2>&1
-    rmmod ir-usb           >/dev/null 2>&1
-    rmmod irda-usb         >/dev/null 2>&1
-    rmmod kaweth           >/dev/null 2>&1
-    rmmod keyspan          >/dev/null 2>&1
-    rmmod keyspan_pda      >/dev/null 2>&1
-    rmmod kl5kusb105       >/dev/null 2>&1
-    rmmod mct_u232         >/dev/null 2>&1
-    rmmod mdc800           >/dev/null 2>&1
-    rmmod microtek         >/dev/null 2>&1
-    rmmod omninet          >/dev/null 2>&1
-    rmmod ov511            >/dev/null 2>&1
-    rmmod pegasus          >/dev/null 2>&1
-    rmmod pl2303           >/dev/null 2>&1
-    rmmod printer          >/dev/null 2>&1
-    rmmod pwc pwcx         >/dev/null 2>&1
-    rmmod rio500           >/dev/null 2>&1
-    rmmod rtl8150          >/dev/null 2>&1
-    rmmod scanner          >/dev/null 2>&1
-    rmmod se401            >/dev/null 2>&1
-    rmmod stv680           >/dev/null 2>&1
-    rmmod usbhid           >/dev/null 2>&1
-    rmmod usbkbd           >/dev/null 2>&1
-    rmmod usbmouse         >/dev/null 2>&1
-    rmmod usbnet           >/dev/null 2>&1
-    rmmod usbtest          >/dev/null 2>&1
-    rmmod usb-storage      >/dev/null 2>&1
-    rmmod uss720           >/dev/null 2>&1
-    rmmod vicam            >/dev/null 2>&1
-    rmmod visor            >/dev/null 2>&1
-    rmmod wacom            >/dev/null 2>&1
-    rmmod whiteheat        >/dev/null 2>&1
-
-    if [ "$STATIC_MODULE_LIST" != "" ]; then
-	rmmod $STATIC_MODULE_LIST >/dev/null 2>&1
-    fi
-
-    # remove the helper modules that some usb modules need
-    rmmod usbserial        >/dev/null 2>&1
-    rmmod usbvideo         >/dev/null 2>&1
-
-    # ok, hope that user mode drivers/managers closed their fds.
-    umount /proc/bus/usb >/dev/null 2>&1
-
-    rmmod usbcore >/dev/null 2>&1
-
-    # we did everything we could ...
+    # don't stop usb
     return 0;
 }
 
@@ -352,7 +243,7 @@
 	    if [ -f /proc/bus/usb/drivers ]; then
 		cat /proc/bus/usb/drivers
 	    fi
-	    if [ -d /sys/bus/usb ]; then
+	    if [ -d $SYSFS/bus/usb ]; then
 		ls -1 /sys/bus/usb/drivers
 	    fi
 	else
@@ -388,4 +279,5 @@
   *)
         echo $"Usage: $0 {start|stop|status|restart}"
         exit 1
+	;;
 esac
diff -urN hotplug-2004_09_23.orig/etc/modutils.d/oss hotplug-2004_09_23/etc/modutils.d/oss
--- hotplug-2004_09_23.orig/etc/modutils.d/oss	1970-01-01 03:00:00 +0300
+++ hotplug-2004_09_23/etc/modutils.d/oss	2005-05-16 17:35:53 +0400
@@ -0,0 +1,4 @@
+
+above snd-pcm snd-mixer-oss
+above snd-mixer-oss snd-seq-oss
+above snd-seq-oss snd-pcm-oss
diff -urN hotplug-2004_09_23.orig/etc/rc.d/init.d/hotplug hotplug-2004_09_23/etc/rc.d/init.d/hotplug
--- hotplug-2004_09_23.orig/etc/rc.d/init.d/hotplug	2003-03-28 03:25:03 +0300
+++ hotplug-2004_09_23/etc/rc.d/init.d/hotplug	2005-05-16 17:35:53 +0400
@@ -2,53 +2,59 @@
 #
 # hotplug This scripts starts hotpluggable subsystems.
 #
-# chkconfig: 2345 01 99
+# chkconfig: 2345 32 69
 # description:	Starts and stops each hotpluggable subsystem. \
 #		On startup, may simulate hotplug events for devices \
 #		that were present at boot time, before filesystems \
 #		(or other resources) used by hotplug agents were available.
 #
-# $Id: hotplug,v 1.3 2002/12/03 02:01:48 dbrownell Exp $
-#
 
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
+# Do not load RH compatibility interface.
+WITHOUT_RC_COMPAT=1
 
 # source function library
-if [ -f /etc/init.d/functions ]; then
-	. /etc/init.d/functions
-elif [ -f /etc/rc.d/init.d/functions ]; then
-	. /etc/rc.d/init.d/functions
-fi
+. /etc/init.d/functions
+
+SourceIfNotEmpty /etc/sysconfig/hotplug
+
+[ "$HOTPLUG" == "no" ] && exit 0
+
+LOCKFILE=/var/lock/subsys/hotplug
+
+RETVAL=0
+
+[ -z "$HOTPLUGRC" ] && HOTPLUGRC="usb.rc pci.rc sound.rc"
+ 
+run_rcs () {
+    for RC in $HOTPLUGRC
+    do
+	action "Hotplug ($RC) $1:" /etc/hotplug/$RC $1
+	RETVAL=$?
+    done
+}
 
 case "$1" in
-    start|restart|status)
-	for RC in /etc/hotplug/*.rc
-	do
-	    $RC $1
-	done
-	touch /var/lock/subsys/hotplug
+    start|restart)
+	run_rcs $1
+	[ $RETVAL -eq 0 ] && touch $LOCKFILE
 	;;
     stop)
-	for RC in /etc/hotplug/*.rc
-        do
-            $RC stop
-        done
-        rm -f /var/lock/subsys/hotplug
+	run_rcs $1
+        rm -f $LOCKFILE
         ;;
     force-reload)
-	for RC in /etc/hotplug/*.rc
-        do
-            $RC stop
-        done
-	for RC in /etc/hotplug/*.rc
-        do
-            $RC start
-        done
-        rm -f /var/lock/subsys/hotplug
+	run_rcs $1
         ;;
-
+    status)
+	run_rcs $1
+	;;
+    condrestart|condstop)
+	RETVAL=0
+	;;
     *)
-	echo $"Usage: $0 {start|stop|restart|status|force_reload}"
-	exit 3
+	echo $"Usage: $0 {start|stop|restart|status|force_reload|condrestart|condstop}"
+	RETVAL=3
 	;;
 esac
+
+exit $RETVAL
diff -urN hotplug-2004_09_23.orig/Makefile hotplug-2004_09_23/Makefile
--- hotplug-2004_09_23.orig/Makefile	2004-09-23 21:46:57 +0400
+++ hotplug-2004_09_23/Makefile	2005-05-16 17:35:53 +0400
@@ -20,7 +20,7 @@
 TOPDIR=/
 DIRS= 	/sbin \
 	/etc/hotplug \
-	/etc/init.d/ \
+	/etc/rc.d/init.d/ \
 	/var/run/usb \
 	/usr/share/man/man8
 
@@ -85,14 +85,18 @@
 install:
 	${INSTALL_SCRIPT} -D sbin/hotplug $(sbindir)/hotplug
 	$(INSTALL) -d $(etcdir)/hotplug/{usb,pci}
+	$(INSTALL) -d $(etcdir)/dev.d/sound
+	$(INSTALL) -d $(etcdir)/modutils.d/
 	$(INSTALL) -D etc/hotplug.d/default/default.hotplug $(etcdir)/hotplug.d/default/default.hotplug
 	for F in etc/hotplug/{*.{agent,rc},hotplug.functions} ; do \
 	    ${INSTALL_SCRIPT} $$F $(etcdir)/hotplug ; \
 	    done
-	for F in etc/hotplug/{blacklist,usb.{user,hand,dist}map} ; do \
+	for F in etc/hotplug/{blacklist,usb.{user,hand,dist}map,pnp.distmap} ; do \
 	    ${INSTALL_DATA} $$F $(etcdir)/hotplug ; \
 	    done
-	${INSTALL_SCRIPT} -D etc/rc.d/init.d/hotplug $(etcdir)/init.d/hotplug
+	${INSTALL_SCRIPT} -D etc/rc.d/init.d/hotplug $(etcdir)/rc.d/init.d/hotplug
+	$(INSTALL_SCRIPT) -D etc/dev.d/sound/sound.dev $(etcdir)/dev.d/sound
+	${INSTALL_SCRIPT} -D etc/modutils.d/oss $(etcdir)/modutils.d/oss
 	$(INSTALL_DATA) -D hotplug.8  $(mandir)/man8/hotplug.8
 	$(INSTALL) -d $(prefix)/var/log/hotplug $(prefix)/var/run
 	$(INSTALL) -d -m 700 $(prefix)/var/run/usb
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin