I knew how to do this once...
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.
Signature · 15 lines
Reg.Clemens
[email protected]
-------------------------------------------------------
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&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-develQuoted 4 lines · On Wed, Feb 15, 2006 at 10:30:29PM -0700, [email protected] 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.)
Quoted 3 lines
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&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
OK, sorry to bother you again, but perhaps you can fill me in on this.
Quoted 6 lines
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.
Signature · 14 lines
Reg.Clemens
[email protected]
-------------------------------------------------------
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&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-develQuoted 11 lines · Reg Clemens
OK, sorry to bother you again, but perhaps you can fill me in on this.
Quoted 6 lines
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.
Quoted 4 lines
Ditto, is there something there that tells the kernel that this should be loaded when
/dev/ttyS0is 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&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel