From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Tue, 27 Feb 2007 19:16:58 +0000 Subject: Re: Loading modules on demand with /sbin/hotplug Message-Id: <3ae72650702271116hcb55cb1sfd06158df939ddc3@mail.gmail.com> List-Id: References: <20070227172320.GA10176@DervishD> In-Reply-To: <20070227172320.GA10176@DervishD> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On 2/27/07, DervishD wrote: > Hi all :) > > Sorry for self replying, but I forgot to add one thing: > > * DervishD dixit: > > Trying to find a correct combination of keys to filter seemed > > difficult and so I tried a different approach. This time I put my script > > as /sbin/hotplug instead of having it in a "RUN" key. Here my problem is > > that I cannot get the information properly in my script. > > Right now I'm using "udevinfo -q name -p $ENV{DEVPATH}", which > correctly tells me the /dev entry I need to handle, and this works (I > mean, I'm able to create/remove mountpoints and load/unload modules) for > an USB pendrive I have at hand to make tests, but I'm not sure if this > is a good general method, given that I will have USB removable hard > discs, a camera (PTP protocol, not usb-storage), a Palm PDA, etc... > Also, I want to do this too for audio (the system has two cards and they > will be used by name), etc. If my method is enough, just tell and I'll > shut up ;) All events that created a device-node, contain DEVNAME in the environment. If you find MODALIAS in the environment, just run /sbin/modprobe with a RUN rule and almost all needed modules should get auto-loaded. There are only a few exceptions for exotic subsystems. That's all what you need usually. Kay ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ 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