"issssssisib", arr);
}
-static char *generate_mount_path(const char *fs_uuid_enc)
+static char *generate_mount_path(struct block_data *data)
{
- const char *str;
- str = tzplatform_mkpath(TZ_SYS_STORAGE, fs_uuid_enc);
+ const char *str, *node;
+
+ if (!data)
+ return NULL;
+
+ /* For libstorage API
+ * If it's a primary partition and mmc device,
+ * use 'sdcard' node as mount point. */
+ if (data->primary && data->block_type == BLOCK_MMC_DEV)
+ node = "sdcard";
+ else if (data->fs_uuid_enc)
+ node = data->fs_uuid_enc;
+ else
+ return NULL;
+
+ str = tzplatform_mkpath(TZ_SYS_STORAGE, node);
if (!str)
return NULL;
return strdup(str);
data->fs_type = strdup(fs_type);
if (fs_version)
data->fs_version = strdup(fs_version);
- if (fs_uuid_enc) {
+ if (fs_uuid_enc)
data->fs_uuid_enc = strdup(fs_uuid_enc);
- data->mount_point = generate_mount_path(fs_uuid_enc);
- }
if (readonly)
data->readonly = atoi(readonly);
data->primary = check_primary_partition(devnode);
else
data->block_type = -1;
+ data->mount_point = generate_mount_path(data);
+
return data;
}
data->fs_uuid_enc = NULL;
free(data->mount_point);
data->mount_point = NULL;
- if (fs_uuid_enc) {
+ if (fs_uuid_enc)
data->fs_uuid_enc = strdup(fs_uuid_enc);
- data->mount_point = generate_mount_path(fs_uuid_enc);
- }
data->readonly = false;
if (readonly)
data->readonly = atoi(readonly);
+ data->mount_point = generate_mount_path(data);
+
return 0;
}
if (mount_point)
data->mount_point = strdup(mount_point);
else
- data->mount_point = generate_mount_path(data->fs_uuid_enc);
+ data->mount_point = generate_mount_path(data);
return 0;
}