block: Change mount path of extended internal storage at booting time 73/150973/2
authorpr.jung <pr.jung@samsung.com>
Tue, 19 Sep 2017 08:04:33 +0000 (17:04 +0900)
committerJung <pr.jung@samsung.com>
Tue, 19 Sep 2017 08:05:20 +0000 (08:05 +0000)
Change-Id: I862f4cc1a5d92aeb5870154e7d957fb2d9f2b74b
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/block/block.c

index 60980a2..4e5d6f1 100644 (file)
@@ -2149,12 +2149,22 @@ static int add_block_device(struct udev_device *dev, const char *devnode, bool i
                bdev->data->primary) {
                _I("Check whether sdcard will be used as extended internal storage");
 
-               if (!init) {
+               if (!init) { // after booting is done
                        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");
                        return 0;
+               } else { // at booting time
+                       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;
+                                       return ret;
+                               }
+
+                       }
                }
        } else {
                if (!bdev->data->fs_type) {