slackware-current/source/a/eudev/60-cdrom_id.rules.diff

31 lines
2 KiB
Diff
Raw Normal View History

diff -rNaud eudev-3.1.old/rules/60-cdrom_id.rules eudev-3.1/rules/60-cdrom_id.rules
--- eudev-3.1.old/rules/60-cdrom_id.rules 2015-03-19 22:57:28.000000000 +0100
+++ eudev-3.1/rules/60-cdrom_id.rules 2015-10-24 12:36:13.350966101 +0200
@@ -20,6 +20,25 @@
# stale mounts after ejecting
ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"
-KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+# create default links to the first detected device
+KERNEL=="sr0", ENV{ID_CDROM}=="1", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdr", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdwriter", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdr", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdwriter", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw", OPTIONS+="link_priority=-100"
+
+# create all other device links
+KERNEL=="sr[0-9]*", ENV{ID_CDROM}=="1", SYMLINK+="cdrom%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdr%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdwriter%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdr%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdwriter%n", OPTIONS+="link_priority=-100"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw%n", OPTIONS+="link_priority=-100"
+
LABEL="cdrom_end"