summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2011-05-04 10:38:01 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2011-05-04 10:38:01 +0200
commit156ebd5ca8f88b7a4772c03ed269ae30718f866d (patch)
treef0c66555408acaddbcae3eb44bafe6e5b542a0b5 /src/device.c
parent361a2ce3f2fc0b6ef02ac11d31bf77a0a9354e70 (diff)
Add override for system internal property
Check UDISKS_SYSTEM_INTERNAL udev property to override the usual bus type based "is drive system internal?" detection. Based on patch by Patrick Stewart <patstew@gmail.com>, thank you!
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index a928fb5..22779c7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3849,9 +3849,12 @@ static gboolean
update_info_is_system_internal (Device *device)
{
gboolean is_system_internal;
-
- /* TODO: make it possible to override this property from a udev property.
- */
+
+ if (g_udev_device_has_property (device->priv->d, "UDISKS_SYSTEM_INTERNAL"))
+ {
+ is_system_internal = g_udev_device_get_property_as_boolean (device->priv->d, "UDISKS_SYSTEM_INTERNAL");
+ goto determined;
+ }
/* start out by assuming the device is system internal, then adjust depending on what kind of
* device we are dealing with