Comment 30 for bug 36274

Revision history for this message
In , Martin Pitt (pitti) wrote :

OK, I think I have an idea about what goes wrong now:

* The kernel creates /sys/block/sr0, which is the block device for the USB CD-ROM.

* ./hald/linux2/hotplug.c, around line 285:

   is_partition = isdigit(hotplug_event->sysfs.sysfs_path[len - 1]) ||
      strstr (hotplug_event->sysfs.sysfs_path, "/fakevolume") ;

  hal assumes that devices ending with a number are partitions on a block
device, which is not the case for SCSI CD-ROMs (i.e. it's not
/sys/block/sra/sra0, SCSI CD-ROMs are enumerated with numbers, not with letters
as ATAPI devices are). Thus is_partition becomes true.

    if (is_partition) {
       gchar *parent_path;
       parent_path = hal_util_get_parent_path (hotplug_event->sysfs.sysfs_path);

sysfs.sysfs_path is /sys/block/sr0, thus parent_path is /sys/block, which is of
course not a device.

       parent = hal_device_store_match_key_value_string (hald_get_gdl (),

"linux.sysfs_path_device", parent_path);

parent becomes NULL here, which is then directly passed to
hotplug_event_begin_add_blockdev(), which throws the event away.