summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-04 19:40:43 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-04 19:40:43 +0000
commit38f03d4eaed0952bc1c866d46a10f783f2b895b2 (patch)
tree568ac45d9777e840c0889789701e2e9b79702e88 /rbutil/rbutilqt
parent38890ac6dc1e3cebb90e60d70cea8da8009ee8da (diff)
downloadrockbox-38f03d4eaed0952bc1c866d46a10f783f2b895b2.tar.gz
rockbox-38f03d4eaed0952bc1c866d46a10f783f2b895b2.zip
sansapatcher: factor out handling of bundled bootloaders.
Instead of handling bundled bootloaders in the sansapatcher functions leave that to the caller. This removes the need to have Rockbox Utility specific parts in sansapatcher. sansa_add_bootloader() now operates on an already loaded bootloader. For loading a convenience function sansa_read_bootloader() is added. This also introduces a new check on loading to prevent installing an e200 bootloader on a c200 (and vice versa). These changes will allow building a libsansapatcher for linking with Rockbox Utility later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31144 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallsansa.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
index b07ddfad93..ae46df273d 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
@@ -96,6 +96,8 @@ bool BootloaderInstallSansa::install(void)
void BootloaderInstallSansa::installStage2(void)
{
struct sansa_t sansa;
+ unsigned char* buf = NULL;
+ unsigned int len;
emit logItem(tr("Installing Rockbox bootloader"), LOGINFO);
QCoreApplication::processEvents();
@@ -130,8 +132,8 @@ void BootloaderInstallSansa::installStage2(void)
return;
}
- if(sansa_add_bootloader(&sansa, blfile.toLatin1().data(),
- FILETYPE_MI4) == 0) {
+ len = sansa_read_bootloader(&sansa, blfile.toLatin1().data(), &buf);
+ if(sansa_add_bootloader(&sansa, buf, len) == 0) {
emit logItem(tr("Successfully installed bootloader"), LOGOK);
sansa_close(&sansa);
#if defined(Q_OS_MACX)