diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-06-09 17:32:30 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-06-09 19:51:08 +0200 |
commit | a2c3e3fd0dee8ba65e0bb1bd3216fb5df9efcb74 (patch) | |
tree | 714fafda40577cf05797dafc06512c43394ae4e8 | |
parent | 9574b300666acfdef3e364d87bdea4bdcf4832e0 (diff) | |
download | rockbox-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
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallams.cpp | 36 |
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() | |||
40 | "<a href='http://www.rockbox.org/manual.shtml'>manual</a> and " | 40 | "<a href='http://www.rockbox.org/manual.shtml'>manual</a> and " |
41 | "the <a href='http://www.rockbox.org/wiki/SansaAMS'>SansaAMS</a> " | 41 | "the <a href='http://www.rockbox.org/wiki/SansaAMS'>SansaAMS</a> " |
42 | "wiki page on how to obtain this file.<br/>" | 42 | "wiki page on how to obtain this file.<br/>" |
43 | "<b>Note:</b> This file is not present on your player and will " | ||
44 | "disappear automatically after installing it.<br/><br/>" | ||
43 | "Press Ok to continue and browse your computer for the firmware " | 45 | "Press Ok to continue and browse your computer for the firmware " |
44 | "file."); | 46 | "file."); |
45 | } | 47 | } |
@@ -48,22 +50,22 @@ bool BootloaderInstallAms::install(void) | |||
48 | { | 50 | { |
49 | if(m_offile.isEmpty()) | 51 | if(m_offile.isEmpty()) |
50 | return false; | 52 | return false; |
51 | 53 | ||
52 | qDebug() << "[BootloaderInstallAms] installing bootloader"; | 54 | qDebug() << "[BootloaderInstallAms] installing bootloader"; |
53 | 55 | ||
54 | // download firmware from server | 56 | // download firmware from server |
55 | emit logItem(tr("Downloading bootloader file"), LOGINFO); | 57 | emit logItem(tr("Downloading bootloader file"), LOGINFO); |
56 | 58 | ||
57 | connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); | 59 | connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); |
58 | downloadBlStart(m_blurl); | 60 | downloadBlStart(m_blurl); |
59 | 61 | ||
60 | return true; | 62 | return true; |
61 | } | 63 | } |
62 | 64 | ||
63 | void BootloaderInstallAms::installStage2(void) | 65 | void BootloaderInstallAms::installStage2(void) |
64 | { | 66 | { |
65 | qDebug() << "[BootloaderInstallAms] installStage2"; | 67 | qDebug() << "[BootloaderInstallAms] installStage2"; |
66 | 68 | ||
67 | unsigned char* buf; | 69 | unsigned char* buf; |
68 | unsigned char* of_packed; | 70 | unsigned char* of_packed; |
69 | int of_packedsize; | 71 | int of_packedsize; |
@@ -79,9 +81,9 @@ void BootloaderInstallAms::installStage2(void) | |||
79 | int patchable; | 81 | int patchable; |
80 | int totalsize; | 82 | int totalsize; |
81 | char errstr[200]; | 83 | char errstr[200]; |
82 | 84 | ||
83 | sum.md5 = md5sum; | 85 | sum.md5 = md5sum; |
84 | 86 | ||
85 | m_tempfile.open(); | 87 | m_tempfile.open(); |
86 | QString bootfile = m_tempfile.fileName(); | 88 | QString bootfile = m_tempfile.fileName(); |
87 | m_tempfile.close(); | 89 | m_tempfile.close(); |
@@ -91,14 +93,14 @@ void BootloaderInstallAms::installStage2(void) | |||
91 | &bootloader_size,&rb_packedsize, | 93 | &bootloader_size,&rb_packedsize, |
92 | errstr,sizeof(errstr)); | 94 | errstr,sizeof(errstr)); |
93 | if (rb_packed == NULL) | 95 | if (rb_packed == NULL) |
94 | { | 96 | { |
95 | qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile; | 97 | qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile; |
96 | emit logItem(errstr, LOGERROR); | 98 | emit logItem(errstr, LOGERROR); |
97 | emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); | 99 | emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); |
98 | emit done(true); | 100 | emit done(true); |
99 | return; | 101 | return; |
100 | } | 102 | } |
101 | 103 | ||
102 | /* Load original firmware file */ | 104 | /* Load original firmware file */ |
103 | buf = load_of_file(m_offile.toLocal8Bit().data(), model, &len, &sum, | 105 | buf = load_of_file(m_offile.toLocal8Bit().data(), model, &len, &sum, |
104 | &firmware_size, &of_packed ,&of_packedsize, | 106 | &firmware_size, &of_packed ,&of_packedsize, |
@@ -129,16 +131,16 @@ void BootloaderInstallAms::installStage2(void) | |||
129 | emit done(true); | 131 | emit done(true); |
130 | return; | 132 | return; |
131 | } | 133 | } |
132 | 134 | ||
133 | /* patch the firmware */ | 135 | /* patch the firmware */ |
134 | emit logItem(tr("Patching Firmware..."), LOGINFO); | 136 | emit logItem(tr("Patching Firmware..."), LOGINFO); |
135 | 137 | ||
136 | patch_firmware(sum.model,firmware_revision(sum.model),firmware_size,buf, | 138 | patch_firmware(sum.model,firmware_revision(sum.model),firmware_size,buf, |
137 | len,of_packed,of_packedsize,rb_packed,rb_packedsize); | 139 | len,of_packed,of_packedsize,rb_packed,rb_packedsize); |
138 | 140 | ||
139 | /* write out file */ | 141 | /* write out file */ |
140 | QFile out(m_blfile); | 142 | QFile out(m_blfile); |
141 | 143 | ||
142 | if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate)) | 144 | if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate)) |
143 | { | 145 | { |
144 | qDebug() << "[BootloaderInstallAms] Could not open" << m_blfile << "for writing"; | 146 | qDebug() << "[BootloaderInstallAms] Could not open" << m_blfile << "for writing"; |
@@ -149,7 +151,7 @@ void BootloaderInstallAms::installStage2(void) | |||
149 | emit done(true); | 151 | emit done(true); |
150 | return; | 152 | return; |
151 | } | 153 | } |
152 | 154 | ||
153 | n = out.write((char*)buf, len); | 155 | n = out.write((char*)buf, len); |
154 | 156 | ||
155 | if (n != len) | 157 | if (n != len) |
@@ -164,11 +166,11 @@ void BootloaderInstallAms::installStage2(void) | |||
164 | } | 166 | } |
165 | 167 | ||
166 | out.close(); | 168 | out.close(); |
167 | 169 | ||
168 | free(buf); | 170 | free(buf); |
169 | free(of_packed); | 171 | free(of_packed); |
170 | free(rb_packed); | 172 | free(rb_packed); |
171 | 173 | ||
172 | //end of install | 174 | //end of install |
173 | qDebug() << "[BootloaderInstallAms] install successfull"; | 175 | qDebug() << "[BootloaderInstallAms] install successfull"; |
174 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); | 176 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); |