linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is there a bug in hotplug.functions w/ ${TYPE}.usermap?
@ 2001-12-28 19:37 Heath Elwayne Petersen
  2001-12-29  1:37 ` Stamatis Mitrofanis
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Heath Elwayne Petersen @ 2001-12-28 19:37 UTC (permalink / raw)
  To: linux-hotplug

I have been trying to use linux-hotplug to run a script when a device is 
recognized.  However, I have been running into a problem.  It seams that 
there may be an error in the hotplug.functions load_drivers function.

In that function there is a section of code as follows:

	elif find $MODULE_DIR -name $MODULE.o >/dev/null 2>&1 &&
			! $MODPROBE $MODULE >/dev/null 2>&1 ; then
		mesg "... can't load module $MODULE"

It appears that the intent is:

	else if the module object file exists
		attempt to load the module
		if the module load fails
			display an error
		end-if

If this is the case, the error is that the find command does not return a 
false return code when it fails to find the file.  Therefore, the modprobe will always 
be tried, and the following code, which attempts to execute 
/etc/hotplug/$TYPE/$MODULE will never be executed.

I have created an *!*UNTESTED*!* patch to the 2001_09_19 version of 
hotplug.functions.  It is included below.  My apologies for not testing it 
yet, but I've been pulled away on something else.

Please let me know what you think.

Heath Petersen
HeathPetersen@CompuServe.com

OUTPUT OF: diff hotplug.functions.orig hotplug.functions
---- Cut Here ----
128c128,129
<           elif find $MODULE_DIR -name $MODULE.o >/dev/null 2>&1 &&
---
>           elif find $MODULE_DIR -name $MODULE.o 2>&1 \
>                       | grep -q . >/dev/null 2>&1 &&
---- Cut Here ----

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-12-31  4:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-28 19:37 Is there a bug in hotplug.functions w/ ${TYPE}.usermap? Heath Elwayne Petersen
2001-12-29  1:37 ` Stamatis Mitrofanis
2001-12-29  4:38 ` Keith Owens
2001-12-29 18:23 ` David Brownell
2001-12-29 18:50 ` David Brownell
2001-12-30  3:22 ` Stamatis Mitrofanis
2001-12-30  7:49 ` David Brownell
2001-12-31  4:42 ` Stamatis Mitrofanis

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).