summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-06-25 17:21:01 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-06-25 17:21:01 +0000
commitdfd4183a7da257a1df9979c3ced830cfd5f1e6e3 (patch)
tree593b53da5f886841717a6a363a621232a3d564fd /rbutil
parentc891ddb506f87c9be7bf8079bca7cf27abb4f49b (diff)
downloadrockbox-dfd4183a7da257a1df9979c3ced830cfd5f1e6e3.tar.gz
rockbox-dfd4183a7da257a1df9979c3ced830cfd5f1e6e3.tar.bz2
rockbox-dfd4183a7da257a1df9979c3ced830cfd5f1e6e3.zip
Fix bootloader uninstallation on Gigabeat F / X.
The "file" bootloader installation method usually can uninstall the bootloader. Some upgrade methods (like the Iaudio players) remove the bootloader file placed on the player after upgrading so those can't uninstall the bootloader. Instead of rejecting uninstallation for all players using this method check the current bootloader and only display an error if no suitable bootloader is found (which would happen in the Iaudio case). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30070 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallfile.cpp2
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp21
2 files changed, 13 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
index 7649f50e2a..58288d68de 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
@@ -141,6 +141,6 @@ BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void)
BootloaderInstallBase::Capabilities BootloaderInstallFile::capabilities(void)
{
qDebug() << "[BootloaderInstallFile] getting capabilities";
- return Install | IsFile | CanCheckInstalled | Backup;
+ return Install | Uninstall | IsFile | CanCheckInstalled | Backup;
}
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 56313f155e..59ba9e3c0e 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -1045,15 +1045,6 @@ void RbUtilQt::uninstallBootloader(void)
logger->setFinished();
return;
}
- if( (bl->capabilities() & BootloaderInstallBase::Uninstall) == 0)
- {
- logger->addItem(tr("Rockbox Utility can not uninstall the bootloader on this target. "
- "Try a normal firmware update to remove the booloader."), LOGERROR);
- logger->setFinished();
- delete bl;
- return;
- }
-
QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
QStringList blfilepath;
for(int a = 0; a < blfile.size(); a++) {
@@ -1062,6 +1053,18 @@ void RbUtilQt::uninstallBootloader(void)
}
bl->setBlFile(blfilepath);
+ BootloaderInstallBase::BootloaderType currentbl = bl->installed();
+ if((bl->capabilities() & BootloaderInstallBase::Uninstall) == 0
+ || currentbl == BootloaderInstallBase::BootloaderUnknown
+ || currentbl == BootloaderInstallBase::BootloaderOther)
+ {
+ logger->addItem(tr("Rockbox Utility can not uninstall the bootloader on this target. "
+ "Try a normal firmware update to remove the booloader."), LOGERROR);
+ logger->setFinished();
+ delete bl;
+ return;
+ }
+
connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));