VFAT format with the label(emul-sdcard) in the mobile emulator 54/155254/1 submit/tizen_4.0/20171012.235228
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 12 Oct 2017 12:12:06 +0000 (21:12 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 12 Oct 2017 12:12:41 +0000 (12:12 +0000)
Change-Id: I0747f1f1540fc844c9fc90483f91cd6261f5ffb4
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/block/vfat.c

index 997b446..4ed6f3e 100644 (file)
@@ -39,6 +39,11 @@ static const char *vfat_arg[] = {
        "-F", "32", "-O", "tizen", "-c", "8", NULL, NULL,
 };
 
+static const char *emul_vfat_arg[] = {
+       "/usr/bin/newfs_msdos",
+       "-F", "32", "-O", "tizen", "-L", "emul-sdcard", "-c", "8", NULL, NULL,
+};
+
 static const char *vfat_check_arg[] = {
        "/usr/bin/fsck_msdosfs",
        "-pf", NULL, NULL,
@@ -131,9 +136,17 @@ static int vfat_mount(bool smack, const char *devpath, const char *mount_point)
 static int vfat_format(const char *devpath)
 {
        int argc;
-       argc = ARRAY_SIZE(vfat_arg);
-       vfat_arg[argc - 2] = devpath;
-       return run_child(argc, vfat_arg);
+
+       if(!is_emulator()) {
+               argc = ARRAY_SIZE(vfat_arg);
+               vfat_arg[argc - 2] = devpath;
+               return run_child(argc, vfat_arg);
+       }
+       else {
+               argc = ARRAY_SIZE(emul_vfat_arg);
+               emul_vfat_arg[argc - 2] = devpath;
+               return run_child(argc, emul_vfat_arg);
+       }
 }
 
 static const struct block_fs_ops vfat_ops = {