uid_t luks_cleartext_unlocked_by_uid;
char *linux_md_component_level;
+ int linux_md_component_position;
int linux_md_component_num_raid_devices;
char *linux_md_component_uuid;
char *linux_md_component_home_host;
void devkit_disks_device_set_luks_cleartext_unlocked_by_uid (DevkitDisksDevice *device, guint value);
void devkit_disks_device_set_linux_md_component_level (DevkitDisksDevice *device, const gchar *value);
+void devkit_disks_device_set_linux_md_component_position (DevkitDisksDevice *device, gint value);
void devkit_disks_device_set_linux_md_component_num_raid_devices (DevkitDisksDevice *device, gint value);
void devkit_disks_device_set_linux_md_component_uuid (DevkitDisksDevice *device, const gchar *value);
void devkit_disks_device_set_linux_md_component_home_host (DevkitDisksDevice *device, const gchar *value);
PROP_DRIVE_ATA_SMART_BLOB,
PROP_LINUX_MD_COMPONENT_LEVEL,
+ PROP_LINUX_MD_COMPONENT_POSITION,
PROP_LINUX_MD_COMPONENT_NUM_RAID_DEVICES,
PROP_LINUX_MD_COMPONENT_UUID,
PROP_LINUX_MD_COMPONENT_HOME_HOST,
case PROP_LINUX_MD_COMPONENT_LEVEL:
g_value_set_string (value, device->priv->linux_md_component_level);
break;
+ case PROP_LINUX_MD_COMPONENT_POSITION:
+ g_value_set_int (value, device->priv->linux_md_component_position);
+ break;
case PROP_LINUX_MD_COMPONENT_NUM_RAID_DEVICES:
g_value_set_int (value, device->priv->linux_md_component_num_raid_devices);
break;
g_param_spec_string ("linux-md-component-level", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
object_class,
+ PROP_LINUX_MD_COMPONENT_POSITION,
+ g_param_spec_int ("linux-md-component-position", NULL, NULL, 0, G_MAXINT, 0, G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
PROP_LINUX_MD_COMPONENT_NUM_RAID_DEVICES,
g_param_spec_int ("linux-md-component-num-raid-devices", NULL, NULL, 0, G_MAXINT, 0, G_PARAM_READABLE));
g_object_class_install_property (
const gchar *md_comp_version;
gchar *md_name;
gchar *s;
+ int md_comp_position;
+
+ md_comp_position = -1;
devkit_disks_device_set_device_is_linux_md_component (device, TRUE);
gchar *dev_name;
gchar *md_dev_path;
gchar *state_contents;
+ gchar *slot_contents;
+ gint slot_number;
+ gchar *endp;
dev_name = g_path_get_basename (device->priv->native_path);
md_dev_path = g_strdup_printf ("%s/md/dev-%s", holder->priv->native_path, dev_name);
g_strstrip (state_contents);
state_tokens = g_strsplit (state_contents, ",", 0);
+ slot_contents = sysfs_get_string (md_dev_path, "slot");
+ g_strstrip (slot_contents);
+ slot_number = strtol (slot_contents, &endp, 0);
+ if (endp != NULL && *endp == '\0') {
+ md_comp_position = slot_number;
+ }
+
+ g_free (slot_contents);
g_free (state_contents);
g_free (md_dev_path);
g_free (dev_name);
md_comp_version = device->priv->id_version;
devkit_disks_device_set_linux_md_component_level (device, md_comp_level);
+ devkit_disks_device_set_linux_md_component_position (device, md_comp_position);
devkit_disks_device_set_linux_md_component_num_raid_devices (device, md_comp_num_raid_devices);
devkit_disks_device_set_linux_md_component_uuid (device, md_comp_uuid);
devkit_disks_device_set_linux_md_component_home_host (device, md_comp_home_host);
} else {
devkit_disks_device_set_device_is_linux_md_component (device, FALSE);
devkit_disks_device_set_linux_md_component_level (device, NULL);
+ devkit_disks_device_set_linux_md_component_position (device, -1);
devkit_disks_device_set_linux_md_component_num_raid_devices (device, 0);
devkit_disks_device_set_linux_md_component_uuid (device, NULL);
devkit_disks_device_set_linux_md_component_home_host (device, NULL);
gsize drive_ata_smart_blob_size;
char *linux_md_component_level;
+ int linux_md_component_position;
int linux_md_component_num_raid_devices;
char *linux_md_component_uuid;
char *linux_md_component_home_host;
else if (strcmp (key, "LinuxMdComponentLevel") == 0)
props->linux_md_component_level = g_strdup (g_value_get_string (value));
+ else if (strcmp (key, "LinuxMdComponentPosition") == 0)
+ props->linux_md_component_position = g_value_get_int (value);
else if (strcmp (key, "LinuxMdComponentNumRaidDevices") == 0)
props->linux_md_component_num_raid_devices = g_value_get_int (value);
else if (strcmp (key, "LinuxMdComponentUuid") == 0)
if (props->device_is_linux_md_component) {
g_print (" linux md component:\n");
g_print (" RAID level: %s\n", props->linux_md_component_level);
- g_print (" num comp: %d\n", props->linux_md_component_num_raid_devices);
+ g_print (" position: %d\n", props->linux_md_component_position);
+ g_print (" num components: %d\n", props->linux_md_component_num_raid_devices);
g_print (" uuid: %s\n", props->linux_md_component_uuid);
g_print (" home host: %s\n", props->linux_md_component_home_host);
g_print (" name: %s\n", props->linux_md_component_name);