summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-18 19:11:24 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-12-18 23:32:13 -0500
commitf37ebe5ed2aeacf491c4a61d081d7a64215938fa (patch)
treeea2696c34d06845a3d218c59ad366528b7d042d4
parent992455dc58f03940d1eba8d870b4e7f78209a6c3 (diff)
downloadrockbox-f37ebe5ed2.tar.gz
rockbox-f37ebe5ed2.zip
[BugFix] root redirect failed to match the peoper drive when internal drive is missing
HAVE_MULTIVOLUME is a subset of HAVE_MULTIDRIVE in normal circumstances they are interchangable but when the internal drive is not found the assumption falls apart at the moment most of the bootloader are less selective about what drives/volumes they will mount therefore the volume might not match between what the bootloader returns for multiboot and what the firmware sees updating bootloaders will fix this but it should probably be made more robust at the same time Change-Id: I93acd4a539894f093211b74b030df3b2c6a0aa11
-rw-r--r--firmware/include/dircache_redirect.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/include/dircache_redirect.h b/firmware/include/dircache_redirect.h
index 5c3f630d74..f51ce70690 100644
--- a/firmware/include/dircache_redirect.h
+++ b/firmware/include/dircache_redirect.h
@@ -150,7 +150,13 @@ static inline void volume_onmount_internal(IF_MV_NONVOID(int volume))
/* we need to mount the drive before we can access it */
root_mount_path(path, 0); /* root could be different folder don't hide */
+/*BUGFIX bootloader is less selective about which drives it will mount -- revisit */
+#if defined(HAVE_MULTIDRIVE) && (NUM_VOLUMES_PER_DRIVE == 1)
+ if (volume_drive(volume) == boot_data.boot_volume
+ || volume == boot_data.boot_volume)
+#else
if (volume == boot_data.boot_volume) /* boot volume contained in uint8_t payload */
+#endif
{
int rtlen = get_redirect_dir(rtpath, sizeof(rtpath), volume, "", "");
while (rtlen > 0 && rtpath[--rtlen] == PATH_SEPCH)