Index: scripts/start.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -rb9654575709e02aecc01a01d246d7af578679387 --- scripts/start.sh (.../start.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/start.sh (.../start.sh) (revision b9654575709e02aecc01a01d246d7af578679387) @@ -8,8 +8,8 @@ # # @file start.sh # -# @author (last) Vy -# @date (last) 20-May-2023 +# @author (last) Behrouz NematiPour +# @date (last) 15-Dec-2022 # @author (original) Behrouz NematiPour # @date (original) 11-Aug-2021 # @@ -136,6 +136,28 @@ exitConfirm $ERR_KILLPROMPT } +function manufacturingModePrompt() { +# I set to always enabled for now to always go to the manufacturing mode +# 1 - Even for normal setup start is moving files to /home/root, so the lockdown needs to run to move files. +# 2 - The UI still needs to be executed to decrypt the /var/configurations, otherwise the configurations can not be updated, +# and I don't have the ability to just decrypt and exit right now. +# Note: after the Cybersecurity release I will improve the user experience and will make it easier for manufacturing. + CONTINUE="y" + +# echo_star_comment +# echo_star_message "Do you want to run in the Manufacturing Mode?" +# echo_star_comment +# read -p "Continue? [y,n]" -n 1 -r CONTINUE +# echo "" # to echo prompts on new line + if [ "$CONTINUE" == "y" ]; then + sshRun "echo $SETUP_ENABLE_MANUFACTURING_MODE > $SETUP_CONF_FILE" + echo_star_message "Set the setup in manufacturing mode" + else + sshRun "echo '' > $SETUP_CONF_FILE" + echo_star_message "Continueing the setup in normal mode" + fi +} + function getDeviceIP() { while true; do validIP "$DST_IP" @@ -164,15 +186,6 @@ copyFileTo "setup.sh" $DST_PATH_HOME } -#TODO to be removed when yocto recipes updated -function setupBluetoothConfFile() { - echo_dash_comment - echo_dash_message "Installing bluetooth conf file" | tee -a $LOG_OUT_FILE - echo_dash_comment - copyFileTo $SRC_PATH_SCRIPTS/"bluetooth_main.conf" $DST_PATH_BT_CONF/main.conf - -} - function setupSettingsScripts() { echo_dash_comment echo_dash_message "Installing settings scripts" | tee -a $LOG_OUT_FILE @@ -226,8 +239,9 @@ } function wipe_device() { - sshRun "rm -frd *" - sshRun "rm -frd .*" + WIPEOUT="wiped.out" + sshRun "find -maxdepth 1 ! \( -name '.ssh' -o -name $SETUP_CONF_FILE -o -name . -o -name .. \) > $WIPEOUT" + sshRun "xargs -a $WIPEOUT rm -frd" } function main() { @@ -241,15 +255,14 @@ sshKeyCopy killPrompt + manufacturingModePrompt wipe_device setupBootupScripts setupSettingsScripts setupConfigurations - setupBluetoothConfFile setupCloudSync setupFonts - setupApplication }