From 8284fe6e53f0430773ea091adb4364c1c1b1a99e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 6 Mar 2014 14:18:55 +0400 Subject: [PATCH] system/setting_helpers.cpp: create /var_init/etc/.reset on factory reset, to be processed by apollo init scripts to erase /var partition --- src/system/setting_helpers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 2ec232eb6..7949249b9 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -538,6 +538,13 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK CZapit::getInstance()->GetConfig(zapitCfg); g_RCInput->postMsg( NeutrinoMessages::REBOOT, 0); ret = menu_return::RETURN_EXIT_ALL; +#ifdef BOXMODEL_APOLLO + /* flag file to erase /var partition on factory reset, + will be done by init scripts */ + FILE * fp = fopen("/var_init/etc/.reset", "w"); + if (fp) + fclose(fp); +#endif } if(delete_set) { unlink(NEUTRINO_SETTINGS_FILE);