From 1532b47bdf8cabc86d7e0f6d5e81342c42c48b2a Mon Sep 17 00:00:00 2001 From: Matthias Schwarzott Date: Wed, 28 Mar 2007 20:31:19 +0200 Subject: [PATCH] update Gentoo rules --- etc/udev/gentoo/05-udev-early.rules | 2 +- etc/udev/gentoo/64-device-mapper.rules | 31 ++++++++++++++++++++++++++ etc/udev/gentoo/95-net.rules | 15 ------------- etc/udev/gentoo/95-udev-late.rules | 21 +++++++++++++++++ etc/udev/gentoo/udev.rules | 20 +---------------- 5 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 etc/udev/gentoo/64-device-mapper.rules delete mode 100644 etc/udev/gentoo/95-net.rules create mode 100644 etc/udev/gentoo/95-udev-late.rules diff --git a/etc/udev/gentoo/05-udev-early.rules b/etc/udev/gentoo/05-udev-early.rules index b4d24ae21..ecf079c05 100644 --- a/etc/udev/gentoo/05-udev-early.rules +++ b/etc/udev/gentoo/05-udev-early.rules @@ -4,7 +4,7 @@ SUBSYSTEM=="module", OPTIONS="ignore_device" # sysfs is populated after the event is sent ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" -ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt" +ACTION=="add", KERNEL=="[0-9]*:[0-9]*", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt" ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" ACTION=="add", SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" diff --git a/etc/udev/gentoo/64-device-mapper.rules b/etc/udev/gentoo/64-device-mapper.rules new file mode 100644 index 000000000..1100c1b7b --- /dev/null +++ b/etc/udev/gentoo/64-device-mapper.rules @@ -0,0 +1,31 @@ +# device mapper links hook into "change" events, when the dm table +# becomes available; some table-types must be ignored + +KERNEL=="device-mapper", NAME="mapper/control" + +KERNEL=="dm-*", ACTION=="add|change", GOTO="device_mapper_do" +GOTO="device_mapper_end" +LABEL="device_mapper_do" + +# lookup device name +# use dmsetup, until devmap_name is provided by sys-fs/device-mapper +PROGRAM=="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info", + ENV{ID_DM_NAME}="%c" + +# do not do anything if dmsetup does not provide a name +ENV{ID_DM_NAME}=="", NAME="", OPTIONS="ignore_device" + +# ignore luks crypt devices while not fully up +ENV{ID_DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device" + +# use queried name +ENV{ID_DM_NAME}=="?*", NAME="mapper/$env{ID_DM_NAME}" + +PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end" +RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end" + +IMPORT{program}="vol_id --export $tempnode" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}", OPTIONS="link_priority=50" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}", OPTIONS="link_priority=50" + +LABEL="device_mapper_end" diff --git a/etc/udev/gentoo/95-net.rules b/etc/udev/gentoo/95-net.rules deleted file mode 100644 index 182e8738f..000000000 --- a/etc/udev/gentoo/95-net.rules +++ /dev/null @@ -1,15 +0,0 @@ -# /etc/udev/rules/95-net.rules: device naming rules for udev -# -# Gentoo specific rules -# -# There are a number of modifiers that are allowed to be used in some of the -# fields. See the udev man page for a full description of them. -# -# Try not to modify this file, if you wish to change things, create a new rule -# file that can be run before this one. -# - -# Activate our network if we can -SUBSYSTEM=="net", ACTION=="add", RUN+="net.sh %k start", OPTIONS="last_rule" -SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop", OPTIONS="last_rule" - diff --git a/etc/udev/gentoo/95-udev-late.rules b/etc/udev/gentoo/95-udev-late.rules new file mode 100644 index 000000000..5d7a6a8a4 --- /dev/null +++ b/etc/udev/gentoo/95-udev-late.rules @@ -0,0 +1,21 @@ +# /etc/udev/rules/95-udev-late.rules: device naming rules for udev +# +# Gentoo specific rules +# +# There are a number of modifiers that are allowed to be used in some of the +# fields. See the udev man page for a full description of them. +# +# Try not to modify this file, if you wish to change things, create a new rule +# file that can be run before this one. +# + +# Activate our network if we can +SUBSYSTEM=="net", ACTION=="add", RUN+="net.sh %k start" +SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop" + +# debug events to /events, but not on default udev_log="err" +ENV{UDEV_LOG}=="[4-9]", RUN+="eventrecorder.sh" + +# event to be catched by udevmonitor +RUN+="socket:/org/kernel/udev/monitor" + diff --git a/etc/udev/gentoo/udev.rules b/etc/udev/gentoo/udev.rules index 380029fb4..28875536a 100644 --- a/etc/udev/gentoo/udev.rules +++ b/etc/udev/gentoo/udev.rules @@ -78,14 +78,6 @@ KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" KERNEL=="microcode", NAME="cpu/microcode" -# dm devices -# lookup device name and create device in /dev/mapper -# use dmsetup, until devmap_name is provided by sys-fs/device-mapper -ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="dm-*", \ - PROGRAM="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info", \ - NAME="mapper/%c" -KERNEL=="device-mapper", NAME="mapper/control" - # fb devices KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" @@ -101,7 +93,7 @@ KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k" KERNEL=="mice", NAME="input/%k", MODE="0644" KERNEL=="mouse*", NAME="input/%k", MODE="0644" KERNEL=="event*", NAME="input/%k", MODE="0600" -KERNEL=="js*", NAME="input/%k", MODE="664" +KERNEL=="js*", NAME="input/%k", MODE="0664" KERNEL=="ts*", NAME="input/%k", MODE="0600" # loop devices @@ -308,13 +300,3 @@ SUBSYSTEM=="firmware", RUN+="firmware.sh" LABEL="hotplug_no_add_event" LABEL="gentoo_device_rules_end" - -# be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems -# run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart -#ENV{UDEVD_EVENT}=="1", RUN+="udev_run_hotplugd $env{SUBSYSTEM}" - -# always run /etc/dev.d/ stuff for now. -RUN+="udev_run_devd $env{SUBSYSTEM}" - -# debugging monitor -RUN+="socket:/org/kernel/udev/monitor" -- 2.30.2