Add note to AMS bootloader installation about OF file.

Some devices contain a bin file in the root folder of the player. This caused
confusion a couple of times, since the installer asks for a bin file. Add a
note that the required file is not present on the player and will get removed
automatically.

Change-Id: I6cd5c25b319770555c3939377a3ed86ed3181dad
This commit is contained in:
Dominik Riebeling 2013-06-09 17:32:30 +02:00
parent 9574b30066
commit a2c3e3fd0d

View file

@ -40,6 +40,8 @@ QString BootloaderInstallAms::ofHint()
"<a href='http://www.rockbox.org/manual.shtml'>manual</a> and "
"the <a href='http://www.rockbox.org/wiki/SansaAMS'>SansaAMS</a> "
"wiki page on how to obtain this file.<br/>"
"<b>Note:</b> This file is not present on your player and will "
"disappear automatically after installing it.<br/><br/>"
"Press Ok to continue and browse your computer for the firmware "
"file.");
}
@ -48,22 +50,22 @@ bool BootloaderInstallAms::install(void)
{
if(m_offile.isEmpty())
return false;
qDebug() << "[BootloaderInstallAms] installing bootloader";
// download firmware from server
emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
downloadBlStart(m_blurl);
return true;
}
void BootloaderInstallAms::installStage2(void)
{
{
qDebug() << "[BootloaderInstallAms] installStage2";
unsigned char* buf;
unsigned char* of_packed;
int of_packedsize;
@ -79,9 +81,9 @@ void BootloaderInstallAms::installStage2(void)
int patchable;
int totalsize;
char errstr[200];
sum.md5 = md5sum;
sum.md5 = md5sum;
m_tempfile.open();
QString bootfile = m_tempfile.fileName();
m_tempfile.close();
@ -91,14 +93,14 @@ void BootloaderInstallAms::installStage2(void)
&bootloader_size,&rb_packedsize,
errstr,sizeof(errstr));
if (rb_packed == NULL)
{
{
qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile;
emit logItem(errstr, LOGERROR);
emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR);
emit done(true);
return;
}
/* Load original firmware file */
buf = load_of_file(m_offile.toLocal8Bit().data(), model, &len, &sum,
&firmware_size, &of_packed ,&of_packedsize,
@ -129,16 +131,16 @@ void BootloaderInstallAms::installStage2(void)
emit done(true);
return;
}
/* patch the firmware */
emit logItem(tr("Patching Firmware..."), LOGINFO);
patch_firmware(sum.model,firmware_revision(sum.model),firmware_size,buf,
len,of_packed,of_packedsize,rb_packed,rb_packedsize);
/* write out file */
QFile out(m_blfile);
if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
qDebug() << "[BootloaderInstallAms] Could not open" << m_blfile << "for writing";
@ -149,7 +151,7 @@ void BootloaderInstallAms::installStage2(void)
emit done(true);
return;
}
n = out.write((char*)buf, len);
if (n != len)
@ -164,11 +166,11 @@ void BootloaderInstallAms::installStage2(void)
}
out.close();
free(buf);
free(of_packed);
free(rb_packed);
//end of install
qDebug() << "[BootloaderInstallAms] install successfull";
emit logItem(tr("Success: modified firmware file created"), LOGINFO);