summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2009-09-20 19:07:51 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2009-09-20 19:07:51 +0200
commitce096702ec01b12ca8af9b4c19f4bb5a83c787a1 (patch)
treebb99fea8049d85898856bebd9680a4ca30ca7eca /rules
parent4dd9057209a09c523c04abe04a2540768e6b9d4e (diff)
fix single-session CD detection
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
Diffstat (limited to 'rules')
-rw-r--r--rules/rules.d/60-persistent-storage.rules4
1 files changed, 3 insertions, 1 deletions
diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 64e9578904..1b85156cc0 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -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
-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"