summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-05-14 12:57:19 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-05-14 12:57:19 +0200
commitb4fa1b67f86c9555cbb41c57774761730f6b8939 (patch)
treec131d540e2386c5055a605e069bc243bdfbfcccf /extras
parent1e5e05730a2554b0bd9fe7ca25b4f7d31907ae97 (diff)
rule-generator: cd - skip by-path links if we create by-id links
Diffstat (limited to 'extras')
-rw-r--r--extras/rule_generator/75-cd-aliases-generator.rules7
-rw-r--r--extras/rule_generator/write_cd_rules3
2 files changed, 7 insertions, 3 deletions
diff --git a/extras/rule_generator/75-cd-aliases-generator.rules b/extras/rule_generator/75-cd-aliases-generator.rules
index e357a6a8bd..e6da0101d6 100644
--- a/extras/rule_generator/75-cd-aliases-generator.rules
+++ b/extras/rule_generator/75-cd-aliases-generator.rules
@@ -1,6 +1,9 @@
# these rules generate rules for the /dev/{cdrom,dvd,...} symlinks
-# the path of removable devices changes frequently
-ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules by-id", SYMLINK+="%c"
+# the "path" of usb/ieee1394 devices changes frequently, use "id"
+ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", \
+ PROGRAM="write_cd_rules by-id", SYMLINK+="%c", GOTO="persistent_cd_end"
ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
+
+LABEL="persistent_cd_end"
diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules
index 398cd2737b..0d16fe6eff 100644
--- a/extras/rule_generator/write_cd_rules
+++ b/extras/rule_generator/write_cd_rules
@@ -97,7 +97,7 @@ choose_rules_file
link_num=$(find_next_available 'cdrom[0-9]*')
-match="ENV{ID_CDROM}==\"?*\", $RULE"
+match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE"
comment="$ID_MODEL ($ID_PATH)"
@@ -108,6 +108,7 @@ comment="$ID_MODEL ($ID_PATH)"
write_rule "$match" "dvd$link_num"
[ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ] && \
write_rule "$match" "dvdrw$link_num"
+echo >> $RULES_FILE
unlock_rules_file