diff options
| author | Ben Winslow <rain@bluecherry.net> | 2009-08-15 09:52:10 -0400 |
|---|---|---|
| committer | San Mehat <san@google.com> | 2009-12-05 10:28:09 -0800 |
| commit | 88660fa5d897a74f2fe07f4b827d37a453e32181 (patch) | |
| tree | cc28a59eaddd600f0a8f379a39dfe689b1520a2a | |
| parent | dd75019da80cf49361fd355d4d6b66c02c73896e (diff) | |
| download | system_core-88660fa5d897a74f2fe07f4b827d37a453e32181.tar.gz system_core-88660fa5d897a74f2fe07f4b827d37a453e32181.tar.bz2 system_core-88660fa5d897a74f2fe07f4b827d37a453e32181.zip | |
vold: Check partitions 1-4 instead of 0-3
In mmc_bootstrap_mmcblk, bootstrap partitions 1-4 instead of 0-3, since
that's how the kernel labels them. Additionally, use the NDOSPART constant
from diskmbr.h instead of hardcoding 4 when scanning partitions.
Signed-off-by: San Mehat <san@google.com>
| -rw-r--r-- | vold/blkdev.c | 4 | ||||
| -rw-r--r-- | vold/mmc.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/vold/blkdev.c b/vold/blkdev.c index 22d000e5..33fed1b8 100644 --- a/vold/blkdev.c +++ b/vold/blkdev.c @@ -113,7 +113,7 @@ int blkdev_refresh(blkdev_t *blk) goto out; } - for (i = 0; i < 4; i++) { + for (i = 0; i < NDOSPART; i++) { struct dos_partition part; dos_partition_dec(block + DOSPARTOFF + i * sizeof(struct dos_partition), &part); @@ -140,7 +140,7 @@ int blkdev_refresh(blkdev_t *blk) else part_no = blk->minor -1; - if (part_no < 4) { + if (part_no < NDOSPART) { dos_partition_dec(block + DOSPARTOFF + part_no * sizeof(struct dos_partition), &part); blk->part_type = part.dp_typ; } else { @@ -25,6 +25,7 @@ #include "vold.h" #include "mmc.h" #include "media.h" +#include "diskmbr.h" /* for NDOSPART */ #define DEBUG_BOOTSTRAP 0 @@ -233,7 +234,7 @@ static int mmc_bootstrap_mmcblk(char *devpath) *mmcblk_devname != '/'; mmcblk_devname--); mmcblk_devname++; - for (part_no = 0; part_no < 4; part_no++) { + for (part_no = 1; part_no <= NDOSPART; part_no++) { char part_file[255]; sprintf(part_file, "/sys%s/%sp%d", devpath, mmcblk_devname, part_no); if (!access(part_file, F_OK)) { |
