From ce096702ec01b12ca8af9b4c19f4bb5a83c787a1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 20 Sep 2009 19:07:51 +0200 Subject: [PATCH] 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 --- rules/rules.d/60-persistent-storage.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules index 64e95789..1b85156c 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" -- 2.39.5