fix fw_setenv in first_boot, add first_boot enable/disbale in Recovery mode

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-01-13 13:55:41 +01:00
parent f05e8aa1c0
commit 4f03f243eb
2 changed files with 40 additions and 14 deletions

View File

@ -233,7 +233,7 @@ copy_files_to_usb_partition
notif " FIRST BOOT SETUP FINISHED!" notif " FIRST BOOT SETUP FINISHED!"
setenv first_boot_ok 1 fw_setenv first_boot_ok 1
sleep 1 sleep 1
clear_notif clear_notif

View File

@ -61,20 +61,32 @@ menu_display () {
6) 6)
# Factory tests enable/disable # Factory tests enable/disable
if [ -e /mnt/.assembly_tests ]; then RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null)
message=" FACTORY TESTS DISABLE" if [ "x${RUN_ENV_VAR}" == "x1" ]; then
message=" FACTORY TESTS DISABLE"
else else
message=" FACTORY TESTS ENABLE" message=" FACTORY TESTS ENABLE"
fi fi
;; ;;
7) 7)
# First boot enable/disable
FIRST_BOOT_OK_ENV_VAR=$(fw_printenv -n first_boot_ok 2>/dev/null)
if [ "x${FIRST_BOOT_OK_ENV_VAR}" == "x1" ]; then
message=" FIRST BOOT DISABLE"
else
message=" FACTORY TESTS ENABLE"
fi
;;
8)
# Exit Recovery # Exit Recovery
message=" EXIT RECOVERY" message=" EXIT RECOVERY"
;; ;;
8) 9)
# Shutdown # Shutdown
message=" SHUTDOWN" message=" SHUTDOWN"
@ -225,22 +237,36 @@ menu_run () {
# Factory tests enable/disable # Factory tests enable/disable
RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null) RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null)
if [ "x${RUN_ENV_VAR}" == "x1" ]; then if [ "x${RUN_ENV_VAR}" == "x1" ]; then
fw_setenv assembly_tests 0 fw_setenv assembly_tests 0
message=" FACTORY TESTS ENABLE" message=" FACTORY TESTS ENABLE"
else else
fw_setenv assembly_tests 1 fw_setenv assembly_tests 1
message=" FACTORY TESTS DISABLE" message=" FACTORY TESTS DISABLE"
fi fi
notif "${message}" notif "${message}"
;; ;;
7) 7)
# First boot enable/disable
FIRST_BOOT_OK_ENV_VAR=$(fw_printenv -n first_boot_ok 2>/dev/null)
if [ "x${FIRST_BOOT_OK_ENV_VAR}" == "x1" ]; then
fw_setenv first_boot_ok
message=" FIRST BOOT ENABLE"
else
fw_setenv first_boot_ok 1
message=" FIRST BOOT DISABLE"
fi
notif "${message}"
;;
8)
notif "^^^^^^^^ RESTARTING...^^^^^^^^" notif "^^^^^^^^ RESTARTING...^^^^^^^^"
normal_mode normal_mode
;; ;;
8) 9)
notif "^^^^^^^^ SHUTDOWN...^^^^^^^^" notif "^^^^^^^^ SHUTDOWN...^^^^^^^^"
poweroff poweroff
;; ;;