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

clemens fischer ino-news at spotteswoode.dnsalias.org
Tue Oct 25 08:56:12 EDT 2011


'uname -rms' -> "Linux 3.0.7-spott x86_64"

On Thu-2011/10/20-09:41 Myra Nelson wrote:

> Error messages yes, but no warning about problems with the image and
> the image is created and boots fine. Keeping up with the mailing list
> makes all the difference in the world.

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.

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.  Are rules in /etc/udev ever called in the new version?
Do I need some compatibility to make this happen?

I didn't have the old udev package to downgrade to, but a backup from
where the old binaries and lib/udev stuff could be restored.  Otherwise
I couldn't even post this.


clemens


[1] /etc/udev/rules.d/99-local-simple.rules

# /root/udev-rules/99-local-simple.rules
# == /etc/udev/rules.d/99-local-simple.rules
# _date: 20091002-1615_
# see <url:man:7 udev>

ENV{iam} = "99-local-simple"
ENV{LOCAL_LOGG} = "/usr/bin/logger -p daemon.info --"

ACTION == "add", ENV{.cmd} = "add", GOTO = "local_simple_check_subsys"
ACTION == "change", ENV{.cmd} = "change", GOTO = "local_simple_check_subsys"
ACTION == "remove", ENV{.cmd} = "remove", GOTO = "local_simple_check_subsys"
GOTO = "local_simple_end"
LABEL = "local_simple_check_subsys"
SUBSYSTEM == "block", ENV{DEVTYPE} == "partition", GOTO = "local_collect_disk_args"
SUBSYSTEM == "bluetooth", ENV{.subsystem} = "bluetooth", GOTO = "local_collect_if_args"
SUBSYSTEM == "net", ENV{.subsystem} = "net", GOTO = "local_collect_if_args"
SUBSYSTEM == "rfkill", ENV{.subsystem} = "rfkill", GOTO = "local_collect_if_args"
GOTO = "local_simple_end"

LABEL = "local_collect_disk_args"
# should anybody have setup site specific values, get them
IMPORT{parent} = "SPOTT_*"
#IMPORT{parent} = "PCI_*"
#IMPORT{parent} = "HID_*"
IMPORT{parent} = "ID_*"
ENV{.devtype} = "partition"
ENV{.subsystem} = "block"
ENV{ID_FS_TYPE} == "", ENV{LOCAL_EX} = "no filesystem", GOTO = "local_simple_exerr"
ENV{ID_FS_UUID} == "", ENV{ID_FS_LABEL} == "", ENV{LOCAL_EX} = "neither label nor uuid", GOTO = "local_simple_exerr"
ENV{ID_FS_UUID} == "?*", ENV{.fs} = "$env{ID_FS_TYPE}-$env{ID_FS_UUID}"
ENV{ID_FS_LABEL} == "?*", ENV{.fs} = "$env{ID_FS_TYPE}-$env{ID_FS_LABEL}"
ENV{.devid} = "$env{.devtype}-$env{.fs}"
ENV{LOCAL_EX} = "$env{.cmd} $env{.subsystem} $env{.devid}"
ENV{LOCAL_LOGG} == "?*", RUN += "$env{LOCAL_LOGG} $env{iam}: msg: $env{LOCAL_EX}"
GOTO = "local_get_controls"

LABEL = "local_collect_if_args"
# should anybody have setup site specific values, get them
IMPORT{parent} = "SPOTT_*"
#IMPORT{parent} = "PCI_*"
#IMPORT{parent} = "HID_*"
IMPORT{parent} = "ID_*"
ENV{.devtype} = "unknown"
ATTR{address} == "?*", ENV{.devtype} = "$attr{address}"
ENV{.devtype} == "unknown", ATTR{name} == "?*", ENV{.devtype} = "$attr{name}"
#ENV{.devtype} == "unknown", ENV{PRODUCT} == "?*", ENV{.devtype} = "$env{PRODUCT}"
ENV{.devtype} == "unknown", ENV{.devtype} = "$kernel"
ENV{.devid} = "$env{.devtype}"
ENV{LOCAL_EX} = "$env{.cmd} $env{.subsystem} $env{.devid}"
ENV{LOCAL_LOGG} == "?*", RUN += "$env{LOCAL_LOGG} $env{iam}: msg: $env{LOCAL_EX}"
#GOTO = "local_get_controls"

LABEL = "local_get_controls"
# to make all this configurable, either an external program or the
# "test-trick" is necessary, because the "==" operator can only match on
# literals!
ENV{LOCAL_DEV} = "/etc/udev-local/$env{iam}-$env{.subsystem}-$env{.devid}-$env{.cmd}"
TEST != "$env{LOCAL_DEV}", ENV{LOCAL_EX} = "no $env{LOCAL_DEV}", GOTO = "local_simple_exerr"
IMPORT = "$env{LOCAL_DEV}"
ENV{LOCAL_LOGG} == "?*", RUN += "$env{LOCAL_LOGG} LOCAL_DEV:$env{LOCAL_DEV} LOCAL_RUN:$env{LOCAL_RUN}"
ENV{LOCAL_OPT_last_rule} == "?*", GOTO = "local_simple_lastrule"
ENV{LOCAL_GROUP} == "?*", GROUP = "$env{LOCAL_GROUP}"
ENV{LOCAL_MODE} == "?*", MODE = "$env{LOCAL_MODE}"
ENV{LOCAL_NAME} == "?*", NAME = "$env{LOCAL_NAME}"
ENV{LOCAL_OWNER} == "?*", OWNER = "$env{LOCAL_OWNER}"
ENV{LOCAL_PROGRAM} == "?*", PROGRAM = "$env{LOCAL_PROGRAM}", ENV{.result} = "%c"
ENV{LOCAL_LOGG} == "?*", ENV{.result} == "?*", RUN += "$env{LOCAL_LOGG} LOCAL_DEV:$env{LOCAL_DEV} RESULT:$env{.result}"
ENV{LOCAL_RUN} == "?*", RUN += "$env{LOCAL_RUN}"
ENV{LOCAL_SYMLINK} == "?*", SYMLINK += "$env{LOCAL_SYMLINK}"
GOTO = "local_simple_end"

LABEL = "local_simple_lastrule"
ENV{LOCAL_GROUP} == "?*", GROUP = "$env{LOCAL_GROUP}", OPTIONS="last_rule"
ENV{LOCAL_MODE} == "?*", MODE = "$env{LOCAL_MODE}", OPTIONS="last_rule"
ENV{LOCAL_NAME} == "?*", NAME = "$env{LOCAL_NAME}", OPTIONS="last_rule"
ENV{LOCAL_OWNER} == "?*", OWNER = "$env{LOCAL_OWNER}", OPTIONS="last_rule"
ENV{LOCAL_PROGRAM} == "?*", PROGRAM = "$env{LOCAL_PROGRAM}", ENV{.result} = "%c"
ENV{LOCAL_LOGG} == "?*", ENV{.result} == "?*", RUN += "$env{LOCAL_LOGG} LOCAL_DEV:$env{LOCAL_DEV} RESULT:$env{.result}"
ENV{LOCAL_RUN} == "?*", RUN += "$env{LOCAL_RUN}", OPTIONS="last_rule"
ENV{LOCAL_SYMLINK} == "?*", SYMLINK += "$env{LOCAL_SYMLINK}"
GOTO = "local_simple_end"

# error checking
LABEL = "local_simple_exerr"
ENV{LOCAL_LOGG} == "?*", RUN += "$env{LOCAL_LOGG} $env{iam}: error: $env{LOCAL_EX}"

LABEL="local_simple_end"



More information about the arch-general mailing list