Apollo/Kronos: Use backup with readmtdJFFS2() also for root1 partition

Origin commit data
------------------
Commit: cb4c7431c7
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-09-22 (Tue, 22 Sep 2015)
This commit is contained in:
Michael Liebmann
2015-09-22 13:39:44 +02:00
parent 1d5f135331
commit f3a424cf8f
7 changed files with 20 additions and 2 deletions

View File

@@ -583,6 +583,7 @@ flashupdate.copy_image Kopiere Image in den Arbeitsspeicher
flashupdate.createimage Image speichern flashupdate.createimage Image speichern
flashupdate.createimage_add_env 'env' hinzufügen flashupdate.createimage_add_env 'env' hinzufügen
flashupdate.createimage_add_kernel 'kernel' hinzufügen flashupdate.createimage_add_kernel 'kernel' hinzufügen
flashupdate.createimage_add_root1 Partition 'root1' sichern
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
@@ -611,7 +612,7 @@ flashupdate.md5check Imageprüfung
flashupdate.md5sumerror Das Image ist fehlerhaft flashupdate.md5sumerror Das Image ist fehlerhaft
flashupdate.menu_apply_kernel Kernel flashen flashupdate.menu_apply_kernel Kernel flashen
flashupdate.menu_apply_settings Settingsübernahme erlauben flashupdate.menu_apply_settings Settingsübernahme erlauben
flashupdate.mkfs_create_image Image erstellen flashupdate.mkfs_create_image Backup erstellen
flashupdate.mkfs_preparing_files Dateien und Verzeichnisse vorbereiten flashupdate.mkfs_preparing_files Dateien und Verzeichnisse vorbereiten
flashupdate.mkfs_using_sumtool Benutze Sumtool flashupdate.mkfs_using_sumtool Benutze Sumtool
flashupdate.msgbox Es wurde folgende neue Datei gefunden:\nDatum: %s, %s\nBasisImage: %s\nTyp: %s\n\nWollen Sie diese Version jetzt herunterladen und installieren? flashupdate.msgbox Es wurde folgende neue Datei gefunden:\nDatum: %s, %s\nBasisImage: %s\nTyp: %s\n\nWollen Sie diese Version jetzt herunterladen und installieren?

View File

@@ -584,6 +584,7 @@ flashupdate.copy_image Copy Image to main memory
flashupdate.createimage Save image flashupdate.createimage Save image
flashupdate.createimage_add_env Add 'env' to image flashupdate.createimage_add_env Add 'env' to image
flashupdate.createimage_add_kernel Add 'kernel' to image flashupdate.createimage_add_kernel Add 'kernel' to image
flashupdate.createimage_add_root1 Add 'root1' 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
@@ -612,7 +613,7 @@ flashupdate.md5check checking image
flashupdate.md5sumerror image has errors flashupdate.md5sumerror image has errors
flashupdate.menu_apply_kernel Flashing kernel flashupdate.menu_apply_kernel Flashing kernel
flashupdate.menu_apply_settings Allow apply settings flashupdate.menu_apply_settings Allow apply settings
flashupdate.mkfs_create_image Create image flashupdate.mkfs_create_image Create backup
flashupdate.mkfs_preparing_files Preparing files and directories flashupdate.mkfs_preparing_files Preparing files and directories
flashupdate.mkfs_using_sumtool Using sumtool flashupdate.mkfs_using_sumtool Using sumtool
flashupdate.msgbox Found the following new file:\nDate: %s, %s\nBaseImage: %s\nType: %s\n\nDo you want to download and install this version now? flashupdate.msgbox Found the following new file:\nDate: %s, %s\nBaseImage: %s\nType: %s\n\nDo you want to download and install this version now?

View File

@@ -92,6 +92,7 @@ extern int allow_flash;
#define MTD_OF_WHOLE_IMAGE 0 #define MTD_OF_WHOLE_IMAGE 0
#ifdef BOXMODEL_APOLLO #ifdef BOXMODEL_APOLLO
#define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd0" #define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd0"
#define ROOT1_MOUNT "/ext"
#else #else
#define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd3" #define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd3"
#endif #endif
@@ -778,6 +779,10 @@ void CFlashExpert::readmtd(int preadmtd)
readmtdJFFS2(filename, title, "/var", false); readmtdJFFS2(filename, title, "/var", false);
return; return;
} }
if (preadmtd == 2) {
readmtdJFFS2(filename, title, ROOT1_MOUNT, false);
return;
}
#endif #endif
if (preadmtd == -1) { if (preadmtd == -1) {
filename = (std::string)g_settings.update_dir + "/flashimage.img"; // US-ASCII (subset of UTF-8 and ISO8859-1) filename = (std::string)g_settings.update_dir + "/flashimage.img"; // US-ASCII (subset of UTF-8 and ISO8859-1)
@@ -1048,6 +1053,9 @@ int CFlashExpertSetup::exec(CMenuTarget* parent, const std::string &actionKey)
if (g_settings.flashupdate_createimage_add_var == 1) if (g_settings.flashupdate_createimage_add_var == 1)
cfe->readmtd(1); cfe->readmtd(1);
if (g_settings.flashupdate_createimage_add_root1 == 1)
cfe->readmtd(2);
cfe->readmtd(0); cfe->readmtd(0);
if (g_settings.flashupdate_createimage_add_uldr == 1) if (g_settings.flashupdate_createimage_add_uldr == 1)
@@ -1083,6 +1091,8 @@ int CFlashExpertSetup::showMenu()
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, 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); MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
CMenuOptionChooser *m9 = new CMenuOptionChooser(LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ROOT1, &g_settings.flashupdate_createimage_add_root1,
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
@@ -1108,6 +1118,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(m8); // include var
rootfsSetup->addItem(m9); // include root1
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

View File

@@ -735,6 +735,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
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_var = configfile.getInt32( "flashupdate_createimage_add_var", 1);
g_settings.flashupdate_createimage_add_root1 = configfile.getInt32( "flashupdate_createimage_add_root1", 0);
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);
@@ -1215,6 +1216,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
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_var", g_settings.flashupdate_createimage_add_var);
configfile.setInt32("flashupdate_createimage_add_root1", g_settings.flashupdate_createimage_add_root1);
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);

View File

@@ -611,6 +611,7 @@ typedef enum
LOCALE_FLASHUPDATE_CREATEIMAGE, LOCALE_FLASHUPDATE_CREATEIMAGE,
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ENV, LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ENV,
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_KERNEL, LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_KERNEL,
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ROOT1,
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,

View File

@@ -611,6 +611,7 @@ const char * locale_real_names[] =
"flashupdate.createimage", "flashupdate.createimage",
"flashupdate.createimage_add_env", "flashupdate.createimage_add_env",
"flashupdate.createimage_add_kernel", "flashupdate.createimage_add_kernel",
"flashupdate.createimage_add_root1",
"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",

View File

@@ -586,6 +586,7 @@ struct SNeutrinoSettings
int apply_kernel; int apply_kernel;
int flashupdate_createimage_add_var; int flashupdate_createimage_add_var;
int flashupdate_createimage_add_root1;
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;