Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#1864 closed enhancement (fixed)

udev-100

Reported by: Matthew Burgess Owned by: lfs-book@…
Priority: normal Milestone:
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

New version, looks like the rules could do with some updating now:

enaming of some key names (the old names still work): BUS -> SUBSYSTEMS, ID -> KERNELS, SYSFS -> ATTRS, DRIVER -> DRIVERS. (The behavior of the key DRIVER will change soon in one of the next releases, to match only the event device, please switch to DRIVERS instead. If DRIVER is used, it will behave like DRIVERS, but an error is logged.

With the new key names, we have a more consistent and simpler scheme. We can match the properties of the event device only, with: KERNEL, SUBSYSTEM, ATTR, DRIVER. Or include all the parent devices in the match, with: KERNELS, SUBSYSTEMS, ATTRS, DRIVERS. ID, BUS, SYSFS, DRIVER are no longer mentioned in the man page and should be switched in the rule files.

ATTR{file}="value" can be used now, to write to a sysfs file of the event device. Instead of:

..., SYSFS{type}=="0|7|14", RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"

we now can do:

..., ATTR{type}=="0|7|14", ATTR{timeout}="60"

All the PHYSDEV* keys are deprecated and will be removed from a future kernel:

PHYSDEVPATH - is the path of a parent device and should not be needed at all. PHYSDEVBUS - is just a SUBSYSTEM value of a parent, and can be matched with SUBSYSTEMS== PHYSDEVDRIVER - for bus devices it is available as ENV{DRIVER}. Newer kernels will have DRIVER in the environment, for older kernels udev puts in. Class device will no longer carry this property of a parent and DRIVERS== can be used to match such a parent value.

Note that ENV{DRIVER} is only available for a few bus devices, where the driver is already bound at device event time. On coldplug, the events for a lot devices are already bound to a driver, and they will have that value set. But on hotplug, at the time the kernel creates the device, it can't know what driver may claim the device after that, therefore in most cases it will be empty.

Failed events should now be re-triggered with:

udevtrigger --retry-failed.

Please switch to this command, so we keep the details of the /dev/.udev/failed/ files private to the udev tools. We may need to switch the current symlink target, cause some obviously broken tools try to scan all files in /dev including /dev/.udev/, find the links to /sys and end up stat()'ing sysfs files million times. This takes ages on slow boxes.

The udevinfo attribute walk (-a) now works with giving a device node name (-n) instead of a devpath (-p). The query now always works, also when no database file was created by udev.

The built-in /etc/passwd /etc/group parser is removed, we always depend on getpwnam() and getgrnam() now. One of the next releases will depend on fnmatch() and may use getopt_long().

Change History (5)

comment:1 by alexander@…, 18 years ago

Looks like too radical changes to me. Unfortunately, I am very busy until September 4, and thus I have no time to look at this.

So we have to postpone the upgrade.

comment:2 by Matthew Burgess, 18 years ago

Summary: udev-098udev-100

udev 100 ======== Revert persistent-storage ata-serial '_' '-' replacement.

udev 099 ======== Bugfixes.

Udevtrigger can now filter the list of devices to be triggered. Matches for subsystems or sysfs attributes can be specified.

The entries in /dev/.udev/queue and /dev/.udev/failed have changed to zero-sized files to avoid pointing to /sys and confuse broken tools which scan the /dev directory. To retry failed events, udevtrigger --retry-failed should be used now.

The rules and scripts to create udev rules for persistent network devices and optical drives are in the extras/rules_generator directory now. If you use something similar, please consider replacing your own version with this, to share the support effort. The rule_generator installs its own rules into /etc/udev/rules.d.

The cdrom_id tool installs its own rule now in /etc/udev/rules.d, cause the rule_generator depends on cdrom_id to be called in an earlier rule.

comment:3 by Matthew Burgess, 18 years ago

Bryan, what's the status on the rules currently in udev-config? I think everything's been updated now? If that's the case, would you mind closing this ticket as it's now been superceded by #1888.

comment:4 by bryan@linuxfromscratch.org, 18 years ago

Resolution: fixed
Status: newclosed

Yes, the rules are up to date (plus some: we've changed a WAIT_FOR_SYSFS rule that doesn't strictly need to be changed).

I see you've taken #1881, also -- note that somebody reported an issue with the path_id script on SAS devices today under kernel 2.6.18. There's a patch here:

http://sourceforge.net/mailarchive/forum.php?thread_id=30678237&forum_id=3157

which we should probably put into the book once we update the kernel. (Or, we could wait for Udev-102, but then we're falling behind again.)

The WAIT_FOR_SYSFS rule I mentioned above can also be removed once 2.6.18 goes in.

But anyway: this ticket is done, yes.

comment:5 by Jeremy Huntwork, 17 years ago

Milestone: 6.3

Milestone 6.3 deleted

Note: See TracTickets for help on using tickets.