diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-28 09:50:56 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-28 09:50:56 -0700 |
| commit | 4ad30d2885a801ee23fb44c1edcda051905868c9 (patch) | |
| tree | 1224280b77a0c8e8099132468166ef1d3d94d134 /vold/format.c | |
| parent | ecfd8e73e4d0102ba01139f9b7ea1e97ce7b79d5 (diff) | |
| parent | f68a5cdeb78fed7762943354f9291682b1d625a9 (diff) | |
| download | system_core-4ad30d2885a801ee23fb44c1edcda051905868c9.zip system_core-4ad30d2885a801ee23fb44c1edcda051905868c9.tar.gz system_core-4ad30d2885a801ee23fb44c1edcda051905868c9.tar.bz2 | |
Merge change 23106 into eclair
* changes:
vold: Format cards < 2GB as FAT16, otherwise FAT32. Also let the formatter choose the cluster-size
Diffstat (limited to 'vold/format.c')
| -rwxr-xr-x | vold/format.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/vold/format.c b/vold/format.c index cd40197..c67b358 100755 --- a/vold/format.c +++ b/vold/format.c @@ -33,21 +33,23 @@ int format_partition(blkdev_t *part, char *type) { char *devpath; int rc = -EINVAL; - + devpath = blkdev_get_devpath(part); if (!strcmp(type, FORMAT_TYPE_FAT32)) { - char *args[9]; + char *args[7]; args[0] = MKDOSFS_PATH; args[1] = "-F"; - args[2] = "32"; - args[3] = "-c"; - args[4] = "16"; - args[5] = "-O"; - args[6] = "android"; - args[7] = devpath; - args[8] = NULL; - rc = logwrap(8, args, 1); + if ((part->nr_sec * 512) <= (unsigned int) (1024*1024*1024*2)) + args[2] = "16"; + else + args[2] = "32"; + + args[3] = "-O"; + args[4] = "android"; + args[5] = devpath; + args[6] = NULL; + rc = logwrap(7, args, 1); } else { char *args[7]; args[0] = MKE2FS_PATH; |
