Index: main.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r8d5fe7d63e3d86e9d89d5f824347d34479e4e9ec --- main.cpp (.../main.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ main.cpp (.../main.cpp) (revision 8d5fe7d63e3d86e9d89d5f824347d34479e4e9ec) @@ -102,6 +102,7 @@ QString gActiveCANBus = "can0"; bool gEnableManufacturing = false ; +bool gEnableUpdating = false ; bool gUseRootHome = false ; QString gParserErrorText = ""; @@ -271,6 +272,12 @@ QCoreApplication::translate("main", "In case the application is not in Manufacturing Setup but needs to use root home folder for configurations.")); parser.addOption(optionUseRootHome); + // --- -U : Update mode + QCommandLineOption optionEnableUpdating( + QStringList() << "U" << "enable-Update-mode", + QCoreApplication::translate("main", "Enables the update mode to update only necessary files during the update and keep the rest.")); + parser.addOption(optionEnableUpdating); + // --- parse command lines if ( ! parser.parse(qApp->arguments()) ) { gParserErrorText = parser.errorText(); @@ -294,6 +301,7 @@ gEnableDryDemo = parser.isSet(optionEnableDryDemo ); gEnableManufacturing = parser.isSet(optionEnableManufacturing ); + gEnableUpdating = parser.isSet(optionEnableUpdating ); gUseRootHome = parser.isSet(optionUseRootHome ); if ( parser.isSet(optionActiveCANBus ) ) { @@ -376,16 +384,16 @@ * \brief lockdown * \details runs the lockdown shellscript as a detached process * and ment to be executed just before the application quits - * and only when application running in manufacturing mode. + * and only when application running in manufacturing or update mode. * Must not stop application shutdown in any way. * If any error happens it only logs. */ void lockdown() { // there are two setup scenarios: - // only during setup mode which is -E (manufacturing setup) application is running under the root user permissions + // only during setup mode which is -E (manufacturing setup) or -U -E (update setup) application is running under the root user permissions // and all the files are copied to the /home/root/ te later be copied to secured locations // and that will be done by lockdown.sh script running within application after the user is done with the setup and QUIT s the application. - if ( gEnableManufacturing ) { + if ( gEnableManufacturing || gEnableUpdating ) { QString scriptName = Storage::Device_Lockdown; quint16 errorCode; QString errorText;