summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-04-26 22:01:33 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-04-26 22:01:33 +0200
commit7f9bb7b823f1fadb56417eb1b1a02b6a7a6aac97 (patch)
tree02b062b56bb17aedab3ee9e3278c449de9cc67f4 /rbutil/rbutilqt/base
parentb623b97d4084f1dc0d92da8d932833004e331982 (diff)
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
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallmi4.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
index b2d8d0c24b..8bce8212a9 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
@@ -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);