SOURCES: udev-vol_id-cdrom.patch (NEW) - fixed cdrom tray close bug

charles charles at pld-linux.org
Thu Mar 12 21:59:55 CET 2009


Author: charles                      Date: Thu Mar 12 20:59:55 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fixed cdrom tray close bug

---- Files affected:
SOURCES:
   udev-vol_id-cdrom.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/udev-vol_id-cdrom.patch
diff -u /dev/null SOURCES/udev-vol_id-cdrom.patch:1.1
--- /dev/null	Thu Mar 12 21:59:55 2009
+++ SOURCES/udev-vol_id-cdrom.patch	Thu Mar 12 21:59:49 2009
@@ -0,0 +1,18 @@
+Opening an optical drive device node without O_NONBLOCK autocloses the
+tray, we run vol_id on every media change by kernel emitted "change"
+events, which can make it hard to change the media when the tray closes
+immediatey again.:) We check for cdrom_id to indicate an existing track,
+if no media is found, we will not open the device with vol_id.
+
+--- udev-124/etc/udev/rules.d/60-persistent-storage.rules.orig	2008-06-12 07:24:30.000000000 +0200
++++ udev-124/etc/udev/rules.d/60-persistent-storage.rules	2009-03-12 21:49:35.000000000 +0100
+@@ -53,6 +53,9 @@
+ # skip unpartitioned removable media devices from drivers which do not send "change" events
+ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
+ 
++# skip optical drives without media
++ENV{DEVTYPE}=="disk", KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="persistent_storage_end"
++
+ # import filesystem metadata
+ IMPORT{program}="vol_id --export $tempnode"
+ 
================================================================


More information about the pld-cvs-commit mailing list