mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
Apollo/Kronos: Use backup with readmtdJFFS2() also for var partition
Origin commit data
------------------
Branch: ni/coolstream
Commit: 6121e57fbc
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-09-22 (Tue, 22 Sep 2015)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -586,6 +586,7 @@ flashupdate.createimage_add_kernel 'kernel' hinzufügen
|
|||||||
flashupdate.createimage_add_spare 'spare' hinzufügen
|
flashupdate.createimage_add_spare 'spare' hinzufügen
|
||||||
flashupdate.createimage_add_u_boot 'u-boot' hinzufügen
|
flashupdate.createimage_add_u_boot 'u-boot' hinzufügen
|
||||||
flashupdate.createimage_add_uldr 'uldr' hinzufügen
|
flashupdate.createimage_add_uldr 'uldr' hinzufügen
|
||||||
|
flashupdate.createimage_add_var Datenpartition 'var' sichern
|
||||||
flashupdate.createimage_menu Aktuelle Software sichern
|
flashupdate.createimage_menu Aktuelle Software sichern
|
||||||
flashupdate.createimage_options Einstellungen
|
flashupdate.createimage_options Einstellungen
|
||||||
flashupdate.createimage_other Image für %s STB erstellen
|
flashupdate.createimage_other Image für %s STB erstellen
|
||||||
|
@@ -587,6 +587,7 @@ flashupdate.createimage_add_kernel Add 'kernel' to image
|
|||||||
flashupdate.createimage_add_spare Add 'spare' to image
|
flashupdate.createimage_add_spare Add 'spare' to image
|
||||||
flashupdate.createimage_add_u_boot Add 'u-boot' to image
|
flashupdate.createimage_add_u_boot Add 'u-boot' to image
|
||||||
flashupdate.createimage_add_uldr Add 'uldr' to image
|
flashupdate.createimage_add_uldr Add 'uldr' to image
|
||||||
|
flashupdate.createimage_add_var Add 'var' to image
|
||||||
flashupdate.createimage_menu Save current software
|
flashupdate.createimage_menu Save current software
|
||||||
flashupdate.createimage_options Options
|
flashupdate.createimage_options Options
|
||||||
flashupdate.createimage_other Create image for %s STB
|
flashupdate.createimage_other Create image for %s STB
|
||||||
|
@@ -700,38 +700,44 @@ bool CFlashExpert::readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_dev
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFlashExpert::readmtdJFFS2(std::string &filename)
|
void CFlashExpert::readmtdJFFS2(std::string &filename, std::string title/*=""*/, std::string path/*="/"*/, bool makeDevTable/*=true*/)
|
||||||
{
|
{
|
||||||
if (!checkSize(-1, filename))
|
if (!checkSize(-1, filename))
|
||||||
return;
|
return;
|
||||||
CProgressWindow progress;
|
CProgressWindow progress;
|
||||||
progress.setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH);
|
if (title == "")
|
||||||
|
progress.setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH);
|
||||||
|
else
|
||||||
|
progress.setTitle(g_Locale->getText(LOCALE_FLASHUPDATE_TITLEREADFLASH) + title);
|
||||||
progress.paint();
|
progress.paint();
|
||||||
|
|
||||||
bool devtableFileIO = false;
|
|
||||||
CMkfsJFFS2::v_devtable_t v_devtable;
|
|
||||||
std::string devtableFile = (std::string)CONFIGDIR + "/devtable.txt";
|
|
||||||
if (file_exists(devtableFile.c_str())) {
|
|
||||||
if (readDevtableFile(devtableFile, v_devtable))
|
|
||||||
devtableFileIO = true;
|
|
||||||
}
|
|
||||||
if ((!devtableFileIO) || (v_devtable.empty())) {
|
|
||||||
v_devtable.push_back("/dev/console c 0600 0 0 5 1 0 0 0");
|
|
||||||
v_devtable.push_back("/dev/null c 0666 0 0 1 3 0 0 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string path = "/";
|
|
||||||
int eSize = CMTDInfo::getInstance()->getMTDEraseSize(CMTDInfo::getInstance()->findMTDsystem());
|
int eSize = CMTDInfo::getInstance()->getMTDEraseSize(CMTDInfo::getInstance()->findMTDsystem());
|
||||||
if (createimage_other == 1) {
|
if (createimage_other == 1) {
|
||||||
if (eSize == 0x40000) eSize = 0x20000;
|
if (eSize == 0x40000) eSize = 0x20000;
|
||||||
else if (eSize == 0x20000) eSize = 0x40000;
|
else if (eSize == 0x20000) eSize = 0x40000;
|
||||||
}
|
}
|
||||||
CMkfsJFFS2 mkfs;
|
CMkfsJFFS2 mkfs;
|
||||||
mkfs.makeJffs2Image(path, filename, eSize, 0, 0, __LITTLE_ENDIAN, true, true, &progress, &v_devtable);
|
if (makeDevTable) {
|
||||||
|
CMkfsJFFS2::v_devtable_t v_devtable;
|
||||||
|
bool devtableFileIO = false;
|
||||||
|
std::string devtableFile = (std::string)CONFIGDIR + "/devtable.txt";
|
||||||
|
if (file_exists(devtableFile.c_str())) {
|
||||||
|
if (readDevtableFile(devtableFile, v_devtable))
|
||||||
|
devtableFileIO = true;
|
||||||
|
}
|
||||||
|
if (!devtableFileIO || v_devtable.empty()) {
|
||||||
|
v_devtable.push_back("/dev/console c 0600 0 0 5 1 0 0 0");
|
||||||
|
v_devtable.push_back("/dev/null c 0666 0 0 1 3 0 0 0");
|
||||||
|
}
|
||||||
|
mkfs.makeJffs2Image(path, filename, eSize, 0, 0, __LITTLE_ENDIAN, true, true, &progress, &v_devtable);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mkfs.makeJffs2Image(path, filename, eSize, 0, 0, __LITTLE_ENDIAN, true, true, &progress);
|
||||||
|
|
||||||
progress.hide();
|
progress.hide();
|
||||||
|
|
||||||
char message[500];
|
char message[500];
|
||||||
sprintf(message, g_Locale->getText(LOCALE_FLASHUPDATE_SAVESUCCESS), filename.c_str());
|
snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_FLASHUPDATE_SAVESUCCESS), filename.c_str());
|
||||||
ShowHint(LOCALE_MESSAGEBOX_INFO, message);
|
ShowHint(LOCALE_MESSAGEBOX_INFO, message);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -763,8 +769,13 @@ void CFlashExpert::readmtd(int preadmtd)
|
|||||||
filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd) + timeStr + tankStr + ".img";
|
filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd) + timeStr + tankStr + ".img";
|
||||||
|
|
||||||
#ifdef BOXMODEL_APOLLO
|
#ifdef BOXMODEL_APOLLO
|
||||||
|
std::string title = " [" + CMTDInfo::getInstance()->getMTDName(preadmtd) + "]";
|
||||||
if (preadmtd == 0) {
|
if (preadmtd == 0) {
|
||||||
readmtdJFFS2(filename);
|
readmtdJFFS2(filename, title);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (preadmtd == 1) {
|
||||||
|
readmtdJFFS2(filename, title, "/var", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1034,6 +1045,9 @@ int CFlashExpertSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
cfe->forceOtherFilename = false;
|
cfe->forceOtherFilename = false;
|
||||||
cfe->otherFilename = "";
|
cfe->otherFilename = "";
|
||||||
|
|
||||||
|
if (g_settings.flashupdate_createimage_add_var == 1)
|
||||||
|
cfe->readmtd(1);
|
||||||
|
|
||||||
cfe->readmtd(0);
|
cfe->readmtd(0);
|
||||||
|
|
||||||
if (g_settings.flashupdate_createimage_add_uldr == 1)
|
if (g_settings.flashupdate_createimage_add_uldr == 1)
|
||||||
@@ -1067,6 +1081,8 @@ int CFlashExpertSetup::showMenu()
|
|||||||
|
|
||||||
CMenuSeparator *s1 = new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_FLASHUPDATE_CREATEIMAGE_OPTIONS);
|
CMenuSeparator *s1 = new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_FLASHUPDATE_CREATEIMAGE_OPTIONS);
|
||||||
CMenuForwarder *m1 = new CMenuForwarder(LOCALE_FLASHUPDATE_CREATEIMAGE, true, NULL, this, "readmtd0", CRCInput::convertDigitToKey(0));
|
CMenuForwarder *m1 = new CMenuForwarder(LOCALE_FLASHUPDATE_CREATEIMAGE, true, NULL, this, "readmtd0", CRCInput::convertDigitToKey(0));
|
||||||
|
CMenuOptionChooser *m8 = new CMenuOptionChooser(LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_VAR, &g_settings.flashupdate_createimage_add_var,
|
||||||
|
MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
|
||||||
CMenuOptionChooser *m2 = new CMenuOptionChooser(LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ULDR, &g_settings.flashupdate_createimage_add_uldr,
|
CMenuOptionChooser *m2 = new CMenuOptionChooser(LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ULDR, &g_settings.flashupdate_createimage_add_uldr,
|
||||||
MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
|
MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
|
||||||
#ifndef UBOOT_BIN
|
#ifndef UBOOT_BIN
|
||||||
@@ -1091,6 +1107,7 @@ g_settings.flashupdate_createimage_add_spare = 0;
|
|||||||
|
|
||||||
rootfsSetup->addItem(m1); // create image
|
rootfsSetup->addItem(m1); // create image
|
||||||
rootfsSetup->addItem(s1);
|
rootfsSetup->addItem(s1);
|
||||||
|
rootfsSetup->addItem(m8); // include var
|
||||||
rootfsSetup->addItem(m2); // include uldr
|
rootfsSetup->addItem(m2); // include uldr
|
||||||
#ifdef UBOOT_BIN
|
#ifdef UBOOT_BIN
|
||||||
rootfsSetup->addItem(m3); // include u-boot
|
rootfsSetup->addItem(m3); // include u-boot
|
||||||
|
@@ -83,7 +83,7 @@ class CFlashExpert : public CProgressWindow
|
|||||||
bool checkSize(int mtd, std::string &backupFile);
|
bool checkSize(int mtd, std::string &backupFile);
|
||||||
#ifdef BOXMODEL_APOLLO
|
#ifdef BOXMODEL_APOLLO
|
||||||
bool readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable);
|
bool readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable);
|
||||||
void readmtdJFFS2(std::string &filename);
|
void readmtdJFFS2(std::string &filename, std::string title="", std::string path="/", bool makeDevTable=true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -99,6 +99,15 @@ void CProgressWindow::setTitle(const neutrino_locale_t title)
|
|||||||
#endif // VFD_UPDATE
|
#endif // VFD_UPDATE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CProgressWindow::setTitle(const std::string & title)
|
||||||
|
{
|
||||||
|
setWindowCaption(title);
|
||||||
|
|
||||||
|
#ifdef VFD_UPDATE
|
||||||
|
CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD
|
||||||
|
#endif // VFD_UPDATE
|
||||||
|
}
|
||||||
|
|
||||||
//if header is disabled we need new position for body items
|
//if header is disabled we need new position for body items
|
||||||
void CProgressWindow::fitItems()
|
void CProgressWindow::fitItems()
|
||||||
{
|
{
|
||||||
|
@@ -55,6 +55,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
|
|||||||
void showLocalStatus(const unsigned int prog);
|
void showLocalStatus(const unsigned int prog);
|
||||||
void showStatusMessageUTF(const std::string & text); // UTF-8
|
void showStatusMessageUTF(const std::string & text); // UTF-8
|
||||||
void paint(bool do_save_bg = true);
|
void paint(bool do_save_bg = true);
|
||||||
|
void setTitle(const std::string & title);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -734,6 +734,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.softupdate_name_mode_apply = configfile.getInt32( "softupdate_name_mode_apply", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
|
g_settings.softupdate_name_mode_apply = configfile.getInt32( "softupdate_name_mode_apply", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
|
||||||
g_settings.softupdate_name_mode_backup = configfile.getInt32( "softupdate_name_mode_backup", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
|
g_settings.softupdate_name_mode_backup = configfile.getInt32( "softupdate_name_mode_backup", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
|
||||||
|
|
||||||
|
g_settings.flashupdate_createimage_add_var = configfile.getInt32( "flashupdate_createimage_add_var", 1);
|
||||||
g_settings.flashupdate_createimage_add_uldr = configfile.getInt32( "flashupdate_createimage_add_uldr", 1);
|
g_settings.flashupdate_createimage_add_uldr = configfile.getInt32( "flashupdate_createimage_add_uldr", 1);
|
||||||
g_settings.flashupdate_createimage_add_u_boot = configfile.getInt32( "flashupdate_createimage_add_u_boot", 0);
|
g_settings.flashupdate_createimage_add_u_boot = configfile.getInt32( "flashupdate_createimage_add_u_boot", 0);
|
||||||
g_settings.flashupdate_createimage_add_env = configfile.getInt32( "flashupdate_createimage_add_env", 0);
|
g_settings.flashupdate_createimage_add_env = configfile.getInt32( "flashupdate_createimage_add_env", 0);
|
||||||
@@ -1213,6 +1214,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
|||||||
configfile.setInt32 ("softupdate_name_mode_backup", g_settings.softupdate_name_mode_backup);
|
configfile.setInt32 ("softupdate_name_mode_backup", g_settings.softupdate_name_mode_backup);
|
||||||
configfile.setBool("softupdate_autocheck", g_settings.softupdate_autocheck);
|
configfile.setBool("softupdate_autocheck", g_settings.softupdate_autocheck);
|
||||||
|
|
||||||
|
configfile.setInt32("flashupdate_createimage_add_var", g_settings.flashupdate_createimage_add_var);
|
||||||
configfile.setInt32("flashupdate_createimage_add_uldr", g_settings.flashupdate_createimage_add_uldr);
|
configfile.setInt32("flashupdate_createimage_add_uldr", g_settings.flashupdate_createimage_add_uldr);
|
||||||
configfile.setInt32("flashupdate_createimage_add_u_boot", g_settings.flashupdate_createimage_add_u_boot);
|
configfile.setInt32("flashupdate_createimage_add_u_boot", g_settings.flashupdate_createimage_add_u_boot);
|
||||||
configfile.setInt32("flashupdate_createimage_add_env", g_settings.flashupdate_createimage_add_env);
|
configfile.setInt32("flashupdate_createimage_add_env", g_settings.flashupdate_createimage_add_env);
|
||||||
|
@@ -614,6 +614,7 @@ typedef enum
|
|||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_SPARE,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_SPARE,
|
||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_U_BOOT,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_U_BOOT,
|
||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ULDR,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ULDR,
|
||||||
|
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_VAR,
|
||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_MENU,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_MENU,
|
||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_OPTIONS,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_OPTIONS,
|
||||||
LOCALE_FLASHUPDATE_CREATEIMAGE_OTHER,
|
LOCALE_FLASHUPDATE_CREATEIMAGE_OTHER,
|
||||||
|
@@ -614,6 +614,7 @@ const char * locale_real_names[] =
|
|||||||
"flashupdate.createimage_add_spare",
|
"flashupdate.createimage_add_spare",
|
||||||
"flashupdate.createimage_add_u_boot",
|
"flashupdate.createimage_add_u_boot",
|
||||||
"flashupdate.createimage_add_uldr",
|
"flashupdate.createimage_add_uldr",
|
||||||
|
"flashupdate.createimage_add_var",
|
||||||
"flashupdate.createimage_menu",
|
"flashupdate.createimage_menu",
|
||||||
"flashupdate.createimage_options",
|
"flashupdate.createimage_options",
|
||||||
"flashupdate.createimage_other",
|
"flashupdate.createimage_other",
|
||||||
|
@@ -585,6 +585,7 @@ struct SNeutrinoSettings
|
|||||||
int apply_settings;
|
int apply_settings;
|
||||||
int apply_kernel;
|
int apply_kernel;
|
||||||
|
|
||||||
|
int flashupdate_createimage_add_var;
|
||||||
int flashupdate_createimage_add_uldr;
|
int flashupdate_createimage_add_uldr;
|
||||||
int flashupdate_createimage_add_u_boot;
|
int flashupdate_createimage_add_u_boot;
|
||||||
int flashupdate_createimage_add_env;
|
int flashupdate_createimage_add_env;
|
||||||
|
Reference in New Issue
Block a user