[arch-general] [arch-dev-public] [signoff] udev-174-1

clemens fischer ino-news at spotteswoode.dnsalias.org
Tue Oct 25 14:54:00 EDT 2011


Tom Gundersen wrote:

> On Tue, Oct 25, 2011 at 2:56 PM, clemens fischer <...> wrote:
>
>> My system broke with udev-174-1.  I have rules renaming eth*
>> according to their MACs for consistency, guarding against dependency
>> on order-of-detection, plus rules to customize a wlan running on an
>> USB device.  These rules didn't run.
>
> Could you have a look in your logs (dmesg in particular) for any
> messages? Make sure that logging is turned on in /etc/udev.conf. If a
> rule does not work, a warning/error should be printed to dmesg.

Nothing wrong with any rules (sigh).

>> Basically, there is one rule file[1] calling out to a number of local
>> "simple" rules.  These in turn are very short, containing only
>> (LOCAL_) "RUN"/"NAME" commands.  The main rule assembles a name out
>> of subsystem, addresses, interfaces etc.  This name points into
>> a separate directory "/etc/udev-local" where the appropriate one- or
>> two liners live, and there's a logging rule telling me what file
>> names to use if there's anything missing.  All this is less complex
>> than eg. udisks and relies only on udevd.
>
> I can't see what is wrong off-hand, so please file a bug report about
> this so it is not forgotten. (I didn't figure out how your rules are
> supposed to work, so there might be something obvious that
> I missed...).

Example:

    # /etc/udev-local/99-local-simple-net-00:11:22:33:44:55-add
    # _date: 20091003-2228_
    LOCAL_NAME=nicX
    LOCAL_OPT_last_rule=yes

My rule file sees an "add" event for the "net" device with MAC
"00:11:22:33:44:55" and calls up the short thing above.

Another one:

    # /etc/udev-local/99-local-simple-net-00:1f:1f:55:99:33-add
    # _date: 20100520-0032_
    #
    #LOCAL_RUN="/bin/sh -c '{ /usr/bin/env; echo 00-done; } >> /tmp/netif.txt'"
    LOCAL_RUN="/root/bin/wlan-dev.sh add"

The script wlan-dev.sh does the setup for an adhoc wlan (that USB thing
cannot be used as a WPA2 AP).

-or-

    # /etc/udev-local/99-local-simple-block-partition-vfat-7000-F3A3-add
    # _date: 20100104-1948_
    LOCAL_RUN=/bin/mount -t vfat -o defaults,nodev,noexec /dev/disk/by-uuid/7000-F3A3 /home/ino/Desktop/usb-stick-7000-F3A3

    # /etc/udev-local/99-local-simple-block-partition-vfat-7000-F3A3-remove
    # _date: 20100104-1950_
    LOCAL_RUN=/bin/umount -v /home/ino/Desktop/usb-stick-7000-F3A3

As mentioned, no dependencies other than udevd(8) to get all sorts of
automatix without ever touching udev-rules.  This was way easier to
setup and use then any of the chubby gimmix like ifplugd(8), udisks(1)
etc.

Of course the magic lies in the file names in etc/udev-local/, so the
main rule file gives a warning mentioning the precise file name it
cooked up to find it.

>> Are rules in /etc/udev ever called in the new version?
>
> Yes, /etc/udev/rules.d/ are called and take precedence over
> /lib/udev/rules.d/ as always.

Stupid me, the udev log tells whenever any rule files are touched, so
I could have seen this myself.


clemens



More information about the arch-general mailing list