forked from len0rd/rockbox
Add error messages to a few more failure cases to beastpatcher.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26978 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b40c300d59
commit
9d242ab167
1 changed files with 10 additions and 1 deletions
|
@ -170,11 +170,13 @@ int beastpatcher(const char* bootfile, const char* firmfile, int interactive)
|
||||||
|
|
||||||
if (bootfile) {
|
if (bootfile) {
|
||||||
if(readfile(bootfile, &bootloader) != 0) {
|
if(readfile(bootfile, &bootloader) != 0) {
|
||||||
|
fprintf(stderr,"[ERR] Reading bootloader file failed.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (firmfile) {
|
if (firmfile) {
|
||||||
if(readfile(firmfile, &firmware) != 0) {
|
if(readfile(firmfile, &firmware) != 0) {
|
||||||
|
fprintf(stderr,"[ERR] Reading firmware file failed.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +213,11 @@ int beastpatcher(const char* bootfile, const char* firmfile, int interactive)
|
||||||
{
|
{
|
||||||
if(firmfile) {
|
if(firmfile) {
|
||||||
/* if a firmware file is given create a dualboot image. */
|
/* if a firmware file is given create a dualboot image. */
|
||||||
mknkboot(&firmware, &bootloader, &fw);
|
if(mknkboot(&firmware, &bootloader, &fw))
|
||||||
|
{
|
||||||
|
fprintf(stderr,"[ERR] Creating dualboot firmware failed.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Create a single-boot bootloader from the embedded bootloader */
|
/* Create a single-boot bootloader from the embedded bootloader */
|
||||||
|
@ -219,7 +225,10 @@ int beastpatcher(const char* bootfile, const char* firmfile, int interactive)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fw.buf == NULL)
|
if (fw.buf == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"[ERR] Creating the bootloader failed.\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (mtp_send_firmware(&mtp_info, fw.buf, fw.len) == 0)
|
if (mtp_send_firmware(&mtp_info, fw.buf, fw.len) == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue