summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-07 11:36:00 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-27 09:50:33 -0400
commitbcbb5a8b00770ac0d2794e59876d8187ccfea6af (patch)
tree3fea3428991da6089c4fd4b76bdb51e8e362ca25
parentdf3afcfa3b63b8f4ca012a428e35dfb24bba4bb9 (diff)
downloadrockbox-bcbb5a8b00770ac0d2794e59876d8187ccfea6af.tar.gz
rockbox-bcbb5a8b00770ac0d2794e59876d8187ccfea6af.zip
multiboot: Allow searching in volume 0 for redirect file
Searching in volume 0 is necessary for multiboot targets with only one drive, like the M3K/Q1/ErosQ. Without this the search code will never look at the redirect file on these targets. The search bound is configured with a setting MULTIBOOT_MIN_VOLUME, which defaults to 0, but is defined to 1 for Sansa players so they keep their old behavior. Change-Id: I6dc5cf98db4258731de2c68c3ab1182b4a4a655b
-rw-r--r--firmware/common/rb-loader.c2
-rw-r--r--firmware/export/config.h6
-rw-r--r--firmware/export/config/sansaclipplus.h1
-rw-r--r--firmware/export/config/sansaclipzip.h1
-rw-r--r--firmware/export/config/sansae200.h1
-rw-r--r--firmware/export/config/sansafuze.h1
-rw-r--r--firmware/export/config/sansafuzeplus.h1
-rw-r--r--firmware/export/config/sansafuzev2.h1
8 files changed, 13 insertions, 1 deletions
diff --git a/firmware/common/rb-loader.c b/firmware/common/rb-loader.c
index e3fc90342c..430ed6ec7b 100644
--- a/firmware/common/rb-loader.c
+++ b/firmware/common/rb-loader.c
@@ -106,7 +106,7 @@ int load_firmware(unsigned char* buf, const char* firmware, int buffer_size)
106 * 0 is the default boot volume, it is not checked here 106 * 0 is the default boot volume, it is not checked here
107 * if found <volume>/rockbox_main.<playername> and firmware 107 * if found <volume>/rockbox_main.<playername> and firmware
108 * has a bootdata region this firmware will be loaded */ 108 * has a bootdata region this firmware will be loaded */
109 for (unsigned int i = NUM_VOLUMES - 1; i > 0 && ret < 0; i--) 109 for (int i = NUM_VOLUMES - 1; i >= MULTIBOOT_MIN_VOLUME && ret < 0; i--)
110 { 110 {
111 if (get_redirect_dir(filename, sizeof(filename), i, 111 if (get_redirect_dir(filename, sizeof(filename), i,
112 BOOTDIR, firmware) > 0) 112 BOOTDIR, firmware) > 0)
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 7002b2a3c5..6465bdcb0e 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -869,6 +869,12 @@ Lyre prototype 1 */
869#define HAVE_MULTIBOOT 869#define HAVE_MULTIBOOT
870#endif 870#endif
871 871
872/* The lowest numbered volume to read a multiboot redirect from; default is to
873 * allow any volume but some targets may wish to exclude the internal drive. */
874#if defined(HAVE_MULTIBOOT) && !defined(MULTIBOOT_MIN_VOLUME)
875# define MULTIBOOT_MIN_VOLUME 0
876#endif
877
872#ifndef NUM_DRIVES 878#ifndef NUM_DRIVES
873#define NUM_DRIVES 1 879#define NUM_DRIVES 1
874#endif 880#endif
diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h
index e0df0c28c3..e78063ef02 100644
--- a/firmware/export/config/sansaclipplus.h
+++ b/firmware/export/config/sansaclipplus.h
@@ -11,6 +11,7 @@
11#define HAVE_BOOTDATA 11#define HAVE_BOOTDATA
12/* define boot redirect file name allows booting from external drives */ 12/* define boot redirect file name allows booting from external drives */
13#define BOOT_REDIR "rockbox_main.clip+" 13#define BOOT_REDIR "rockbox_main.clip+"
14#define MULTIBOOT_MIN_VOLUME 1
14 15
15#define HAVE_MULTIDRIVE 16#define HAVE_MULTIDRIVE
16#define NUM_DRIVES 2 17#define NUM_DRIVES 2
diff --git a/firmware/export/config/sansaclipzip.h b/firmware/export/config/sansaclipzip.h
index 6afe6e129e..d8b18e1a18 100644
--- a/firmware/export/config/sansaclipzip.h
+++ b/firmware/export/config/sansaclipzip.h
@@ -11,6 +11,7 @@
11#define HAVE_BOOTDATA 11#define HAVE_BOOTDATA
12/* define boot redirect file name allows booting from external drives */ 12/* define boot redirect file name allows booting from external drives */
13#define BOOT_REDIR "rockbox_main.clipzip" 13#define BOOT_REDIR "rockbox_main.clipzip"
14#define MULTIBOOT_MIN_VOLUME 1
14 15
15#define HAVE_MULTIDRIVE 16#define HAVE_MULTIDRIVE
16#define NUM_DRIVES 2 17#define NUM_DRIVES 2
diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h
index 59e531241f..6bb2df9bc8 100644
--- a/firmware/export/config/sansae200.h
+++ b/firmware/export/config/sansae200.h
@@ -13,6 +13,7 @@
13 13
14/* define boot redirect file name allows booting from external drives */ 14/* define boot redirect file name allows booting from external drives */
15#define BOOT_REDIR "rockbox_main.e200" 15#define BOOT_REDIR "rockbox_main.e200"
16#define MULTIBOOT_MIN_VOLUME 1
16 17
17/* define this if you have recording possibility */ 18/* define this if you have recording possibility */
18#define HAVE_RECORDING 19#define HAVE_RECORDING
diff --git a/firmware/export/config/sansafuze.h b/firmware/export/config/sansafuze.h
index b72f5b5198..e8f7157deb 100644
--- a/firmware/export/config/sansafuze.h
+++ b/firmware/export/config/sansafuze.h
@@ -10,6 +10,7 @@
10 10
11/* define boot redirect file name allows booting from external drives */ 11/* define boot redirect file name allows booting from external drives */
12#define BOOT_REDIR "rockbox_main.fuze" 12#define BOOT_REDIR "rockbox_main.fuze"
13#define MULTIBOOT_MIN_VOLUME 1
13 14
14#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96 15#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96
15 16
diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
index a853cb13b5..9b91e114bc 100644
--- a/firmware/export/config/sansafuzeplus.h
+++ b/firmware/export/config/sansafuzeplus.h
@@ -12,6 +12,7 @@
12#define HAVE_BOOTDATA 12#define HAVE_BOOTDATA
13/* define boot redirect file name allows booting from external drives */ 13/* define boot redirect file name allows booting from external drives */
14#define BOOT_REDIR "rockbox_main.fuze+" 14#define BOOT_REDIR "rockbox_main.fuze+"
15#define MULTIBOOT_MIN_VOLUME 1
15 16
16// HW can do it but we don't have the IRAM for mix buffers 17// HW can do it but we don't have the IRAM for mix buffers
17//#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192 18//#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192
diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h
index fc2ff68257..96d3b2deee 100644
--- a/firmware/export/config/sansafuzev2.h
+++ b/firmware/export/config/sansafuzev2.h
@@ -10,6 +10,7 @@
10 10
11/* define boot redirect file name allows booting from external drives */ 11/* define boot redirect file name allows booting from external drives */
12#define BOOT_REDIR "rockbox_main.fuze2" 12#define BOOT_REDIR "rockbox_main.fuze2"
13#define MULTIBOOT_MIN_VOLUME 1
13 14
14#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96 15#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96
15 16