From a2b8204718ae755faca75b1a66385f05085c3dab Mon Sep 17 00:00:00 2001 From: Moshe Piekarski Date: Sat, 17 Sep 2011 22:45:59 +0000 Subject: Allow any partition type, not just known FAT types. Instead of only mounting partitions with a FAT partition type, try any partition that isn't type 0 (unallocated) or 5 (extended). This makes it easier to reformat SDXC cards which have the exFAT partition type, and also brings us in line with pretty much every other OS at this point. Anything with a valid-looking FAT superblock will get mounted. original author: Torne Wuff Change-Id: I3ea8d437a79f9da270f9d119cc670e472331a9da --- firmware/common/disk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'firmware') diff --git a/firmware/common/disk.c b/firmware/common/disk.c index c9676ed285..25c7330032 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -200,9 +200,8 @@ int disk_mount(int drive) volume != -1 && i < 4 && mounted < NUM_VOLUMES_PER_DRIVE; i++) { - if (memchr(fat_partition_types, pinfo[i].type, - sizeof(fat_partition_types)) == NULL) - continue; /* not an accepted partition type */ + if (pinfo[i].type == 0 || pinfo[i].type == 5) + continue; /* skip free/extended partitions */ #ifdef MAX_LOG_SECTOR_SIZE for (int j = 1; j <= (MAX_LOG_SECTOR_SIZE/SECTOR_SIZE); j <<= 1) -- cgit v1.2.3