hal/hald/linux2 blockdev.c,1.9,1.10
David Zeuthen
david at freedesktop.org
Fri Feb 25 14:01:16 PST 2005
Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv11139/hald/linux2
Modified Files:
blockdev.c
Log Message:
2005-02-25 David Zeuthen <davidz at redhat.com>
* hald/linux2/probing/probe-pc-floppy.c: New file; test for floppy
drive
* hald/linux2/probing/Makefile.am: Add build rules for hald-probe-
pc-floppy
* hald/linux2/blockdev.c (blockdev_callouts_preprobing_storage_done):
Do a special probe to see if the PC Floppy Drive is actually there -
since many IDE laptops got the controller chip but not the drive.
(hotplug_event_begin_add_blockdev): Learn how to spell; floppy not
floopy :-/
Index: blockdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- blockdev.c 25 Feb 2005 21:39:44 -0000 1.9
+++ blockdev.c 25 Feb 2005 22:01:14 -0000 1.10
@@ -338,9 +338,29 @@
if (!hal_device_property_get_bool (d, "storage.media_check_enabled") &&
hal_device_property_get_bool (d, "storage.no_partitions_hint")) {
- HAL_INFO (("Not probing storage device %s", hal_device_property_get_string (d, "block.device")));
- add_blockdev_probing_helper_done (d, FALSE, 0, (gpointer) end_token, NULL, NULL);
- goto out;
+
+
+ /* special probe for PC floppy drives */
+ if (strcmp (hal_device_property_get_string (d, "storage.bus"), "platform") == 0 &&
+ strcmp (hal_device_property_get_string (d, "storage.drive_type"), "floppy") == 0) {
+ HAL_INFO (("Probing PC floppy %s to see if it is present",
+ hal_device_property_get_string (d, "block.device")));
+
+ if (hal_util_helper_invoke ("hald-probe-pc-floppy", NULL, d, (gpointer) end_token,
+ NULL, add_blockdev_probing_helper_done,
+ HAL_HELPER_TIMEOUT) == NULL) {
+ hal_device_store_remove (hald_get_tdl (), d);
+ hotplug_event_end (end_token);
+ }
+ goto out;
+
+ } else {
+ HAL_INFO (("Not probing storage device %s",
+ hal_device_property_get_string (d, "block.device")));
+
+ add_blockdev_probing_helper_done (d, FALSE, 0, (gpointer) end_token, NULL, NULL);
+ goto out;
+ }
}
/* run prober for
@@ -479,7 +499,7 @@
if (floppy_num >= 0) {
/* for now, just cheat here for floppy drives */
- HAL_INFO (("doing floopy drive hack for floppy %d", floppy_num));
+ HAL_INFO (("doing floppy drive hack for floppy %d", floppy_num));
hal_device_property_set_string (d, "storage.bus", "platform");
hal_device_property_set_bool (d, "storage.no_partitions_hint", TRUE);
More information about the hal-commit
mailing list