1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-17 18:12:36 +01:00
slackware-current/source/a/udev/rule_generator.diff
Patrick J Volkerding 9664bee729 Slackware 14.0
Wed Sep 26 01:10:42 UTC 2012
Slackware 14.0 x86_64 stable is released!

We're perfectionists here at Slackware, so this release has been a long
time a-brewing.  But we think you'll agree that it was worth the wait.
Slackware 14.0 combines modern components, ease of use, and flexible
configuration... our "KISS" philosophy demands it.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

Thanks to everyone who helped make this happen.  The Slackware team, the
upstream developers, and (of course) the awesome Slackware user
community.

Have fun!  :-)
2018-05-31 22:51:55 +02:00

78 lines
3.1 KiB
Diff

diff -Nur udev-182.orig/src/rule_generator/write_cd_rules udev-182/src/rule_generator/write_cd_rules
--- udev-182.orig/src/rule_generator/write_cd_rules 2012-03-24 22:47:53.138527732 -0500
+++ udev-182/src/rule_generator/write_cd_rules 2012-03-24 22:59:42.595889830 -0500
@@ -3,7 +3,8 @@
# This script is run if an optical drive lacks a rule for persistent naming.
#
# It adds symlinks for optical drives based on the device class determined
-# by cdrom_id and used ID_PATH to identify the device.
+# by cdrom_id and uses ID_PATH or ID_SERIAL or ID_MODEL and ID_REVISION to
+# identify the device.
# (C) 2006 Marco d'Itri <md@Linux.IT>
#
@@ -105,18 +106,57 @@
choose_rules_file
link_num=$(find_next_available 'cdrom[0-9]*')
+[ "$link_num" = "" ] && link_num=0
match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE"
comment="$ID_MODEL ($ID_PATH)"
-
write_rule "$match" "cdrom$link_num" "$comment"
-[ "$ID_CDROM_CD_R" -o "$ID_CDROM_CD_RW" ] && \
- write_rule "$match" "cdrw$link_num"
-[ "$ID_CDROM_DVD" ] && \
- 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"
+ if [ "$(find_all_rules 'SYMLINK+=' cdrom)" = "" ]; then
+ write_rule "$match" "cdrom"
+ fi
+
+ if [ "$ID_CDROM_CD_R" ]; then
+ write_rule "$match" "cdr$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' cdr)" = "" ]; then
+ write_rule "$match" "cdr"
+ fi
+
+ write_rule "$match" "cdwriter$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' cdwriter)" = "" ]; then
+ write_rule "$match" "cdwriter"
+ fi
+
+ if [ "$ID_CDROM_CD_RW" ]; then
+ write_rule "$match" "cdrw$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' cdrw)" = "" ]; then
+ write_rule "$match" "cdrw"
+ fi
+ fi
+
+ if [ "$(find_all_rules 'SYMLINK+=' writer)" = "" ]; then
+ write_rule "$match" "writer"
+ fi
+ fi
+
+ if [ "$ID_CDROM_DVD" ]; then
+ write_rule "$match" "dvd$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' dvd)" = "" ]; then
+ write_rule "$match" "dvd"
+ fi
+
+ if [ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ]; then
+ write_rule "$match" "dvdrw$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' dvdrw)" = "" ]; then
+ write_rule "$match" "dvdrw"
+ fi
+
+ write_rule "$match" "dvdwriter$link_num"
+ if [ "$(find_all_rules 'SYMLINK+=' dvdwriter)" = "" ]; then
+ write_rule "$match" "dvdwriter"
+ fi
+ fi
+ fi
echo >> $RULES_FILE
unlock_rules_file