linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: DervishD <udev@dervishd.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: Loading modules on demand with /sbin/hotplug
Date: Tue, 27 Feb 2007 20:17:01 +0000	[thread overview]
Message-ID: <20070227201701.GA16331@DervishD> (raw)
In-Reply-To: <20070227172320.GA10176@DervishD>

    Hi Kay :)

    Thanks for your fast answer :)

 * Kay Sievers <kay.sievers@vrfy.org> dixit:
> On 2/27/07, DervishD <udev@dervishd.net> wrote:
> >    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.

    OK, that's a GOOD starting point :)) I thought that DEVNAME was
dependent on some obscure driver internal, that some drivers exported a
DEVNAME and other didn't.

> 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.

    You're reading my mind ;)) My next question was going to be if
instead of using my program for that, I could use just a RUN rule. Right
now my script does exactly that: if a MODALIAS is present, it loads the
module. Otherwise, it looks into its config file to see if any action
must be performed for the device node (creating mount points, load
modules, whatever). My rules file to do that is:

RUN+="/usr/sbin/hal"

    My "hal" script does all the work, but thanks to your kind advice,
I'll add this rule:

$ENV{MODALIAS}="?*" RUN+="modprobe $env{MODALIAS}"

    Anything wrong with this rule?

    Thanks a lot, Kay :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

-------------------------------------------------------------------------
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=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

  parent reply	other threads:[~2007-02-27 20:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 17:23 Loading modules on demand with /sbin/hotplug DervishD
2007-02-27 17:45 ` DervishD
2007-02-27 19:16 ` Kay Sievers
2007-02-27 20:17 ` DervishD [this message]
2007-02-28 12:45 ` DervishD
2007-02-28 15:36 ` Kay Sievers
2007-02-28 19:26 ` Dan Nicholson
2007-02-28 22:02 ` DervishD
2007-02-28 22:05 ` DervishD
2007-02-28 22:20 ` Kay Sievers
2007-03-01  8:42 ` DervishD

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=20070227201701.GA16331@DervishD \
    --to=udev@dervishd.net \
    --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).