diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index abe36cc6e..f74302dfc 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -677,6 +677,7 @@ flashupdate.checkupdate_internet Online-Update flashupdate.checkupdate_local Lokales Update flashupdate.choose_partition Partition wählen flashupdate.copy_image Kopiere Image in den Arbeitsspeicher +flashupdate.copy_settings Einstellungen ins neue Image übernehmen? flashupdate.createimage Image speichern flashupdate.createimage_add_env 'env' hinzufügen flashupdate.createimage_add_kernel 'kernel' hinzufügen diff --git a/data/locale/english.locale b/data/locale/english.locale index 737bb0461..e31e8bdd5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -676,6 +676,7 @@ flashupdate.checkupdate_internet Online update flashupdate.checkupdate_local Local update flashupdate.choose_partition Choose partition flashupdate.copy_image Copy Image to main memory +flashupdate.copy_settings Copy settings to new image? flashupdate.createimage Save image flashupdate.createimage_add_env Add 'env' to image flashupdate.createimage_add_kernel Add 'kernel' to image diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 5bfdffb40..8e2846f6d 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -662,6 +662,21 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) { showGlobalStatus(100); + // create settings package + int copy_settings = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_COPY_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE); + if (copy_settings == CMsgBox::mbrYes) + { + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_SETTINGS_BACKUP); + hintBox.paint(); + /* + Settings tarball is created in /tmp directory. + ofgwrite will copy this tarball to new rootfs. + It's untared at first start of new image. + */ + my_system(3, "/bin/backup.sh", "/tmp", "backup_flash.tar.gz"); + hintBox.hide(); + } + // get active partition char c[2] = {0}; FILE *f; diff --git a/src/system/locals.h b/src/system/locals.h index 5df055480..56b0497b3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -703,6 +703,7 @@ typedef enum LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL, LOCALE_FLASHUPDATE_CHOOSE_PARTITION, LOCALE_FLASHUPDATE_COPY_IMAGE, + LOCALE_FLASHUPDATE_COPY_SETTINGS, LOCALE_FLASHUPDATE_CREATEIMAGE, LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ENV, LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_KERNEL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 4bf149bd8..aa1420cf8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -703,6 +703,7 @@ const char * locale_real_names[] = "flashupdate.checkupdate_local", "flashupdate.choose_partition", "flashupdate.copy_image", + "flashupdate.copy_settings", "flashupdate.createimage", "flashupdate.createimage_add_env", "flashupdate.createimage_add_kernel",