1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
William Wilgus 2020-08-20 19:19:55 -04:00
parent 5ef28cccf9
commit bd744059cf
3 changed files with 78 additions and 4 deletions

View file

@ -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 {