mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Extend bootloader installation to accept alternatives for the destination filename.
Remove the hardcoded special case for the H10 bootloader installation and uninstallation. Allow multiple bootloader filenames to be present and pick the existing one on (un)installation. This is also needed for easily adding support for the Samsung YH players (to make FS#10373 actually work). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22220 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
63ba647ee0
commit
0b7bfb6270
4 changed files with 32 additions and 27 deletions
|
|
@ -187,3 +187,19 @@ QString BootloaderInstallBase::postinstallHints(QString model)
|
||||||
return QString("");
|
return QString("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! @brief set list of possible bootloader files and pick the existing one.
|
||||||
|
//! @param sl list of possible bootloader files.
|
||||||
|
void BootloaderInstallBase::setBlFile(QStringList sl)
|
||||||
|
{
|
||||||
|
// figue which of the possible bootloader filenames is correct.
|
||||||
|
for(int a = 0; a < sl.size(); a++) {
|
||||||
|
if(!resolvePathCase(sl.at(a)).isEmpty()) {
|
||||||
|
m_blfile = sl.at(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_blfile.isEmpty()) {
|
||||||
|
m_blfile = sl.at(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,8 @@ class BootloaderInstallBase : public QObject
|
||||||
//! backup a already installed bootloader
|
//! backup a already installed bootloader
|
||||||
bool backup(QString to);
|
bool backup(QString to);
|
||||||
|
|
||||||
//! set the differen filenames and paths
|
//! set the different filenames and paths
|
||||||
void setBlFile(QString f)
|
void setBlFile(QStringList f);
|
||||||
{ m_blfile = f; }
|
|
||||||
void setBlUrl(QUrl u)
|
void setBlUrl(QUrl u)
|
||||||
{ m_blurl = u; }
|
{ m_blurl = u; }
|
||||||
void setLogfile(QString f)
|
void setLogfile(QString f)
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ name="H10 (5 / 6GB) UMS"
|
||||||
buildserver_modelname=h10_5gb
|
buildserver_modelname=h10_5gb
|
||||||
bootloadermethod=mi4
|
bootloadermethod=mi4
|
||||||
bootloadername=/iriver/H10.mi4
|
bootloadername=/iriver/H10.mi4
|
||||||
bootloaderfile=/System/H10.mi4
|
bootloaderfile=/System/H10.mi4, /System/H10EMP.mi4
|
||||||
resolution=128x128x16
|
resolution=128x128x16
|
||||||
manualname=
|
manualname=
|
||||||
brand=Iriver
|
brand=Iriver
|
||||||
|
|
@ -206,7 +206,7 @@ name="H10 (5 / 6GB) MTP"
|
||||||
buildserver_modelname=h10_5gb
|
buildserver_modelname=h10_5gb
|
||||||
bootloadermethod=mi4
|
bootloadermethod=mi4
|
||||||
bootloadername=/iriver/H10_5GB-MTP/H10.mi4
|
bootloadername=/iriver/H10_5GB-MTP/H10.mi4
|
||||||
bootloaderfile=/System/H10.mi4
|
bootloaderfile=/System/H10.mi4, /System/H10EMP.mi4
|
||||||
resolution=128x128x16
|
resolution=128x128x16
|
||||||
manualname=
|
manualname=
|
||||||
brand=Iriver
|
brand=Iriver
|
||||||
|
|
|
||||||
|
|
@ -657,20 +657,13 @@ void RbUtilQt::installBootloader()
|
||||||
}
|
}
|
||||||
|
|
||||||
// set bootloader filename. Do this now as installed() needs it.
|
// set bootloader filename. Do this now as installed() needs it.
|
||||||
QString blfile;
|
QStringList blfile = RbSettings::value(RbSettings::CurBootloaderFile).toStringList();
|
||||||
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
|
QStringList blfilepath;
|
||||||
+ RbSettings::value(RbSettings::CurBootloaderFile).toString();
|
for(int a = 0; a < blfile.size(); a++) {
|
||||||
// special case for H10 pure: this player can have a different
|
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||||
// bootloader file filename. This is handled here to keep the install
|
+ blfile.at(a));
|
||||||
// class clean, though having it here is also not the nicest solution.
|
|
||||||
if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums"
|
|
||||||
|| RbSettings::value(RbSettings::Platform) == "h10_mtp") {
|
|
||||||
if(resolvePathCase(blfile).isEmpty())
|
|
||||||
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
|
|
||||||
+ RbSettings::value(RbSettings::CurBootloaderName).toString()
|
|
||||||
.replace("H10", "H10EMP", Qt::CaseInsensitive);
|
|
||||||
}
|
}
|
||||||
bl->setBlFile(blfile);
|
bl->setBlFile(blfilepath);
|
||||||
QUrl url(RbSettings::value(RbSettings::BootloaderUrl).toString()
|
QUrl url(RbSettings::value(RbSettings::BootloaderUrl).toString()
|
||||||
+ RbSettings::value(RbSettings::CurBootloaderName).toString());
|
+ RbSettings::value(RbSettings::CurBootloaderName).toString());
|
||||||
bl->setBlUrl(url);
|
bl->setBlUrl(url);
|
||||||
|
|
@ -998,16 +991,13 @@ void RbUtilQt::uninstallBootloader(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString blfile = RbSettings::value(RbSettings::Mountpoint).toString()
|
QStringList blfile = RbSettings::value(RbSettings::CurBootloaderFile).toStringList();
|
||||||
+ RbSettings::value(RbSettings::CurBootloaderFile).toString();
|
QStringList blfilepath;
|
||||||
if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums"
|
for(int a = 0; a < blfile.size(); a++) {
|
||||||
|| RbSettings::value(RbSettings::Platform).toString() == "h10_mtp") {
|
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||||
if(resolvePathCase(blfile).isEmpty())
|
+ blfile.at(a));
|
||||||
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
|
|
||||||
+ RbSettings::value(RbSettings::CurBootloaderName).toString()
|
|
||||||
.replace("H10", "H10EMP", Qt::CaseInsensitive);
|
|
||||||
}
|
}
|
||||||
bl->setBlFile(blfile);
|
bl->setBlFile(blfilepath);
|
||||||
|
|
||||||
connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
||||||
connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
|
connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue