summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/bootloaderinstallams.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-09 17:32:30 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-09 19:51:08 +0200
commita2c3e3fd0dee8ba65e0bb1bd3216fb5df9efcb74 (patch)
tree714fafda40577cf05797dafc06512c43394ae4e8 /rbutil/rbutilqt/base/bootloaderinstallams.cpp
parent9574b300666acfdef3e364d87bdea4bdcf4832e0 (diff)
downloadrockbox-a2c3e3fd0dee8ba65e0bb1bd3216fb5df9efcb74.tar.gz
rockbox-a2c3e3fd0dee8ba65e0bb1bd3216fb5df9efcb74.zip
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
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallams.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallams.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallams.cpp b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
index 132578bee7..051093eccc 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallams.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
@@ -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);