forked from len0rd/rockbox
Clean up bootloader installation debug output a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22219 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7aaa544f09
commit
63ba647ee0
7 changed files with 40 additions and 35 deletions
|
|
@ -50,8 +50,8 @@ void BootloaderInstallBase::downloadBlStart(QUrl source)
|
|||
|
||||
void BootloaderInstallBase::downloadReqFinished(int id, bool error)
|
||||
{
|
||||
qDebug() << __FILE__ << "::" << __func__ << id << error;
|
||||
qDebug() << "error:" << m_http.errorString();
|
||||
qDebug() << "[BootloaderInstallBase] Download Request" << id
|
||||
<< "finished, error:" << m_http.errorString();
|
||||
|
||||
downloadBlFinish(error);
|
||||
}
|
||||
|
|
@ -59,7 +59,8 @@ void BootloaderInstallBase::downloadReqFinished(int id, bool error)
|
|||
|
||||
void BootloaderInstallBase::downloadBlFinish(bool error)
|
||||
{
|
||||
qDebug() << __FILE__ << "::" << __func__ << ": error =" << error;
|
||||
qDebug() << "[BootloaderInstallBase] Downloading bootloader finished, error:"
|
||||
<< error;
|
||||
|
||||
// update progress bar
|
||||
emit logProgress(100, 100);
|
||||
|
|
@ -88,7 +89,7 @@ void BootloaderInstallBase::downloadBlFinish(bool error)
|
|||
|
||||
void BootloaderInstallBase::installBlfile(void)
|
||||
{
|
||||
qDebug() << __FILE__ << __func__;
|
||||
qDebug() << "[BootloaderInstallBase]" << __func__;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -98,7 +99,7 @@ void BootloaderInstallBase::installBlfile(void)
|
|||
|
||||
bool BootloaderInstallBase::backup(QString to)
|
||||
{
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallBase] Backing up bootloader file";
|
||||
QDir targetDir(".");
|
||||
emit logItem(tr("Creating backup of original firmware file."), LOGINFO);
|
||||
if(!targetDir.mkpath(to)) {
|
||||
|
|
@ -106,7 +107,7 @@ bool BootloaderInstallBase::backup(QString to)
|
|||
return false;
|
||||
}
|
||||
QString tofile = to + "/" + QFileInfo(m_blfile).fileName();
|
||||
qDebug() << "trying to backup" << m_blfile << "to" << tofile;
|
||||
qDebug() << "[BootloaderInstallBase] trying to backup" << m_blfile << "to" << tofile;
|
||||
if(!QFile::copy(resolvePathCase(m_blfile), tofile)) {
|
||||
emit logItem(tr("Creating backup copy failed."), LOGERROR);
|
||||
return false;
|
||||
|
|
@ -128,7 +129,8 @@ int BootloaderInstallBase::logInstall(LogMode mode)
|
|||
|
||||
if(mode == LogAdd) {
|
||||
s.setValue("Bootloader/" + section, m_blversion.toString(Qt::ISODate));
|
||||
qDebug() << m_blversion.toString(Qt::ISODate);
|
||||
qDebug() << "[BootloaderInstallBase] Writing log, version:"
|
||||
<< m_blversion.toString(Qt::ISODate);
|
||||
}
|
||||
else {
|
||||
s.remove("Bootloader/" + section);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class BootloaderInstallBase : public QObject
|
|||
virtual BootloaderType installed(void)=0;
|
||||
//! returns the capabilities of the bootloader class
|
||||
virtual Capabilities capabilities(void)=0;
|
||||
//! returns a OF Firmware hint or empty if there is none
|
||||
//! returns a OF Firmware hint or empty if there is none
|
||||
virtual QString ofHint() {return QString();}
|
||||
|
||||
|
||||
|
|
@ -66,8 +66,9 @@ class BootloaderInstallBase : public QObject
|
|||
void setOfFile(QString f)
|
||||
{m_offile = f;}
|
||||
|
||||
//! returns a port Install Hint or empty if there is none
|
||||
//! static and in the base class, so the installer classes dont need to be modified for new targets
|
||||
//! returns a port Install Hint or empty if there is none
|
||||
//! static and in the base class, so the installer classes dont need to
|
||||
// be modified for new targets
|
||||
static QString postinstallHints(QString model);
|
||||
|
||||
protected slots:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ BootloaderInstallFile::BootloaderInstallFile(QObject *parent)
|
|||
bool BootloaderInstallFile::install(void)
|
||||
{
|
||||
emit logItem(tr("Downloading bootloader"), LOGINFO);
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallFile] installing bootloader";
|
||||
downloadBlStart(m_blurl);
|
||||
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
|
||||
return true;
|
||||
|
|
@ -48,7 +48,7 @@ void BootloaderInstallFile::installStage2(void)
|
|||
QString fwfile(resolvePathCase(m_blfile));
|
||||
if(!fwfile.isEmpty()) {
|
||||
QString moved = resolvePathCase(m_blfile) + ".ORIG";
|
||||
qDebug() << "renaming" << fwfile << "->" << moved;
|
||||
qDebug() << "[BootloaderInstallFile] renaming" << fwfile << "to" << moved;
|
||||
QFile::rename(fwfile, moved);
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ void BootloaderInstallFile::installStage2(void)
|
|||
|
||||
// place (new) bootloader
|
||||
m_tempfile.open();
|
||||
qDebug() << "renaming" << m_tempfile.fileName() << "->" << fwfile;
|
||||
qDebug() << "[BootloaderInstallFile] renaming" << m_tempfile.fileName() << "to" << fwfile;
|
||||
m_tempfile.close();
|
||||
m_tempfile.rename(fwfile);
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ void BootloaderInstallFile::installStage2(void)
|
|||
|
||||
bool BootloaderInstallFile::uninstall(void)
|
||||
{
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallFile] Uninstalling bootloader";
|
||||
emit logItem(tr("Removing Rockbox bootloader"), LOGINFO);
|
||||
// check if a .ORIG file is present, and allow moving it back.
|
||||
QString origbl = resolvePathCase(m_blfile + ".ORIG");
|
||||
|
|
@ -127,7 +127,7 @@ bool BootloaderInstallFile::uninstall(void)
|
|||
//! @return BootloaderRockbox, BootloaderOther or BootloaderUnknown.
|
||||
BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void)
|
||||
{
|
||||
qDebug("%s()", __func__);
|
||||
qDebug() << "[BootloaderInstallFile] checking installed bootloader";
|
||||
if(!resolvePathCase(m_blfile).isEmpty()
|
||||
&& !resolvePathCase(m_blfile + ".ORIG").isEmpty())
|
||||
return BootloaderRockbox;
|
||||
|
|
@ -140,7 +140,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void)
|
|||
|
||||
BootloaderInstallBase::Capabilities BootloaderInstallFile::capabilities(void)
|
||||
{
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallFile] getting capabilities";
|
||||
return Install | IsFile | CanCheckInstalled | Backup;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ bool BootloaderInstallHex::install(void)
|
|||
file.close();
|
||||
QString hash = QCryptographicHash::hash(filedata,
|
||||
QCryptographicHash::Md5).toHex();
|
||||
qDebug() << "hexfile hash:" << hash;
|
||||
qDebug() << "[BootloaderInstallHex] hexfile hash:" << hash;
|
||||
if(file.error() != QFile::NoError) {
|
||||
emit logItem(tr("Could not verify original firmware file"), LOGERROR);
|
||||
emit done(true);
|
||||
|
|
@ -112,7 +112,7 @@ bool BootloaderInstallHex::install(void)
|
|||
int result;
|
||||
result = iriver_decode(m_offile.toAscii().data(),
|
||||
m_descrambled.fileName().toAscii().data(), FALSE, STRIP_NONE);
|
||||
qDebug() << "iriver_decode" << result;
|
||||
qDebug() << "[BootloaderInstallHex] iriver_decode" << result;
|
||||
|
||||
if(result < 0) {
|
||||
emit logItem(tr("Error in descramble: %1").arg(scrambleError(result)), LOGERROR);
|
||||
|
|
@ -200,7 +200,7 @@ void BootloaderInstallHex::installStage2(void)
|
|||
targethex.close();
|
||||
QString hash = QCryptographicHash::hash(filedata,
|
||||
QCryptographicHash::Md5).toHex();
|
||||
qDebug() << "created hexfile hash:" << hash;
|
||||
qDebug() << "[BootloaderInstallHex] created hexfile hash:" << hash;
|
||||
|
||||
emit logItem(tr("Checking modified firmware file"), LOGINFO);
|
||||
if(hash != QString(md5sums[m_hashindex].patched)) {
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ void BootloaderInstallIpod::installStage2(void)
|
|||
emit done(true);
|
||||
return;
|
||||
}
|
||||
qDebug() << "version installed:" << m_blversion.toString(Qt::ISODate);
|
||||
qDebug() << "[BootloaderInstallIpod] version installed:" << m_blversion.toString(Qt::ISODate);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -203,17 +203,17 @@ BootloaderInstallBase::BootloaderType BootloaderInstallIpod::installed(void)
|
|||
BootloaderInstallBase::BootloaderType result = BootloaderRockbox;
|
||||
|
||||
if(!ipodInitialize(&ipod)) {
|
||||
qDebug() << "BootloaderInstallIpod::installed(): BootloaderUnknown";
|
||||
qDebug() << "[BootloaderInstallIpod] installed: BootloaderUnknown";
|
||||
result = BootloaderUnknown;
|
||||
}
|
||||
else {
|
||||
read_directory(&ipod);
|
||||
if(ipod.ipod_directory[0].entryOffset == 0) {
|
||||
qDebug() << "BootloaderInstallIpod::installed(): BootloaderOther";
|
||||
qDebug() << "[BootloaderInstallIpod] installed: BootloaderOther";
|
||||
result = BootloaderOther;
|
||||
}
|
||||
else {
|
||||
qDebug() << "BootloaderInstallIpod::installed(): BootloaderRockbox";
|
||||
qDebug() << "[BootloaderInstallIpod] installed: BootloaderRockbox";
|
||||
}
|
||||
}
|
||||
ipod_close(&ipod);
|
||||
|
|
@ -243,7 +243,8 @@ bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod)
|
|||
qPrintable(Autodetection::resolveDevicename(m_blfile)
|
||||
.remove(QRegExp("[0-9]+$"))));
|
||||
#endif
|
||||
qDebug() << "ipodpatcher: overriding scan, using" << ipod->diskname;
|
||||
qDebug() << "[BootloaderInstallIpod] ipodpatcher: overriding scan, using"
|
||||
<< ipod->diskname;
|
||||
}
|
||||
else {
|
||||
ipod_scan(ipod);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent)
|
|||
bool BootloaderInstallMi4::install(void)
|
||||
{
|
||||
emit logItem(tr("Downloading bootloader"), LOGINFO);
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallMi4] installing bootloader";
|
||||
downloadBlStart(m_blurl);
|
||||
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
|
||||
return true;
|
||||
|
|
@ -49,17 +49,17 @@ void BootloaderInstallMi4::installStage2(void)
|
|||
QString moved = QFileInfo(resolvePathCase(m_blfile)).absolutePath()
|
||||
+ "/OF.mi4";
|
||||
if(!QFileInfo(moved).exists()) {
|
||||
qDebug() << "renaming" << fwfile << "->" << moved;
|
||||
qDebug() << "[BootloaderInstallMi4] renaming" << fwfile << "to" << moved;
|
||||
oldbl.rename(moved);
|
||||
}
|
||||
else {
|
||||
qDebug() << "OF.mi4 already present, not renaming again.";
|
||||
qDebug() << "[BootloaderInstallMi4] OF.mi4 already present, not renaming again.";
|
||||
oldbl.remove();
|
||||
}
|
||||
|
||||
// place new bootloader
|
||||
m_tempfile.open();
|
||||
qDebug() << "renaming" << m_tempfile.fileName() << "->" << fwfile;
|
||||
qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() << "to" << fwfile;
|
||||
m_tempfile.close();
|
||||
m_tempfile.rename(fwfile);
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ void BootloaderInstallMi4::installStage2(void)
|
|||
|
||||
bool BootloaderInstallMi4::uninstall(void)
|
||||
{
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallMi4] Uninstalling bootloader";
|
||||
|
||||
// check if it's actually a Rockbox bootloader
|
||||
emit logItem(tr("Checking for Rockbox bootloader"), LOGINFO);
|
||||
|
|
@ -117,7 +117,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
|
|||
QString resolved;
|
||||
resolved = resolvePathCase(m_blfile);
|
||||
if(resolved.isEmpty()) {
|
||||
qDebug("%s: BootloaderNone", __func__);
|
||||
qDebug() << "[BootloaderInstallMi4] installed: BootloaderNone";
|
||||
return BootloaderNone;
|
||||
}
|
||||
|
||||
|
|
@ -129,11 +129,11 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
|
|||
f.close();
|
||||
|
||||
if(!memcmp(magic, "RBBL", 4)) {
|
||||
qDebug("%s: BootloaderRockbox", __func__);
|
||||
qDebug() << "[BootloaderInstallMi4] installed: BootloaderRockbox";
|
||||
return BootloaderRockbox;
|
||||
}
|
||||
else {
|
||||
qDebug("%s: BootloaderOther", __func__);
|
||||
qDebug() << "[BootloaderInstallMi4] installed: BootloaderOther";
|
||||
return BootloaderOther;
|
||||
}
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
|
|||
|
||||
BootloaderInstallBase::Capabilities BootloaderInstallMi4::capabilities(void)
|
||||
{
|
||||
qDebug() << __func__;
|
||||
qDebug() << "[BootloaderInstallMi4] getting capabilities";
|
||||
return Install | Uninstall | Backup | IsFile | CanCheckInstalled | CanCheckVersion;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ void BootloaderInstallSansa::installStage2(void)
|
|||
m_tempfile.close();
|
||||
if(memcmp(sansa.targetname, magic, 4) != 0) {
|
||||
emit logItem(tr("Bootloader mismatch! Aborting."), LOGERROR);
|
||||
qDebug("[BL-Sansa] Targetname: %s, mi4 magic: %c%c%c%c",
|
||||
qDebug("[BootloaderInstallSansa] Targetname: %s, mi4 magic: %c%c%c%c",
|
||||
sansa.targetname, magic[0], magic[1], magic[2], magic[3]);
|
||||
emit done(true);
|
||||
sansa_close(&sansa);
|
||||
|
|
@ -230,7 +230,8 @@ bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa)
|
|||
sprintf(sansa->diskname,
|
||||
qPrintable(Autodetection::resolveDevicename(m_blfile).remove(QRegExp("[0-9]+$"))));
|
||||
#endif
|
||||
qDebug() << "sansapatcher: overriding scan, using" << sansa->diskname;
|
||||
qDebug() << "[BootloaderInstallSansa] sansapatcher: overriding scan, using"
|
||||
<< sansa->diskname;
|
||||
}
|
||||
else if(sansa_scan(sansa) != 1) {
|
||||
emit logItem(tr("Can't find Sansa"), LOGERROR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue