chiark / gitweb /
fix single-session CD detection
authorMartin Pitt <martin.pitt@ubuntu.com>
Sun, 20 Sep 2009 17:07:51 +0000 (19:07 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sun, 20 Sep 2009 17:07:51 +0000 (19:07 +0200)
ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single
session (i. e. for the vast majority of CDs out there). The previous rules ran
blkid with invalid arguments for these, causing CD detection to fail in
DK-disks and gvfs.

Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if
not, call blkid without -O for specifying the offset.

Many thanks to Maxim Levitsky for tracking this down!

https://launchpad.net/bugs/431055

rules/rules.d/60-persistent-storage.rules

index 64e9578904f00286eba78c166d39360bcbbd2c8e..1b85156cc06e48d8412ffffde1cdd2c871b06cbb 100644 (file)
@@ -61,7 +61,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA
 ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
 
 # probe filesystem metadata of optical drives which have a media inserted
 ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
 
 # probe filesystem metadata of optical drives which have a media inserted
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
 
 # probe filesystem metadata of disks
 KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
 
 # probe filesystem metadata of disks
 KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"