diff options
-rw-r--r-- | apps/debug_menu.c | 17 | ||||
-rw-r--r-- | firmware/common/disk.c | 20 |
2 files changed, 3 insertions, 34 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index e75fce6d32..b93fb45c8f 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -2451,21 +2451,10 @@ 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 | crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); | 2454 | simplelist_addline("Magic: %.8s", boot_data.magic); |
2455 | #if defined(HAVE_MULTIBOOT) | ||
2456 | int boot_volume = 0; | ||
2457 | if(crc == boot_data.crc) | ||
2458 | { | ||
2459 | boot_volume = boot_data.boot_volume; /* boot volume contained in uint8_t payload */ | ||
2460 | } | ||
2461 | simplelist_addline("Boot Volume: <%lu>", boot_volume); | ||
2462 | simplelist_addline(""); | ||
2463 | #endif | ||
2464 | simplelist_addline("Bootdata RAW:"); | ||
2465 | if (crc != boot_data.crc) | ||
2466 | simplelist_addline("Magic: %.8s", boot_data.magic); | ||
2467 | simplelist_addline("Length: %lu", boot_data.length); | 2455 | simplelist_addline("Length: %lu", boot_data.length); |
2468 | simplelist_addline("CRC: %lx", boot_data.crc); | 2456 | simplelist_addline("CRC: %lx", boot_data.crc); |
2457 | crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); | ||
2469 | (crc == boot_data.crc) ? simplelist_addline("CRC: OK!") : | 2458 | (crc == boot_data.crc) ? simplelist_addline("CRC: OK!") : |
2470 | simplelist_addline("CRC: BAD"); | 2459 | simplelist_addline("CRC: BAD"); |
2471 | for (unsigned i = 0; i < boot_data.length; i += 4) | 2460 | for (unsigned i = 0; i < boot_data.length; i += 4) |
@@ -2477,7 +2466,7 @@ static bool dbg_boot_data(void) | |||
2477 | info.hide_selection = true; | 2466 | info.hide_selection = true; |
2478 | return simplelist_show_list(&info); | 2467 | return simplelist_show_list(&info); |
2479 | } | 2468 | } |
2480 | #endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */ | 2469 | #endif |
2481 | 2470 | ||
2482 | /****** The menu *********/ | 2471 | /****** The menu *********/ |
2483 | static const struct { | 2472 | static const struct { |
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index 51d033b678..98c273b26d 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c | |||
@@ -30,10 +30,6 @@ | |||
30 | #include "dircache_redirect.h" | 30 | #include "dircache_redirect.h" |
31 | #include "disk.h" | 31 | #include "disk.h" |
32 | 32 | ||
33 | #if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) && !defined(BOOTLOADER) | ||
34 | #include "bootdata.h" | ||
35 | #include "crc32.h" | ||
36 | #endif | ||
37 | 33 | ||
38 | #ifndef CONFIG_DEFAULT_PARTNUM | 34 | #ifndef CONFIG_DEFAULT_PARTNUM |
39 | #define CONFIG_DEFAULT_PARTNUM 0 | 35 | #define CONFIG_DEFAULT_PARTNUM 0 |
@@ -253,23 +249,7 @@ int disk_mount_all(void) | |||
253 | for (int i = 0; i < NUM_VOLUMES; i++) | 249 | for (int i = 0; i < NUM_VOLUMES; i++) |
254 | vol_drive[i] = -1; /* mark all as unassigned */ | 250 | vol_drive[i] = -1; /* mark all as unassigned */ |
255 | 251 | ||
256 | #if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) && !defined(BOOTLOADER) | ||
257 | unsigned int crc = 0; | ||
258 | int boot_volume = 0; | ||
259 | crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); | ||
260 | if(crc == boot_data.crc) | ||
261 | { | ||
262 | boot_volume = boot_data.boot_volume; /* boot volume contained in uint8_t payload */ | ||
263 | } | ||
264 | #ifdef HAVE_HOTSWAP | ||
265 | if (storage_present(boot_volume)) | ||
266 | #endif | ||
267 | mounted += disk_mount(boot_volume); /* mount boot volume first */ | ||
268 | for (int i = 0; i < NUM_DRIVES; i++) | ||
269 | if (i != boot_volume) | ||
270 | #else | ||
271 | for (int i = 0; i < NUM_DRIVES; i++) | 252 | for (int i = 0; i < NUM_DRIVES; i++) |
272 | #endif | ||
273 | { | 253 | { |
274 | #ifdef HAVE_HOTSWAP | 254 | #ifdef HAVE_HOTSWAP |
275 | if (storage_present(i)) | 255 | if (storage_present(i)) |