rockbox/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 crc32/adler32: add full copyright notice to source files 2021-07-31 01:30:39 +00:00
ap_int.c Add proper float formatting to vuprintf 2019-07-19 22:07:41 -04:00
bootdata.c multiboot: Add v1 boot protocol 2024-03-31 16:57:19 +01:00
config.c Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes). 2010-05-06 21:04:40 +00:00
crc32-rkw.c Add RKW firmware file format loader 2012-03-04 00:34:26 +01:00
crc32.c crc32/adler32: add full copyright notice to source files 2021-07-31 01:30:39 +00:00
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 Add a small 32-byte write buffer to fdprintf. 2017-11-28 09:01:17 -05:00
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 [RESTORED!] Allow mounting of any directory as the root directory. 2022-03-03 18:58:07 -05:00
inflate.c inflate: Add helper for getting decompressed data size 2022-03-04 08:44:56 -05:00
itoa_buf.c [BugFix] itoa conflicts with mingw rename to itoa_buf 2025-02-18 10:41:18 -05:00
linked_list.c linked list: add lld_insert_prev/next() 2022-10-16 16:10:24 +01:00
loader_strerror.c Move load_firmware() to separate file 2013-06-27 13:50:11 +02:00
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 [Bugfix] ft_assemble_path extra slashes, Volume unmound double free 2024-03-29 10:27:03 -04:00
rectangle.c Add rectangle utility functions 2022-12-01 12:36:28 -05:00
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 strlcat use strlcpy for the copy part 2022-11-16 00:36:47 -05:00
strlcpy.c strlcpy finish cleanup 2022-11-17 01:54:46 -05:00
strmemccpy.c replace strlcpy with strmemccpy 2022-11-14 23:56:16 -05:00
strnatcmp.c strnatcmp: Sort dots first 2025-05-18 22:50:05 -04:00
strptokspn.c fix strptokspn, add strcspn, fix splash.c 2022-11-13 01:14:49 -05:00
timefuncs.c timefuncs.c valid_time() should return false if tm == NULL and not try to deref 2021-07-20 23:25:31 +00:00
ucl_decompress.c Add standalone UCL decompressor 2021-05-12 10:35:20 +00:00
unicode.c Revert "internals: Support characters beyond the first unicode plane (WIP)" 2025-08-20 16:09:49 -04:00
version.c Prevent spurious recompiles on account of changed version. 2014-08-28 15:48:56 +02:00
vuprintf.c Convert non-ASCII characters to UTF-8 2024-12-15 21:16:12 -05:00
zip.c Remove buflib allocation names, part two 2023-01-13 10:32:54 +00:00