linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I knew how to do this once...
@ 2006-02-16  5:30 clemens
  2006-02-17  3:42 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: clemens @ 2006-02-16  5:30 UTC (permalink / raw)
  To: linux-hotplug

How do you set up a rule, so that a module gets loaded
whenever (or rather the first time) a file gets accessed.

In this case it is /dev/ttyS0

Also, If I need to load two modules, in a specific order,
does referencing one in a rule cause the other to be loaded,
or do I have to do some magic in the modprobe rules.
-- 
                                        Reg.Clemens
                                        reg@dwf.com




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I knew how to do this once...
  2006-02-16  5:30 I knew how to do this once clemens
@ 2006-02-17  3:42 ` Greg KH
  2006-02-17 19:47 ` Reg Clemens
  2006-02-17 22:09 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-02-17  3:42 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Feb 15, 2006 at 10:30:29PM -0700, clemens@dwf.com wrote:
> How do you set up a rule, so that a module gets loaded
> whenever (or rather the first time) a file gets accessed.
> 
> In this case it is /dev/ttyS0

Do you have CONFIG_KMOD enabled in your kernel?  You also need to have
the /dev/ttyS0 (or whatever) device node created already when you do
this.  udev will not automatically load the module if you try to open a
device node that isn't present (see the udev FAQ for why.)

> Also, If I need to load two modules, in a specific order,
> does referencing one in a rule cause the other to be loaded,
> or do I have to do some magic in the modprobe rules.

Is one module dependant on the other one?  If so, modprobe will handle
it automatically.  Otherwise, just put it in the file that your distro
uses to load modules at boot time, in the order you want it to be
loaded.

Hope this helps,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I knew how to do this once...
  2006-02-16  5:30 I knew how to do this once clemens
  2006-02-17  3:42 ` Greg KH
@ 2006-02-17 19:47 ` Reg Clemens
  2006-02-17 22:09 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Reg Clemens @ 2006-02-17 19:47 UTC (permalink / raw)
  To: linux-hotplug

OK, sorry to bother you again, but perhaps you can fill me in on this.
> 
> Is one module dependant on the other one?  If so, modprobe will handle
> it automatically.  Otherwise, just put it in the file that your distro
> uses to load modules at boot time, in the order you want it to be
> loaded.
>
OK, excuse me if this seems like a dumb question, but I am not familiar
with whats included in a kernel module.  If I have the source is there
some line to look for that tells the kernel that this guy is dependant on 
another module?  Or vice versa?

Ditto, is there something there that tells the kernel that this 
should be loaded when /dev/ttyS0 is touched?  From what you say
Ill assume so, but what is it so I can check to see if its there
or not.

I understand how to do this using modprobe rules at boot time,
its just getting it to work auto-magically that I am questioning.
 
-- 
                                        Reg.Clemens
                                        reg@dwf.com



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I knew how to do this once...
  2006-02-16  5:30 I knew how to do this once clemens
  2006-02-17  3:42 ` Greg KH
  2006-02-17 19:47 ` Reg Clemens
@ 2006-02-17 22:09 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-02-17 22:09 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Feb 17, 2006 at 12:47:38PM -0700, Reg Clemens wrote:
> OK, sorry to bother you again, but perhaps you can fill me in on this.
> > 
> > Is one module dependant on the other one?  If so, modprobe will handle
> > it automatically.  Otherwise, just put it in the file that your distro
> > uses to load modules at boot time, in the order you want it to be
> > loaded.
> >
> OK, excuse me if this seems like a dumb question, but I am not familiar
> with whats included in a kernel module.  If I have the source is there
> some line to look for that tells the kernel that this guy is dependant on 
> another module?  Or vice versa?

modprobe -n -v module_name
will show you what modules will be loaded in what order so that any
dependancies in "module_name" are handled properly.

> Ditto, is there something there that tells the kernel that this 
> should be loaded when /dev/ttyS0 is touched?  From what you say
> Ill assume so, but what is it so I can check to see if its there
> or not.

Yes, look for the MODULE_ALIAS_CHARDEV_MAJOR() macro.

But please realize, that's the "old style" way of loading modules, and
is not recommended.  It's because the major:minor does not describe a
driver properly anymore, with the different types of serial, usb, and
other drivers.

Hope this helps,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-17 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16  5:30 I knew how to do this once clemens
2006-02-17  3:42 ` Greg KH
2006-02-17 19:47 ` Reg Clemens
2006-02-17 22:09 ` Greg KH

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