chiark / gitweb /
rules_generator: remove policy from write_cd_rules
authorMarco d'Itri <md@Linux.IT>
Tue, 7 Aug 2007 08:37:58 +0000 (10:37 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 7 Aug 2007 08:37:58 +0000 (10:37 +0200)
The decision about when to create by-id or by-path persistent rules should
be made in the generator rules file where it's obvious and easy to modify
locally, not in the script.

extras/rule_generator/75-cd-aliases-generator.rules
extras/rule_generator/write_cd_rules

index c3eb887cb58d6ca903c396d15b9d0998f2d95cb3..e357a6a8bd7d5b73508afe3892a2219771ee5805 100644 (file)
@@ -1,3 +1,6 @@
 # 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"
+
 ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
index bd951c51464615aef62bbf0654576d1b6247ba42..1dbe6b70dea1a033fd32dc3c26643ae14d991775 100644 (file)
@@ -53,15 +53,7 @@ fi
 if [ "$1" ]; then
        METHOD="$1"
 else
-       case "$ID_BUS" in
-               usb|ieee1394)
-               METHOD='by-id'
-               ;;
-
-               *)
-               METHOD='by-path'
-               ;;
-       esac
+       METHOD='by-path'
 fi
 
 case "$METHOD" in