* Software Update with apply the settings (Part1)

- Settings are applied to the image before flashing
- Use the function on the menu "Software Update => Expert functions
  => Write one partition => systemFS with settings"
- Log output to /tmp/update.log for testing
- Use settingsupdate.conf as config file
This commit is contained in:
micha-bbg
2012-04-13 19:07:19 +02:00
parent 37c4b21ac3
commit b001b36f4a
7 changed files with 676 additions and 4 deletions

View File

@@ -35,6 +35,7 @@
#endif
#include <gui/update.h>
#include <gui/ext_update.h>
#include <global.h>
#include <neutrino.h>
@@ -518,6 +519,14 @@ CFlashExpert::CFlashExpert()
width = w_max (40, 10);
}
CFlashExpert* CFlashExpert::getInstance()
{
static CFlashExpert* FlashExpert = NULL;
if(!FlashExpert)
FlashExpert = new CFlashExpert();
return FlashExpert;
}
void CFlashExpert::readmtd(int preadmtd)
{
char tmpStr[256];
@@ -558,7 +567,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber)
{
char message[500];
sprintf(message,
snprintf(message, sizeof(message),
g_Locale->getText(LOCALE_FLASHUPDATE_REALLYFLASHMTD),
FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(),
CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str());
@@ -613,6 +622,8 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey)
sprintf(sActionKey, "%s%d", actionkey.c_str(), lx);
mtdselector->addItem(new CMenuForwarderNonLocalized(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey, CRCInput::convertDigitToKey(shortcut++)));
}
if (actionkey == "writemtd")
mtdselector->addItem(new CMenuForwarderNonLocalized("systemFS with settings", true, NULL, this, "writemtd10", CRCInput::convertDigitToKey(shortcut++)));
mtdselector->exec(NULL,"");
delete mtdselector;
}
@@ -678,7 +689,10 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
selectedMTD = iWritemtd;
showFileSelector("");
} else {
if(selectedMTD==-1) {
if(selectedMTD == 10) {
CExtUpdate::getInstance()->writemtdExt(actionKey);
}
else if(selectedMTD==-1) {
writemtd(actionKey, MTD_OF_WHOLE_IMAGE);
} else {
writemtd(actionKey, selectedMTD);