diff -ruN hotplug-2004_03_29.orig/etc/hotplug/hotplug.functions hotplug-2004_03_29/etc/hotplug/hotplug.functions
--- hotplug-2004_03_29.orig/etc/hotplug/hotplug.functions	2004-10-27 02:56:57.000000000 +0900
+++ hotplug-2004_03_29/etc/hotplug/hotplug.functions	2004-10-27 02:56:35.000000000 +0900
@@ -60,6 +60,12 @@
     }
 fi
 
+# provide number_of_files, because wc in /usr/bin and maybe nfs mounted
+number_of_files () {
+   # ls "$1" | wc -l
+   echo $(( 0 $(ls "$1" | sed -e 's/.*/+1/') ))
+}
+
 #
 # Not "modprobe --autoclean" ... one driver module can handle many
 # devices.  Unloading should be done when no devices are present.
diff -ruN hotplug-2004_03_29.orig/etc/hotplug/pci.rc hotplug-2004_03_29/etc/hotplug/pci.rc
--- hotplug-2004_03_29.orig/etc/hotplug/pci.rc	2004-10-27 02:56:57.000000000 +0900
+++ hotplug-2004_03_29/etc/hotplug/pci.rc	2004-10-27 02:55:41.000000000 +0900
@@ -75,7 +75,7 @@
 	echo ''
 
 	if [ -f /proc/bus/pci/devices ]; then
-	    COUNT=`ls /proc/bus/pci | wc -l`
+	    COUNT=$(number_of_files /proc/bus/pci)
 	    if [ $COUNT -gt 1 ]; then
 		COUNT=`expr $COUNT - 1`
 		echo "PCI up; bus count is $COUNT"
diff -ruN hotplug-2004_03_29.orig/etc/hotplug/usb.rc hotplug-2004_03_29/etc/hotplug/usb.rc
--- hotplug-2004_03_29.orig/etc/hotplug/usb.rc	2004-10-27 02:56:57.000000000 +0900
+++ hotplug-2004_03_29/etc/hotplug/usb.rc	2004-10-27 02:55:09.000000000 +0900
@@ -22,6 +22,7 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
 cd /etc/hotplug/
+. ./hotplug.functions
 
 unset I_WANT_A_BROKEN_PS
 PS_PERSONALITY=linux
@@ -228,7 +229,7 @@
 	# ('devices' and 'drivers') with no hcds registered, but works on
 	# newer kernels where usbfs has zero files until hcds register,
 	# and might not have the 'drivers' file.
-	COUNT=`ls /proc/bus/usb | wc -l`
+	COUNT=$(number_of_files /proc/bus/usb)
 	if [ $COUNT -lt 2 ]; then
 	    umount /proc/bus/usb
 	    rmmod usbcore >/dev/null 2>&1
@@ -381,7 +382,7 @@
 	if [ -f /proc/bus/usb/devices ]; then
 	    # as noted above:  this fails on older kernels,
 	    # where usbfs created files differently.
-	    COUNT=`ls /proc/bus/usb | wc -l`
+	    COUNT=$(number_of_files /proc/bus/usb)
 	    if [ $COUNT -ge 2 ]; then
 		COUNT=`expr $COUNT - 2`
 		echo "USB up; bus count is $COUNT"
