summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-08-20 19:19:55 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-08-20 19:19:55 -0400
commitbd744059cf959c8b9086978b32660efef5925b7d (patch)
treec445741c74a6312b5b8a2c64452ac48e20b182eb /apps
parent5ef28cccf92f5eada6d502fa4b0e16a13e94be5b (diff)
downloadrockbox-bd744059cf959c8b9086978b32660efef5925b7d.tar.gz
rockbox-bd744059cf959c8b9086978b32660efef5925b7d.tar.bz2
rockbox-bd744059cf959c8b9086978b32660efef5925b7d.zip
Multiboot Firmware Root Redirect
Firmware now includes rudimentary redirect functionality but this only supports /.rockbox in the root of the device This patch allows loading external drive and directory into root namespace Root Redirects can now be put into different folders For instance placing '/_test' into SD1/rockbox_main.<playername> will redirect to /<1>/_test/.rockbox Debug menu>Bootdata now has root directory listed in addition to RAW Bootdata Redirect root work from Michael Sevakis g#1556 Redirect will be updated if code refactor is ever done Requires Multiboot bootloader (already in main) Change-Id: I697b3d0499f85e789c3020bc2133fbe0023f72a2
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index b93fb45c8f..eae389d049 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2451,10 +2451,26 @@ static bool dbg_boot_data(void)
info.scroll_all = true;
simplelist_info_init(&info, "Boot data", 1, NULL);
simplelist_set_line_count(0);
- simplelist_addline("Magic: %.8s", boot_data.magic);
+ crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff);
+#if defined(HAVE_MULTIBOOT)
+ char rootpath[VOL_MAX_LEN+2] = RB_ROOT_CONTENTS_DIR;
+ int boot_volume = 0;
+ if(crc == boot_data.crc)
+ {
+ boot_volume = boot_data.boot_volume; /* boot volume contained in uint8_t payload */
+ get_redirect_dir(rootpath, sizeof(rootpath), boot_volume, "", "");
+ rootpath[path_strip_trailing_separators(rootpath,NULL)] = '\0';
+ }
+ simplelist_addline("Boot Volume: <%lu>", boot_volume);
+ simplelist_addline("Root:");
+ simplelist_addline("%s", rootpath);
+ simplelist_addline("");
+#endif
+ simplelist_addline("Bootdata RAW:");
+ if (crc != boot_data.crc)
+ simplelist_addline("Magic: %.8s", boot_data.magic);
simplelist_addline("Length: %lu", boot_data.length);
simplelist_addline("CRC: %lx", boot_data.crc);
- crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff);
(crc == boot_data.crc) ? simplelist_addline("CRC: OK!") :
simplelist_addline("CRC: BAD");
for (unsigned i = 0; i < boot_data.length; i += 4)
@@ -2466,7 +2482,7 @@ static bool dbg_boot_data(void)
info.hide_selection = true;
return simplelist_show_list(&info);
}
-#endif
+#endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */
/****** The menu *********/
static const struct {