Does not recognize partitioned floppy devices
Martin Pitt
martin.pitt at ubuntu.com
Wed May 21 23:11:21 PDT 2008
Hi all,
last night I debugged an old USB SD card reader of a colleague of mine
(in CC). Hal would see the device /dev/sdb, but not the partition on
it (/dev/sdb1, standard FAT12):
The cause is that the reader advertises itself as a floppy interface, but the
card has a partition. Hal currently assumes that floppies are
unpartitioned and that detected partitions on it are an illusion:
19:30:19.908 [I] blockdev.c:502: Probing storage device /dev/sdb
woohoo
[9279]: 19:30:19.912 [D] probe-storage.c:155: Doing probe-storage for /dev/sdb (bus usb) (drive_type floppy) (udi=/org/freedesktop/Hal/devices/temp/138) (--only-check-for-fs==0)
[9279]: 19:30:19.912 [D] probe-storage.c:407: Checking for file system on /dev/sdb
[9279]: 19:30:19.912 [D] probe-storage.c:413: Doing open ("/dev/sdb", O_RDONLY)
[9279]: 19:30:19.915 [D] probe-storage.c:421: Returned from open(2)
[9279]: 19:30:19.916 [D] probe-storage.c:437: look for existing partitions for sdb
[9279]: 19:30:19.916 [D] probe-storage.c:447: partition sdb1 found, skip probing for filesystem
[9279]: 19:30:20.110 [I] partutil.c:875: MSDOS partition table detected
[...]
19:30:20.320 [I] osspec.c:241: SEQNUM=3123, ACTION=add, SUBSYSTEM=block, DEVPATH=/sys/block/sdb/sdb1, DEVNAME=/dev/sdb1, IFINDEX=0
19:30:20.320 [I] osspec.c:966: hal_util_find_known_parent: '/sys/block/sdb/sdb1'->'/sys/block/sdb'
19:30:20.320 [I] blockdev.c:874: block_add: sysfs_path=/sys/block/sdb/sdb1 dev=/dev/sdb1 is_part=1, parent=0x080ffc40
19:30:20.320 [I] blockdev.c:976: Ignoring blockdev since not a fakevolume and parent has storage.no_partitions_hint==TRUE
19:30:20.320 [W] blockdev.c:1481: Not adding device object
For testing this I commented out hald/linux/blockdev.c, around line
1363:
if (strcmp (hal_device_property_get_string (d, "storage.drive_type"), "floppy") == 0) {
no_partitions_hint = TRUE;
}
I wondered why this suppression is done in the first place? As far as
I remember, one problem we had with this detection stuff was that
sometimes you got a volume for the raw device *and* the partition when
there ever was a fs on the raw device, but it got partitioned later.
This should be kept, of course, but here we have exactly the other
case? Did it really ever happen that a raw device had a real fs, but
probe-storage.c found a shadow of a partition table in it which was
invalid? If so, why does this only apply to CD-ROMs and Floppies, and
not to hard disks?
If this suppression is actually wrong, I see two options to fix this
kind of devices (partitioned floppies):
* Remove the quoted code from above, and keep it advertised as a
floppy.
* If we see partitions on the device, reset the floppy device type
back to 'disk'.
What do you think?
Thanks in advance!
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/hal/attachments/20080522/ce0292cb/attachment.pgp
More information about the hal
mailing list