rpms/DeviceKit-disks/devel 0001-properly-detect-devices-with-vfat-on-the-whole-disk.patch, NONE, 1.1 DeviceKit-disks.spec, 1.22, 1.23

David Zeuthen davidz at fedoraproject.org
Thu Apr 16 17:10:25 UTC 2009


Author: davidz

Update of /cvs/pkgs/rpms/DeviceKit-disks/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5060

Modified Files:
	DeviceKit-disks.spec 
Added Files:
	0001-properly-detect-devices-with-vfat-on-the-whole-disk.patch 
Log Message:
* Thu Apr 16 2009 David Zeuthen <davidz at redhat.com> - 004-0.10.20090415git%{?dist}
- Properly detect vfat on whole disk devices (#495876)



0001-properly-detect-devices-with-vfat-on-the-whole-disk.patch:

--- NEW FILE 0001-properly-detect-devices-with-vfat-on-the-whole-disk.patch ---
>From 48372f7b55a60cf5bc3e91bf97e02229e95cc47b Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 16 Apr 2009 13:04:33 -0400
Subject: [PATCH] properly detect devices with vfat on the whole disk

See https://bugzilla.redhat.com/show_bug.cgi?id=495876
---
 src/95-devkit-disks.rules |    3 ---
 src/devkit-disks-device.c |   16 ++++++++++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/95-devkit-disks.rules b/src/95-devkit-disks.rules
index b29e5d0..fb8b745 100644
--- a/src/95-devkit-disks.rules
+++ b/src/95-devkit-disks.rules
@@ -19,9 +19,6 @@ KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="probe_parttable_end"
 #
 IMPORT{program}="devkit-disks-part-id $tempnode"
 
-# clear all ID_FS_USAGE, TYPE if we're a partition table
-ENV{DKD_PART_ID_PARTITION_TABLE_SCHEME}!="", ENV{ID_FS_USAGE}="", ENV{ID_FS_TYPE}=""
-
 LABEL="probe_parttable_end"
 
 ##############################################################################################################
diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c
index 633d716..968ad0d 100644
--- a/src/devkit-disks-device.c
+++ b/src/devkit-disks-device.c
@@ -1691,8 +1691,20 @@ update_info_partition_table (DevkitDisksDevice *device)
         if (!device->priv->device_is_partition &&
             devkit_device_has_property (device->priv->d, "DKD_PARTITION_TABLE")) {
 
-                devkit_disks_device_set_device_is_partition_table (device, TRUE);
-                devkit_disks_device_set_partition_table_scheme (device, devkit_device_get_property (device->priv->d, "DKD_PARTITION_TABLE_SCHEME"));
+                /* Some times we think that vfat on the main block device looks like a Master Boot Record
+                 * partition table (the on-disk formats are extremely similar). So if we already have
+                 * detected a file system on the main block device and don't have any partitions, then
+                 * avoid tagging the device as a partition table.
+                 *
+                 * See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=495876.
+                 */
+                if (device->priv->partition_table_count == 0 &&
+                    g_strcmp0 (device->priv->id_usage, "filesystem") == 0) {
+                        devkit_disks_device_set_device_is_partition_table (device, FALSE);
+                } else {
+                        devkit_disks_device_set_device_is_partition_table (device, TRUE);
+                        devkit_disks_device_set_partition_table_scheme (device, devkit_device_get_property (device->priv->d, "DKD_PARTITION_TABLE_SCHEME"));
+                }
         } else {
                 devkit_disks_device_set_partition_table_scheme (device, NULL);
         }
-- 
1.6.2.2



Index: DeviceKit-disks.spec
===================================================================
RCS file: /cvs/pkgs/rpms/DeviceKit-disks/devel/DeviceKit-disks.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DeviceKit-disks.spec	15 Apr 2009 19:03:42 -0000	1.22
+++ DeviceKit-disks.spec	16 Apr 2009 17:09:55 -0000	1.23
@@ -12,7 +12,7 @@
 Summary: Disk Management Service
 Name: DeviceKit-disks
 Version: 004
-Release: 0.9.20090415git%{?dist}
+Release: 0.10.20090415git%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 URL: http://gitweb.freedesktop.org/?p=users/david/DeviceKit-disks.git;a=summary
@@ -59,6 +59,8 @@
 # for /proc/self/mountinfo, only available in 2.6.26 or higher
 Conflicts: kernel < 2.6.26
 
+Patch0: 0001-properly-detect-devices-with-vfat-on-the-whole-disk.patch
+
 %description
 DeviceKit-disks provides a daemon, D-Bus API and command line tools
 for managing disks and storage devices.
@@ -75,6 +77,7 @@
 
 %prep
 %setup -q
+%patch0 -p1 -b .vfat-whole-disk
 
 %build
 %configure
@@ -132,6 +135,9 @@
 
 # Note: please don't forget the %{?dist} in the changelog. Thanks
 %changelog
+* Thu Apr 16 2009 David Zeuthen <davidz at redhat.com> - 004-0.10.20090415git%{?dist}
+- Properly detect vfat on whole disk devices (#495876)
+
 * Wed Apr 15 2009 David Zeuthen <davidz at redhat.com> - 004-0.9.20090415git%{?dist}
 - Rebuild
 




More information about the fedora-extras-commits mailing list