From 38f03d4eaed0952bc1c866d46a10f783f2b895b2 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 4 Dec 2011 19:40:43 +0000 Subject: 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 --- rbutil/rbutilqt/base/bootloaderinstallsansa.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rbutil/rbutilqt/base/bootloaderinstallsansa.cpp') 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) -- cgit v1.2.3