mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
disk: Dump partition tables when we can't find a usable partition
Change-Id: I10a1b4f149657da4292f34ac8a14e58ec6cdcf72
This commit is contained in:
parent
08bd5cdd3d
commit
888ce7cae8
6 changed files with 53 additions and 13 deletions
20
apps/main.c
20
apps/main.c
|
@ -636,16 +636,24 @@ static void init(void)
|
||||||
CHART("<disk_mount_all");
|
CHART("<disk_mount_all");
|
||||||
if (rc<=0)
|
if (rc<=0)
|
||||||
{
|
{
|
||||||
|
int line=0;
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
lcd_puts(0, 0, "No partition");
|
lcd_putsf(0, line++, "No partition found (%d).", rc);
|
||||||
lcd_putsf(0, 1, "found (%d).", rc);
|
|
||||||
#ifndef USB_NONE
|
#ifndef USB_NONE
|
||||||
lcd_puts(0, 2, "Insert USB cable");
|
lcd_puts(0, line++, "Insert USB cable");
|
||||||
lcd_puts(0, 3, "and fix it.");
|
lcd_puts(0, line++, "and fix it.");
|
||||||
#elif !defined(DEBUG) && !(CONFIG_STORAGE & STORAGE_RAMDISK)
|
#elif !defined(DEBUG) && !(CONFIG_STORAGE & STORAGE_RAMDISK)
|
||||||
lcd_puts(0, 2, "Rebooting in 5s");
|
lcd_puts(0, line++, "Rebooting in 5s");
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(0, 4, rbversion);
|
lcd_puts(0, line++, rbversion);
|
||||||
|
|
||||||
|
struct partinfo pinfo;
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
lcd_putsf(0, line++, "P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(DEFAULT_VIRT_SECTOR_SIZE)
|
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(DEFAULT_VIRT_SECTOR_SIZE)
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#else
|
#else
|
||||||
#include "rb-loader.h"
|
#include "rb-loader.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "disk.h"
|
||||||
|
|
||||||
/* TODO: Other bootloaders need to be adjusted to set this variable to true
|
/* TODO: Other bootloaders need to be adjusted to set this variable to true
|
||||||
on a button press - currently only the ipod, H10, Vibe 500, Sansa, and xDuoo x3 versions do. */
|
on a button press - currently only the ipod, H10, Vibe 500, Sansa, and xDuoo x3 versions do. */
|
||||||
|
@ -113,10 +114,17 @@ void error(int errortype, int error, bool shutdown)
|
||||||
printf("ATA error: %d", error);
|
printf("ATA error: %d", error);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDISK:
|
case EDISK: {
|
||||||
|
struct partinfo pinfo;
|
||||||
printf("No partition found");
|
printf("No partition found");
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
printf("P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case EBOOTFILE:
|
case EBOOTFILE:
|
||||||
printf(loader_strerror(error));
|
printf(loader_strerror(error));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -476,7 +476,7 @@ static void run_of(void)
|
||||||
printf("Booting OF in %d...", tmo);
|
printf("Booting OF in %d...", tmo);
|
||||||
sleep(HZ*1);
|
sleep(HZ*1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rc = kernel_launch_onb();
|
int rc = kernel_launch_onb();
|
||||||
printf("Load OF error: %d", rc);
|
printf("Load OF error: %d", rc);
|
||||||
sleep(HZ*10);
|
sleep(HZ*10);
|
||||||
|
@ -754,7 +754,14 @@ void main(void)
|
||||||
|
|
||||||
rc = disk_mount_all();
|
rc = disk_mount_all();
|
||||||
if (rc <= 0) {
|
if (rc <= 0) {
|
||||||
|
struct partinfo pinfo;
|
||||||
printf("No partition found");
|
printf("No partition found");
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
printf("P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
fatal_error(ERR_RB);
|
fatal_error(ERR_RB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,14 +364,17 @@ void* main(void)
|
||||||
rc = disk_mount_all();
|
rc = disk_mount_all();
|
||||||
if (rc<=0)
|
if (rc<=0)
|
||||||
{
|
{
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
printf("P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
|
|
||||||
printf("No partition found");
|
printf("No partition found");
|
||||||
fatal_error();
|
fatal_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
disk_partinfo(1, &pinfo);
|
|
||||||
printf("Partition 1: 0x%02x %ld sectors",
|
|
||||||
pinfo.type, pinfo.size);
|
|
||||||
|
|
||||||
if (button_was_held || (btn==BUTTON_MENU)) {
|
if (button_was_held || (btn==BUTTON_MENU)) {
|
||||||
/* If either the hold switch was on, or the Menu button was held, then
|
/* If either the hold switch was on, or the Menu button was held, then
|
||||||
try the Apple firmware */
|
try the Apple firmware */
|
||||||
|
|
|
@ -561,8 +561,15 @@ void main(void)
|
||||||
rc = disk_mount_all();
|
rc = disk_mount_all();
|
||||||
if (rc<=0)
|
if (rc<=0)
|
||||||
{
|
{
|
||||||
|
struct partinfo pinfo;
|
||||||
reset_screen();
|
reset_screen();
|
||||||
printf("No partition found");
|
printf("No partition found");
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
printf("P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
while(button_get(true) != SYS_USB_CONNECTED) {};
|
while(button_get(true) != SYS_USB_CONNECTED) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,8 +621,15 @@ void main(void)
|
||||||
rc = disk_mount_all();
|
rc = disk_mount_all();
|
||||||
if (rc<=0)
|
if (rc<=0)
|
||||||
{
|
{
|
||||||
|
struct partinfo pinfo;
|
||||||
reset_screen();
|
reset_screen();
|
||||||
printf("No partition found");
|
printf("No partition found");
|
||||||
|
for (int i = 0 ; i < NUM_VOLUMES ; i++) {
|
||||||
|
disk_partinfo(i, &pinfo);
|
||||||
|
if (pinfo.type)
|
||||||
|
printf("P%d T%02x S%08lx",
|
||||||
|
i, pinfo.type, pinfo.size);
|
||||||
|
}
|
||||||
while(button_get(true) != SYS_USB_CONNECTED) {};
|
while(button_get(true) != SYS_USB_CONNECTED) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue