diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests index da3c4ac..73b93b5 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests @@ -2,8 +2,9 @@ ## Check if tests must be run RUN_FILE=/mnt/.assembly_tests -if [ ! -f ${RUN_FILE} ]; then - echo "${RUN_FILE} not present, not performing assembly tests." +RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null) +if [ ! -f ${RUN_FILE} -a "x${RUN_ENV_VAR}" != "x1" ]; then + #echo "${RUN_FILE} not present, not performing assembly tests." exit 0 fi @@ -29,7 +30,7 @@ stop_loop=false proc_uid=$($GET_PROC_UID) ## Defines -VERSION="0.01" +VERSION="1.00" LOG_FILE="/root/logs/assembly_tests/assy_tests_${proc_uid}.log" [ -d $(dirname $LOG_FILE) ] || mkdir -p $(dirname $LOG_FILE) MAGNET_DETECTED_FILE="/root/.assembly_tests_magnet_detected" @@ -359,7 +360,7 @@ ro ## Exit processes if ! $test_failed; then ## Remove run file => no assembly tests on next run - rm ${RUN_FILE} + rm -f ${RUN_FILE} sync exit 0 else diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get index 744481b..d664293 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get @@ -9,7 +9,7 @@ if [ ${#} -ne 0 ]; then fi # Sanity check: Check if integer -brightness=$(fw_printenv | grep brightness= | cut -d'=' -f 2-) +brightness=$(fw_printenv -n brightness 2>/dev/null) if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then brightness=${BRIGHTNESS_DEFAULT_VALUE} fw_setenv brightness ${brightness} diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get index c4be748..a387a4d 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get @@ -9,7 +9,7 @@ if [ ${#} -ne 0 ]; then fi # Sanity check: Check if integer -volume=$(fw_printenv | grep volume= | cut -d'=' -f 2-) +volume=$(fw_printenv -n volume 2>/dev/null) if ! [ ! "${volume}" -ne "${volume}" ] 2> /dev/null; then volume=${VOLUME_DEFAULT_VALUE} fw_setenv volume ${volume} diff --git a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get index 744481b..d664293 100755 --- a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get +++ b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get @@ -9,7 +9,7 @@ if [ ${#} -ne 0 ]; then fi # Sanity check: Check if integer -brightness=$(fw_printenv | grep brightness= | cut -d'=' -f 2-) +brightness=$(fw_printenv -n brightness 2>/dev/null) if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then brightness=${BRIGHTNESS_DEFAULT_VALUE} fw_setenv brightness ${brightness} diff --git a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu index f7ae3ee..e79110e 100755 --- a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu +++ b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu @@ -227,9 +227,11 @@ menu_run () { if [ $? -eq 0 ]; then if [ -e /mnt/.assembly_tests ]; then rm -f /mnt/.assembly_tests + fw_setenv assembly_tests 0 message=" FACTORY TESTS ENABLE" else - touch /mnt/.assembly_tests + #touch /mnt/.assembly_tests + fw_setenv assembly_tests 1 message=" FACTORY TESTS DISABLE" fi notif "${message}"