From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heath Elwayne Petersen Date: Fri, 28 Dec 2001 19:37:24 +0000 Subject: Is there a bug in hotplug.functions w/ ${TYPE}.usermap? Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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