hald/linux/blockdev.c Problem with IDE drive type detection

Sledz, Steffen sledz at DResearch.DE
Wed Apr 25 03:18:25 PDT 2007


I've a problem with IDE drive type detection of hald. I've found this code in blockdev.c:

 962                         /* according to kernel source, media can assume the following values:
 963                          *
 964                          * "disk", "cdrom", "tape", "floppy", "UNKNOWN"
 965                          */
 966                         snprintf (buf, sizeof (buf), "%s/ide/%s", get_hal_proc_path (), hal_util_get_last_element (sysfs_path));
 967                         if ((media = hal_util_get_string_from_file (buf, "media")) != NULL) {
 968                                 if (strcmp (media, "disk") == 0 ||
 969                                     strcmp (media, "cdrom") == 0 ||
 970                                     strcmp (media, "floppy") == 0) {
 971                                         hal_device_property_set_string (d, "storage.drive_type", media);
 972                                 } else {
 973                                         HAL_WARNING (("Cannot determine IDE drive type from file %s/media", buf));
 974                                         goto error;
 975                                 }

This seems not to be right in all cases. I'm running linux 2.6.18.8-0.1-default (openSUSE 10.2). I've connected a Fujitsu MO-drive on /dev/hdb. This is reported as "optical" and so I get the error "Cannot determine IDE drive type from file /proc/ide/hdb/media".  :(

# cat /proc/ide/hdb/model
FUJITSU MCR3230AP-S
# cat /proc/ide/hdb/driver
ide-cdrom version 4.61
# cat /proc/ide/hdb/media
optical

Any chance to get hald work with this device?

Regards,
Steffen





More information about the hal mailing list