From mboxrd@z Thu Jan 1 00:00:00 1970 From: Per Svennerbrandt Date: Mon, 09 May 2005 21:13:24 +0000 Subject: Re: [ANNOUNCE] hotplug-ng 002 release Message-Id: <20050509211323.GB5297@tsiryulnik> List-Id: References: <20050506212227.GA24066@kroah.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Per Liden Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org * Per Liden (per@fukt.bth.se) wrote: > On Fri, 6 May 2005, Greg KH wrote: > > [...] > > Now, with the 2.6.12-rc3 kernel, and a patch for module-init-tools, the > > USB hotplug program can be written with a simple one line shell script: > > modprobe $MODALIAS > > Nice, but why not just convert all this to a call to > request_module($MODALIAS)? Seems to me like the natural thing to do. I actually have a pretty hackish proof-of-consept patch that does basicly that, and have been running it on my systems for the past five months or so, if anybody's interested. Along with it I also have a patch witch exports the module aliases for PCI and USB devices through sysfs. With it the "coldplugging" of a system (module wise) can be reduced to pretty much: #!/bin/sh for DEV in /sys/bus/{pci,usb}/devices/*; do modprobe `cat $DEV/modalias` done (And I actually run exactly that on my laptop, and it works surpricingly well. (Largly due to the fact that the usb-controller is always attached below the pci-bus of course, but it really wouldn't take that much work to make it do the right thing even without relying on any specific ordering/topology)) With the above in place my system does all the module-loading that I care about automaticly, and most importantly does so without relying on an /etc/hotplug/ dir with everything and it's grandma in it (or at least thousands of lines of shellscripting). But since the request_modalias() thing seemed as such an obvious thing to do I have been reluctant to submit it fearing that I must have missed some fundamental flaw in it or you guys would have implemented it that way a long time ago? (at least since Rusty rewrote the module loader). Was I wrong*? Greg, Rusty, what do you think? / Per Svennerbrandt * I also actually had my kernel add MODALIAS to the hotplug enviroment long before Roman submited his patch doing this, even calling it MODALIAS from the very beginning! :) So obviously I've been wrong before... ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ 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