]> err.no Git - systemd/commitdiff
update Gentoo rules
authorMatthias Schwarzott <zzam@gentoo.org>
Wed, 28 Mar 2007 18:31:19 +0000 (20:31 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 28 Mar 2007 18:31:19 +0000 (20:31 +0200)
etc/udev/gentoo/05-udev-early.rules
etc/udev/gentoo/64-device-mapper.rules [new file with mode: 0644]
etc/udev/gentoo/95-net.rules [deleted file]
etc/udev/gentoo/95-udev-late.rules [new file with mode: 0644]
etc/udev/gentoo/udev.rules

index b4d24ae21698cf0f3fc2faa12e60e545190d9620..ecf079c05765376bb26a265f69471bc416d66667 100644 (file)
@@ -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 (file)
index 0000000..1100c1b
--- /dev/null
@@ -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 (file)
index 182e873..0000000
+++ /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 (file)
index 0000000..5d7a6a8
--- /dev/null
@@ -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"
+
index 380029fb4c047311b44ee0341d0f1c561575c599..28875536a0985a333f5ba882bd9680329480c639 100644 (file)
@@ -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"