1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/common
Solomon Peachy 4ad041e17a disk: Always try to mount the first partition on a disk.
We've received multiple reports from users of 6th gen iPods where we
fail to find any mountable partition.  A user was able to supply an MBR
dump, which showed that the "type" listed for parition 0 was set to 0x00
(ie "unused"), leading us to (correctly) completely ignore that entry.
However, it looks like the stock firmware ignores the type and
unconditionally uses the first entry even if it's nominally "invalid"

So, to deal with this, always try to mount partition 0 if it is not one
of the two "extended partition table" types.  If that speculative mount
succeeds, we now treat it as type 0x0c (Fat32 w/LBA) internally.

Note that this will not allow the partition to be mountable over USB, as
the MBR is still incorrect, leading the host OS to ignore the partition.
Further complicating things, the stock Apple firmware always constructs
a fake MBR to hand to the host!

To prevent user confusion with these devices, we may consider faking the
MBR too; alternatively we could correct the MBR and write it back to
disk, perhaps via a debug menu option.

Change-Id: I1e9392d20401eb94ecc6d70263fb0e45392a9bd4
2025-08-31 19:31:20 -04:00
..
adler32.c
ap_int.c
bootdata.c multiboot: Add v1 boot protocol 2024-03-31 16:57:19 +01:00
config.c
crc32-rkw.c
crc32.c
devicedata.c Add DeviceData to bootloaders 2024-09-02 13:29:43 -04:00
diacritic.c Revert "internals: Support characters beyond the first unicode plane (WIP)" 2025-08-20 16:09:49 -04:00
dir.c Revert "readdir_r use in tagcache.check_dir, ft_load" 2024-05-02 13:38:32 -04:00
dircache.c add INIT_ATTR to dircache_load and core_load_key_remap 2024-11-26 22:13:43 -05:00
disk.c disk: Always try to mount the first partition on a disk. 2025-08-31 19:31:20 -04:00
disk_cache.c storage: 64-bit sector offsets 2024-08-12 14:23:44 -04:00
fdprintf.c
file.c storage: Misc corrections and cleanups 2024-11-26 08:37:55 -05:00
file_internal.c init_volume_names() has to be called AFTER storage_init() 2024-07-28 21:15:41 -04:00
fileobj_mgr.c
inflate.c
itoa_buf.c [BugFix] itoa conflicts with mingw rename to itoa_buf 2025-02-18 10:41:18 -05:00
linked_list.c
loader_strerror.c
multiboot.c [coverity] multiboot.c write_bootdata_ fix memset size 2024-06-04 15:56:56 -04:00
pathfuncs.c [BugFix] pathfuncs.c path_append_ex basepath_max might cause buffer ovfl 2024-12-30 19:35:33 -05:00
rb-loader.c Add DeviceData to bootloaders 2024-09-02 13:29:43 -04:00
rb_namespace.c
rectangle.c
strcasecmp.c strcasecmp: Optimize size and speed 2025-05-18 16:57:35 -04:00
strcasestr.c [Bugfix] strcasestr 2024-12-31 23:06:08 -05:00
strlcat.c
strlcpy.c
strmemccpy.c
strnatcmp.c strnatcmp: Sort dots first 2025-05-18 22:50:05 -04:00
strptokspn.c
timefuncs.c
ucl_decompress.c
unicode.c Revert "internals: Support characters beyond the first unicode plane (WIP)" 2025-08-20 16:09:49 -04:00
version.c
vuprintf.c Convert non-ASCII characters to UTF-8 2024-12-15 21:16:12 -05:00
zip.c