Several udev questions
Hello
I installed latest udev (091). It works nice, loading of all needed modules took ~8 sec (old hotplug system took ~30 sec, udev 056 ~18 sec, without any hotplug mechanism ~3 sec) and i have several questions and notes:
1) When i start system, i mount /dev, started udevd and udevtrigger. I don't explicitly copy (from /lib/udev/devices) or create any device nodes. It looks like all needed nodes are created in this way, although documentation (README) suggests copying some nodes before udevd start. What is the correct way - is the documentation obsolete, or am i miss something important?
2) What is recommended time of start of udevd? I think it should be started early during boot process (i run it just after remounting root to rw) to create all needed devices. But if i want to do logging, i have to start syslogd before ulogd. But it is usually expected to run syslogd more late, especially after mounting of other filesystems from fstab (in case of /var on separate partition).
Maybe there should be something like kernel's dmesg buffer to store ulogd messages generated before start of syslog.
3) When i insert CF (and other) media with partition table, there is no hotplug event (for new partitions). I found some hacks like adding all possible partitions for that devices. Is the correct solution for this problem that kernel should send hotplug events in that case?
3) example configuration in /etc/udev/slackware has KERNEL= instead of KERNEL==
4) MODE=644 for event devices (in /etc/udev/frugalware/udev.rules) is pretty crazy.
5) What is a good place to load useful, subsytem specific but not dependent modules like sd_mod for SCSI disks, lp for parport devices, snd_pcm_oss for soundcards?
- in /etc/modules or something similar?
disadvantage - not very hot-plug.
- In module-init-tools (modprobe) configuration as install rule? disadvantage - as there is no concept of subsystem membership so there have to be one rule for one specific hardware driver, not one for class of drivers.
- in udev.rules file?
I am not in mailing list so please cc me.
Signature · 5 lines
Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: [email protected], jabber: [email protected]) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Quoted 6 lines · Ondrej Zajicek
1) When i start system, i mount /dev, started udevd and udevtrigger. I don't explicitly copy (from
/lib/udev/devices) or create any device nodes. It looks like all needed nodes are created in this way, although documentation (README) suggests copying some nodes before udevd start. What is the correct way - is the documentation obsolete, or am i miss something important?
/dev/null is needed by udevd itself, it will not fail but should be around. Depending on the init scripts and what stuff you call from udev rules, you may want more nodes directories and symlinks.
Quoted 6 lines
2) What is recommended time of start of udevd? I think it should be started early during boot process (i run it just after remounting root to rw) to create all needed devices. But if i want to do logging, i have to start syslogd before ulogd. But it is usually expected to run syslogd more late, especially after mounting of other filesystems from fstab (in case of /var on separate partition).
As you want device nodes for all other stuff, you need to start it as early as possible. For now, it just logs to the console, if syslog is not available.
Quoted 2 lines
Maybe there should be something like kernel's dmesg buffer to store ulogd messages generated before start of syslog.
You could change udev to write to /dev/kmsg and see it in dmesg. I think the klibc build is doing this.
Quoted 4 lines
3) When i insert CF (and other) media with partition table, there is no hotplug event (for new partitions). I found some hacks like adding all possible partitions for that devices. Is the correct solution for this problem that kernel should send hotplug events in that case?
You need to open() the device something like every 2 seconds, to let the kernel read the device state and discover media changes, then it will send you the events. It's up to userspace to poll, like we do with HAL, at least on all recent Desktop systems.
Quoted 5 lines
3) example configuration in
/etc/udev/slackwarehas KERNEL= instead of KERNEL=4) MODEd4 for event devices (in
/etc/udev/frugalware/udev.rules) is pretty crazy.
It's up to the distro guys to send updated example rules, I don't have these distros around and therefore can't update it.
Quoted 6 lines
5) What is a good place to load useful, subsytem specific but not dependent modules like
sd_modfor SCSI disks, lp for parport devices,snd_pcm_ossfor soundcards?- in
/etc/modulesor something similar?
disadvantage - not very hot-plug.
I think it's fine, to load all module that are needed but don't autoload, there are only very few left these days.
Quoted 4 lines
- In module-init-tools (modprobe) configuration as install rule? disadvantage - as there is no concept of subsystem membership so there have to be one rule for one specific hardware driver, not one for class of drivers.
Hmm, you probably don't want to list all modules that create a device that can also be used with a second module.
Quoted 1 line
- in udev.rules file?
We already do something like this:
SUBSYSTEM="scsi_device", ACTION="add", SYSFS{type}="0|7|14", RUN+="/sbin/modprobe sd_mod"
You could also try to add MODALIAS strings to the kernel scsi device and match strings to the modules, than they would get autoloaded the usual way.
Kay
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 8 lines · Kay Sievers
Quoted 2 lines · Ondrej Zajicek
Maybe there should be something like kernel's dmesg buffer to store ulogd messages generated before start of syslog.
You could change udev to write to
/dev/kmsgand see it in dmesg. I think the klibc build is doing this.
RedHat initscripts has initlog that buffers syslog messages and flushes them to syslog after the latter was started. Recent updates declared initlog deprecated, but I do not know exact reasons nor what is a suggested replacement. Anyway initlog should still be available.
- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFEafjBR6LMutpd94wRAheuAKC6j5WqPwse8XDCgWQSjejIkPWJbQCfYPHQ pTRDkvayyWly4Rcz6vAJOMs=gndn
-----END PGP SIGNATURE-----
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
I demand that Kay Sievers may or may not have written...
[snip]
Quoted 1 line
I think it's fine, to load all module that are needed but don't autoload,
Wait a minute. You're developing udev, which auto-loads modules, but you're saying that it's fine to load them but not to auto-load them?
(ITYM "but aren't auto-loaded".)
[snip]
Signature · 16 lines
| Darren Salt | linux or ds at | nr. Ashington, | Toon | RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army | + Burn less waste. Use less packaging. Waste less. USE FEWER RESOURCES. It is a wise father that knows his own child. ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel