mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
MI4 bootloader: check for copy result.
As for BootloaderInstallFile check if copying the bootloader file to the player did actually work or if an already present file caused the copy operation to fail. Change-Id: I2e889610b4cb9f57f73cffc473c6230be0d11e24
This commit is contained in:
parent
b623b97d40
commit
7f9bb7b823
1 changed files with 15 additions and 2 deletions
|
|
@ -58,9 +58,22 @@ void BootloaderInstallMi4::installStage2(void)
|
|||
|
||||
// place new bootloader
|
||||
m_tempfile.open();
|
||||
qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() << "to" << fwfile;
|
||||
qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName()
|
||||
<< "to" << fwfile;
|
||||
m_tempfile.close();
|
||||
m_tempfile.copy(fwfile);
|
||||
if(!Utils::resolvePathCase(fwfile).isEmpty()) {
|
||||
emit logItem(tr("A firmware file is already present on player"), LOGERROR);
|
||||
emit done(true);
|
||||
return;
|
||||
}
|
||||
if(m_tempfile.copy(fwfile)) {
|
||||
emit logItem(tr("Bootloader successful installed"), LOGOK);
|
||||
}
|
||||
else {
|
||||
emit logItem(tr("Copying modified firmware file failed"), LOGERROR);
|
||||
emit done(true);
|
||||
return;
|
||||
}
|
||||
|
||||
emit logItem(tr("Bootloader successful installed"), LOGOK);
|
||||
logInstall(LogAdd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue