summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Piekarski <dev.rockbox@melachim.net>2011-09-17 22:45:59 +0000
committerSolomon Peachy <pizza@shaftnet.org>2020-06-30 21:11:52 +0000
commita2b8204718ae755faca75b1a66385f05085c3dab (patch)
treea65070fdb6332c64445f256939824f2413ea5286
parent3cfd129cd904a29b7065e13e6b9c9806513be121 (diff)
downloadrockbox-a2b8204718.tar.gz
rockbox-a2b8204718.tar.bz2
rockbox-a2b8204718.zip
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 <torne@wolfpuppy.org.uk> Change-Id: I3ea8d437a79f9da270f9d119cc670e472331a9da
-rw-r--r--firmware/common/disk.c5
1 files changed, 2 insertions, 3 deletions
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)