From: Heath Elwayne Petersen <HeathPetersen@CompuServe.com>
To: linux-hotplug@vger.kernel.org
Subject: Is there a bug in hotplug.functions w/ ${TYPE}.usermap?
Date: Fri, 28 Dec 2001 19:37:24 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-100956841615955@msgid-missing> (raw)
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
next reply other threads:[~2001-12-28 19:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-28 19:37 Heath Elwayne Petersen [this message]
2001-12-29 1:37 ` Is there a bug in hotplug.functions w/ ${TYPE}.usermap? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-hotplug-100956841615955@msgid-missing \
--to=heathpetersen@compuserve.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).