diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 22 |
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) | |||
2451 | info.scroll_all = true; | 2451 | info.scroll_all = true; |
2452 | simplelist_info_init(&info, "Boot data", 1, NULL); | 2452 | simplelist_info_init(&info, "Boot data", 1, NULL); |
2453 | simplelist_set_line_count(0); | 2453 | simplelist_set_line_count(0); |
2454 | simplelist_addline("Magic: %.8s", boot_data.magic); | 2454 | crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); |
2455 | #if defined(HAVE_MULTIBOOT) | ||
2456 | char rootpath[VOL_MAX_LEN+2] = RB_ROOT_CONTENTS_DIR; | ||
2457 | int boot_volume = 0; | ||
2458 | if(crc == boot_data.crc) | ||
2459 | { | ||
2460 | boot_volume = boot_data.boot_volume; /* boot volume contained in uint8_t payload */ | ||
2461 | get_redirect_dir(rootpath, sizeof(rootpath), boot_volume, "", ""); | ||
2462 | rootpath[path_strip_trailing_separators(rootpath,NULL)] = '\0'; | ||
2463 | } | ||
2464 | simplelist_addline("Boot Volume: <%lu>", boot_volume); | ||
2465 | simplelist_addline("Root:"); | ||
2466 | simplelist_addline("%s", rootpath); | ||
2467 | simplelist_addline(""); | ||
2468 | #endif | ||
2469 | simplelist_addline("Bootdata RAW:"); | ||
2470 | if (crc != boot_data.crc) | ||
2471 | simplelist_addline("Magic: %.8s", boot_data.magic); | ||
2455 | simplelist_addline("Length: %lu", boot_data.length); | 2472 | simplelist_addline("Length: %lu", boot_data.length); |
2456 | simplelist_addline("CRC: %lx", boot_data.crc); | 2473 | simplelist_addline("CRC: %lx", boot_data.crc); |
2457 | crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); | ||
2458 | (crc == boot_data.crc) ? simplelist_addline("CRC: OK!") : | 2474 | (crc == boot_data.crc) ? simplelist_addline("CRC: OK!") : |
2459 | simplelist_addline("CRC: BAD"); | 2475 | simplelist_addline("CRC: BAD"); |
2460 | for (unsigned i = 0; i < boot_data.length; i += 4) | 2476 | for (unsigned i = 0; i < boot_data.length; i += 4) |
@@ -2466,7 +2482,7 @@ static bool dbg_boot_data(void) | |||
2466 | info.hide_selection = true; | 2482 | info.hide_selection = true; |
2467 | return simplelist_show_list(&info); | 2483 | return simplelist_show_list(&info); |
2468 | } | 2484 | } |
2469 | #endif | 2485 | #endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */ |
2470 | 2486 | ||
2471 | /****** The menu *********/ | 2487 | /****** The menu *********/ |
2472 | static const struct { | 2488 | static const struct { |