little fstype detection problems

Sjoerd Simons sjoerd at luon.net
Sat Aug 21 07:39:52 PDT 2004


Hi,
  
  With hal 0.2.97 my root partition was suddenly detected as msdos partition
  map. After some research it looks like there is an empty dos part. map on it
  and ofcourse an ext3 filesystem. The following shows the part. map

  #  head -c 512 /dev/sda1| od -A x -t x1 |  tail -n 4 
  0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  *
  0001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
  000200
  
  Easily fixed ofcourse by placing the dos part. map probe at the end
  (hal-misdetect.patch).

  Having fixed this the volume.fstype property in h-d-m showed unknown. Which
  was caused by my mtab:

  $ head -n /etc/mtab
  /dev/sda1 / unknown rw,errors=remount-ro 0 0
 
  Hal uses the fs type here to override the probed one. Fixed by not overriding
  when fstype == unknown (hal-unknownfs.patch). But maybe it's better to trust
  the probed version and not override at all ?

  Sjoerd
-- 
You can't cheat the phone company.
-------------- next part --------------
Index: hald/linux/volume_id/volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.24
diff -u -r1.24 volume_id.c
--- hald/linux/volume_id/volume_id.c	20 Aug 2004 14:41:47 -0000	1.24
+++ hald/linux/volume_id/volume_id.c	21 Aug 2004 13:35:03 -0000
@@ -1719,10 +1719,6 @@
 		rc = probe_vfat(id, off);
 		if (rc == 0)
 			break;
-		rc = probe_msdos_part_table(id, off);
-		if (rc == 0)
-			break;
-
 		/* fill buffer with maximum */
 		get_buffer(id, 0, SB_BUFFER_SIZE);
 
@@ -1759,6 +1755,9 @@
 		rc = probe_ufs(id, off);
 		if (rc == 0)
 			break;
+		rc = probe_msdos_part_table(id, off);
+		if (rc == 0)
+			break;
 		rc = -1;
 	}
 
-------------- next part --------------
Index: hald/linux/block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.56
diff -u -r1.56 block_class_device.c
--- hald/linux/block_class_device.c	19 Aug 2004 17:58:15 -0000	1.56
+++ hald/linux/block_class_device.c	21 Aug 2004 13:34:08 -0000
@@ -1951,8 +1951,9 @@
 			hal_device_property_set_string (d,
 							"volume.mount_point",
 							mp->mount_point);
-			hal_device_property_set_string (d, "volume.fstype",
-							mp->fs_type);
+			if (strcmp("unknown", mp->fs_type)) {
+				hal_device_property_set_string (d, "volume.fstype", mp->fs_type);
+			}
 			hal_device_property_set_bool (d,
 						      "volume.is_mounted",
 						      TRUE);
-------------- next part --------------
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list