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
This commit is contained in:
Dominik Riebeling 2009-11-22 21:03:07 +00:00
parent 628cbae4ed
commit 46e56582b0

View file

@ -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]+$"))));