From 46e56582b02f833983c7c9244f3b597424089559 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 22 Nov 2009 21:03:07 +0000 Subject: Fix Sansa bootloader installation on OS X. - adjust the regex to figure the correct drive from the partition name. - move the check for an old bootloader into the first installation step -- it's a fatal problem so it should appear as soon as possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23715 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/base/bootloaderinstallsansa.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'rbutil/rbutilqt/base/bootloaderinstallsansa.cpp') diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp index 43404de4bb..e57a7f9c24 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp @@ -75,6 +75,15 @@ bool BootloaderInstallSansa::install(void) emit done(true); return false; } + if(sansa.hasoldbootloader) { + emit logItem(tr("OLD ROCKBOX INSTALLATION DETECTED, ABORTING.\n" + "You must reinstall the original Sansa firmware before running\n" + "sansapatcher for the first time.\n" + "See http://www.rockbox.org/wiki/SansaE200Install\n"), + LOGERROR); + emit done(true); + return false; + } emit logItem(tr("Downloading bootloader file"), LOGINFO); downloadBlStart(m_blurl); @@ -96,16 +105,6 @@ void BootloaderInstallSansa::installStage2(void) return; } - if(sansa.hasoldbootloader) { - emit logItem(tr("OLD ROCKBOX INSTALLATION DETECTED, ABORTING.\n" - "You must reinstall the original Sansa firmware before running\n" - "sansapatcher for the first time.\n" - "See http://www.rockbox.org/wiki/SansaE200Install\n"), - LOGERROR); - emit done(true); - return; - } - if(sansa_reopen_rw(&sansa) < 0) { emit logItem(tr("Could not open Sansa in R/W mode"), LOGERROR); emit done(true); @@ -226,6 +225,9 @@ bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa) #if defined(Q_OS_WIN32) sprintf(sansa->diskname, "\\\\.\\PhysicalDrive%i", Autodetection::resolveDevicename(m_blfile).toInt()); +#elif defined(Q_OS_MACX) + sprintf(sansa->diskname, + qPrintable(Autodetection::resolveDevicename(m_blfile).remove(QRegExp("s[0-9]+$")))); #else sprintf(sansa->diskname, qPrintable(Autodetection::resolveDevicename(m_blfile).remove(QRegExp("[0-9]+$")))); -- cgit v1.2.3