the match_flags support
And also this is done...
As always test and retest, I have only one USB device (a non working HP scanner) untill I will take that ZIP100.
Signature · 5 lines
Gioele Barabucci (Gb]) ) mailto:[email protected] ) http://www.gioelebarabucci.com ) ) I've been and now I've gone ) ) /Magic Pie^Oasis
Index: etc/hotplug/blacklist
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/blacklist,v retrieving revision 1.1
hotplug/blacklist +2 -1
@@ -4,7 +4,8 @@ # no matter which driver happens to get probed first. Sometimes user # mode tools can also control driver binding. # -# Syntax: driver name alone on a line. Other lines are ignored. +# Syntax: driver name alone (without any ending spaces) on a line. Other +# lines are ignored. # # uhci ... usb-uhci handles the same pci class
Index: etc/hotplug/hotplug.functions
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/hotplug.functions,v retrieving revision 1.3
hotplug/hotplug.functions +3 -6
@@ -114,15 +114,12 @@ load_drivers () # maybe driver modules need loading and configuring for MODULE in $DRIVERS do - if ! lsmod | grep -q "^$MODULE " - then - if grep -q "^$MODULE\$" /etc/hotplug/blacklist >/dev/null 2>&1 - then + if ! lsmod | grep -q "^$MODULE "; then + if grep -q "^$MODULE\$" /etc/hotplug/blacklist >/dev/null 2>&1; then if [ "$DEBUG" != "" ]; then mesg "... blacklisted module: $MODULE" fi - elif ! $MODPROBE $MODULE >/dev/null 2>&1 - then + elif ! $MODPROBE $MODULE >/dev/null 2>&1; then mesg "... can't load module $MODULE" elif [ -x /etc/hotplug/$TYPE/$MODULE ]; then if [ "$DEBUG" != "" ]; then
Index: etc/hotplug/pci.rc
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/pci.rc,v retrieving revision 1.3
hotplug/pci.rc +3 -5
@@ -27,7 +27,7 @@ fi pci_boot_events () { LISTER=`type -p pcimodules` - if [ x$LISTER = x -o ! -f /proc/bus/pci/devices -o ! -x pci.agent ]; then + if [ "$LISTER" = "" -o ! -f /proc/bus/pci/devices -o ! -x pci.agent ]; then echo $"** can't synthesize pci hotplug events" return fi
@@ -46,10 +46,8 @@ pci_boot_events () # least PCI_CLASS is used by common drivers (USB hcds). # 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 + 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 : hotplug pci for $PCI_SLOT /sbin/hotplug pci
Index: etc/hotplug/usb.agent
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/usb.agent,v retrieving revision 1.9
hotplug/usb.agent +38 -16
124 lines not on this page · raw message
Index: etc/hotplug/usb.rc
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/usb.rc,v retrieving revision 1.7
hotplug/usb.rc +4 -8
@@ -94,8 +94,7 @@ maybe_start_usb () if [ -d /proc/bus/usb ]; then # if it's not mounted, try to mount it if [ ! -f /proc/bus/usb/devices ]; then - if grep -q "[ ]/proc/bus/usb[ ]" /etc/fstab - then + if grep -q "[ ]/proc/bus/usb[ ]" /etc/fstab ; then mount /proc/bus/usb else mount -t usbdevfs usbdevfs /proc/bus/usb
@@ -131,8 +130,7 @@ maybe_start_usb () # if USB is fully modular and yet can clean up, # we know init failed without needing usbdevfs - elif rmmod usbcore >/dev/null 2>&1 - then + elif rmmod usbcore >/dev/null 2>&1; then return 1 fi
@@ -145,8 +143,7 @@ maybe_start_usb () # Some modules are statically loaded, perhaps because they are # needed to activate filesystem device nodes. - for MODULE in $STATIC_MODULE_LIST - do + for MODULE in $STATIC_MODULE_LIST; do modprobe $MODULE done
@@ -223,8 +220,7 @@ case "$1" in cat /proc/bus/usb/drivers else echo $"USB-devfs is unavailable. " - if test -f /proc/modules && fgrep -q usbcore /proc/modules - then + if [ -f /proc/modules ] && fgrep -q usbcore /proc/modules; then echo $"USB module is loaded. " else echo $"USB may be statically linked. "
Index: etc/rc.d/init.d/hotplug
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/rc.d/init.d/hotplug,v retrieving revision 1.2
rc.d/init.d/hotplug +11 -8
@@ -13,23 +13,25 @@ # source function library if [ -f /etc/init.d/functions ]; then - . /etc/init.d/functions + . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ]; then - . /etc/rc.d/init.d/functions + . /etc/rc.d/init.d/functions fi case "$1" in start|restart|status) - for RC in /etc/hotplug/*.rc - do - $RC $1 + for RC in /etc/hotplug/*.rc; do + if [ -x $RC ]; then + $RC $1 + fi done touch /var/lock/subsys/hotplug ;; stop) - for RC in /etc/hotplug/*.rc - do - $RC stop + for RC in /etc/hotplug/*.rc; do + if [ -x $RC ]; then + $RC stop + fi done rm -f /var/lock/subsys/hotplug ;;
@@ -39,3 +41,4 @@ case "$1" in exit 1 ;; esac +
Index: sbin/hotplug
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/sbin/hotplug,v retrieving revision 1.5
hotplug +2 -2
@@ -35,7 +35,7 @@ fi # if [ $# -lt 1 -o "$1" = "help" -o "$1" = "--help" ]; then if [ -t ]; then - echo "Usage: $0 AgentName ..." + echo "Usage: $0 AgentName [AgentArguments]" AGENTS="" for AGENT in /etc/hotplug/*.agent ; do
@@ -63,7 +63,7 @@ AGENT=/etc/hotplug/$1.agent if [ -x $AGENT ]; then shift if [ "$DEBUG" != "" ]; then - mesg "invoke $AGENT" + mesg "invoke $AGENT ($@)" fi exec $AGENT "$@" mesg "couldn't exec $AGENT"
Based on my reading of this, it looks like the comparisons to the version of the device are done as -lt and -gt, which is < and > -- but the semantic meaning of those fields is <= and >=
I don't know how to fix the scripts... will someone with more script foo fix them?
Matt
Quoted 11 lines · Gioele Barabucci
And also this is done...
As always test and retest, I have only one USB device (a non working HP scanner) untill I will take that ZIP100.Signature · 5 lines
Gioele Barabucci (Gb]) ) mailto:[email protected] ) http://www.gioelebarabucci.com ) ) I've been and now I've gone ) ) /Magic Pie^Oasis
Content-Description: Patch with match_flags support
Signature · 6 lines
Matthew Dharm Home: [email protected] Maintainer, Linux USB Mass Storage Driver YOU SEE!!?? It's like being born with only one nipple! -- Erwin User Friendly, 10/19/1998
Quoted 3 lines · Matthew Dharm
Based on my reading of this, it looks like the comparisons to the version of the device are done as -lt and -gt, which is < and > -- but the semantic meaning of those fields is <= and >=
The usb.c code says that comparations with "=" are not needed
Please continue this thread only on the list
Quoted 1 line
Matt
Signature · 11 lines
Gioele Barabucci (Gb]) ) mailto:[email protected] ) http://www.gioelebarabucci.com ) ) I've been and now I've gone ) ) /Magic Pie^Oasis _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
I merged this and fixed some of the bugs. Here's the updated version of "usb.agent" ... works on one RH7 system, haven't yet tried on a distro with bash1. It's not in CVS yet (but the various cleanup-only patches are).
Matt, this uses "range_lo <= bcdVersion < range_hi" for the range test.
- Dave
----- Original Message -----
From: "Gioele Barabucci" <[email protected]>
To: <[email protected]>
Sent: Friday, March 09, 2001 8:07 AM
Subject: the match_flags support
And also this is done...
As always test and retest, I have only one USB device (a non working HP scanner) untill I will take that ZIP100.
Signature · 5 lines
Gioele Barabucci (Gb]) ) mailto:[email protected] ) http://www.gioelebarabucci.com ) ) I've been and now I've gone ) ) /Magic Pie^Oasis