{
struct block_data *data;
struct block_device *bdev;
- char id_string[PATH_LEN];
+ //char id_string[PATH_LEN];
bool partition;
int ret;
int thread_id;
pthread_mutex_lock(&(th_manager[thread_id].mutex));
th_manager[thread_id].num_dev++;
DD_LIST_APPEND(th_manager[thread_id].block_dev_list, bdev);
-
pthread_mutex_unlock(&(th_manager[thread_id].mutex));
+ if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
+ bdev->data->block_type = BLOCK_MMC_EXTENDED_INTERNAL_DEV;
+ ret = change_mount_point(bdev, EXTENDED_SD_PATH);
+ if (ret < 0) {
+ ret = -EPERM;
+ free_block_device(bdev);
+ return ret;
+ }
+
+ /* ---- ODE UI launch ----
+ snprintf(id_string, PATH_LEN, "%d", bdev->data->id);
+ ret = launch_system_app(POPUP_DEFAULT, 4, POPUP_KEY_CONTENT, "sdcardsetup", POPUP_SDCARD_ID, id_string);
+ if (ret < 0)
+ _E("Failed to launch popup");
+
+ ode_luks_set_event_cb(CALLBACK)
+ */
+
+ return 0;
+ } else if (!strncmp(bdev->data->fs_type, EXT4_NAME, strlen(EXT4_NAME))) {
+ bdev->data->block_type = BLOCK_MMC_EXTENDED_INTERNAL_DEV;
+ ret = change_mount_point(bdev, EXTENDED_SD_PATH);
+ if (ret < 0) {
+ ret = -EPERM;
+ free_block_device(bdev);
+ return ret;
+ }
+ } else if (!bdev->data->fs_type) {
+ _E("Unformatted Storage");
+ free_block_device(bdev);
+ return -EPERM;
+ }
+
+#if 0
/* Check this sdcard is already formatted for extended internal sdcard */
if (block_conf[bdev->data->block_type].extendedinternal &&
bdev->data->block_type == BLOCK_MMC_DEV &&
free_block_device(bdev);
return ret;
}
-
}
}
} else {
return -EPERM;
}
}
-
+#endif
ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
if (ret < 0) {
_E("Failed to add operation (insert %s)", devnode);