linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bogus dependencies
@ 2004-05-14 13:31 Alexander E. Patrakov
  0 siblings, 0 replies; only message in thread
From: Alexander E. Patrakov @ 2004-05-14 13:31 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]

> In hotplug-2004_04_01, usb.rc line 77, we see:
> 
> LISTER=`which usbmodules`
> 
> In previous versions, they used `type -p usbmodules`, but that's a 
> bashism and therefore should not be used in scripts starting with #!/bin/sh
> 
> So this is an argument for inclusion of the "which" program into LFS.
> 
The statement above is only partially correct. Let's study the scripts
more thoroughly:

[patrakov in ~/hotplug-2004_04_01]$ grep -rn \`which .
./etc/hotplug/hotplug.functions:84:    2.2*|2.3*|2.4*)  LISTER=`which
${TYPE}modules` ;;
./etc/hotplug/pci.rc:46:        LISTER=`which pcimodules`
./etc/hotplug/usb.rc:77:    LISTER=`which usbmodules`

The first occurence is not of any interest to us, because we don't
support such old kernels.

The second one is relevant to 2.4 code path only and we can't hit it.

The third one is, however, hit, and that's what I originally reported.
But let's see if the usbmodules command is actually used. The answer is
"no"! Details:

The hotplug package, as one can see from the hotplug.functions file,
does not use listers with 2.6 kernels. Therefore, the result of such
testing is relevant to 2.4 code path, and the test itself can be moved
there, see the attached patch.

Summary: the dependencies of hotplug upon "usbmodules" and "which" with
2.6 kernels are bogus and can be patched out without loss of functionality.

-- 
Alexander E. Patrakov




[-- Attachment #2: hotplug-2004_04_01-bogus-deps-1.patch --]
[-- Type: text/x-patch, Size: 1126 bytes --]

Submitted By: Alexander E. Patrakov
Date: 2004-05-13
Initial Package Version: 2004_04_01
Upstream Status: will send a copy to linux-hotplug-devel@lists.sourceforge.net
Origin: Alexander E. Patrakov
Description: Removes bogus dependency upon "which" and "usbmodules"
programs in 2.6 code path

--- hotplug-2004_04_01/etc/hotplug/usb.rc.old	2004-05-13 20:42:25.596236912 +0600
+++ hotplug-2004_04_01/etc/hotplug/usb.rc	2004-05-13 20:43:09.296593448 +0600
@@ -73,12 +73,6 @@
 	#
 
 	# synthesize hotplug events if we can 
-	# we need (non-bash) programs to parse descriptors.
-	LISTER=`which usbmodules`
-	if [ "$LISTER" = "" -o ! -f /proc/bus/usb/devices ]; then
-		echo $"** can't synthesize root hub events"
-		return
-	fi
 
 	# make sure the usb agent will run
 	ACTION=add
@@ -113,6 +107,12 @@
 		done
 	    fi
 	else
+    	    # we need (non-bash) programs to parse descriptors.
+	    LISTER=`which usbmodules`
+	    if [ "$LISTER" = "" -o ! -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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-05-14 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-14 13:31 Bogus dependencies Alexander E. Patrakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).