From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Date: Wed, 16 Feb 2005 10:51:17 +0000 Subject: Re: [ANNOUNCE] hotplug-ng 001 release Message-Id: <20050216105117.GB2360@katya> List-Id: References: <20050211004033.GA26624@suse.de> In-Reply-To: <20050211004033.GA26624@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Feb 14, 2005 at 02:42:08PM -0800, Greg KH wrote: > You are completly correct, I love your kernel patch. I'm glad you like it. In case you're interested, I'll send a patch for the SCSI case in the followup mail. Meanwhile let me speculate a bit about another potential use of this envirnonment variable. E.g. here's a slightly modified /sbin/hotplug from hotplug-2004_09_23: DIR="/etc/hotplug.d" DEVDIR="${DIR}/$1/${MODNAME#*:}" for I in "${DIR}/$1/"* "${DIR}/"default/*.hotplug ; do if [ -f "$I" ]; then case "$I" in *.hotplug) [ -x "$I" ] && "$I" $1 ;; esac elif [ -d "$I" ]; then case "$DEVDIR" in $I) for J in "$I"/*.hotplug; do [ -f "$J" -a -x "$J" ] && "$J" $1 done ;; esac fi done exit 1 It extends the hotplug multiplexor to dispatch the hotplug scripts in the hotplug.d/bus directory and its subdirectories matching the $MODNAME (with the bus: prefix stripped). The subdirectory names would be shell patterns themselves. (This might be somewhat counterintuitive because normally you want all names that match a pattern, but here you want all patterns (at the same time directory names) that match the $MODNAME.) E.g. if someone wants a hotplug script to be run only for USB devices with vendor ID 0x1234 and product ID 0xABCD he would put his script under /etc/hotplug.d/usb/v1234bABCD\*/. This way it can replace that *map thing without the need to start _every_ hotplug script just to see most of them exit without doing anything because they don't match the device. The script above works even with ash from klibc-0.198; it should be fairly easy to implement the same model in the binary hotplug, provided fnmatch is added to klibc. BTW this will probably render "MODNAME" inappropriate; DEVALIAS or something like that would be better. Cheers, Roman. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ 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