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 73b93b5..1b9f2c2 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/assembly_tests @@ -1,10 +1,8 @@ #!/bin/sh ## Check if tests must be run -RUN_FILE=/mnt/.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." +if [ "x${RUN_ENV_VAR}" != "x1" ]; then exit 0 fi @@ -360,7 +358,7 @@ ro ## Exit processes if ! $test_failed; then ## Remove run file => no assembly tests on next run - rm -f ${RUN_FILE} + fw_setenv assembly_tests 0 sync exit 0 else diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot index df95367..4e44152 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot @@ -129,9 +129,10 @@ format_backing_store_partition () { } copy_files_to_store_partition () { - # Add file to force assembly tests + # Add file to force assembly tests + + mount /mnt/ || die 18 "Cannot mount /mnt" - #touch /mnt/.assembly_tests || die 19 "Cannot create assembly tests run file" unzip -q -o /usr/local/share/mnt_freware_games.zip -d /mnt/ umount /mnt/ || die 20 "Cannot unmount /mnt" return 0 diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown index 0fd580d..00ff51f 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown @@ -9,7 +9,7 @@ nb_secs_to_wait=$1 # Wait $nb_secs_to_wait seconds to catch signal USR2 # If the signal is caught, then it means a process canceled this shutdown -sleep ${nbl_secs_to_wait} +sleep ${nb_secs_to_wait} # Too late to cancel: init shutdown shutdown_funkey diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/signal_usr1_to_emulators b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/signal_usr1_to_emulators index d10f2d2..0d2aa02 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/signal_usr1_to_emulators +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/signal_usr1_to_emulators @@ -2,8 +2,8 @@ # This should replaced by storing the correct PID before # launching an emulator and signaling only this one. - -if [[ -f /mnt/.assembly_tests ]]; then +RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null) +if [ "x${RUN_ENV_VAR}" == "x1" ]; then # First this one killall -s USR1 assembly_tests > /dev/null 2>&1 diff --git a/Makefile b/Makefile index 403728a..a35bbe7 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,14 @@ image: fun @./Recovery/output/host/bin/genimage --loglevel 0 --inputpath . @rm -rf root tmp + +image-prod: fun + @$(call MESSAGE,"Creating disk image") + @rm -rf root tmp + @mkdir -p root tmp + @./Recovery/output/host/bin/genimage --loglevel 0 --config "genimage-prod.cfg" --inputpath . + @rm -rf root tmp + update: fun @$(call MESSAGE,"Creating update file") @rm -rf tmp diff --git a/Recovery/board/funkey/post-build.sh b/Recovery/board/funkey/post-build.sh index a02970f..9ef4374 100755 --- a/Recovery/board/funkey/post-build.sh +++ b/Recovery/board/funkey/post-build.sh @@ -22,5 +22,11 @@ mv ${TARGET_DIR}/etc/init.d/S50dropbear ${TARGET_DIR}/etc/init.d/S42dropbear rm -rf ${TARGET_DIR}/etc/dropbear ln -s /tmp ${TARGET_DIR}/etc/dropbear -# Generate U-Boot environment +# Generate U-Boot environment for app ${HOST_DIR}/bin/mkenvimage -p 0x0 -s 0x20000 -o ${BINARIES_DIR}/u-boot-env.img ${TARGET_DIR}/etc/u-boot.env + +# Generate U-Boot environment for production +cp ${TARGET_DIR}/etc/u-boot.env ${TARGET_DIR}/etc/u-boot-prod.env +echo "assembly_tests=1" >> ${TARGET_DIR}/etc/u-boot-prod.env +${HOST_DIR}/bin/mkenvimage -p 0x0 -s 0x20000 -o ${BINARIES_DIR}/u-boot-env-prod.img ${TARGET_DIR}/etc/u-boot-prod.env +rm ${TARGET_DIR}/etc/u-boot-prod.env diff --git a/Recovery/board/funkey/rootfs-overlay/etc/funkey_gpio_mapping.conf b/Recovery/board/funkey/rootfs-overlay/etc/funkey_gpio_mapping.conf index 11a4e43..ecb81ba 100644 --- a/Recovery/board/funkey/rootfs-overlay/etc/funkey_gpio_mapping.conf +++ b/Recovery/board/funkey/rootfs-overlay/etc/funkey_gpio_mapping.conf @@ -53,7 +53,7 @@ 7+13, SHELL_COMMAND, quick_action_volume_down, Fn+A, Volume-- 7+11, SHELL_COMMAND, quick_action_bright_up, Fn+B, Brightness++ 7+14, SHELL_COMMAND, quick_action_bright_down, Fn+X, Brightness-- -10, SHELL_COMMAND, sched_shutdown 1 & signal_usr1_to_emulators, N_OE, Quick save and Poweroff because of N_OE +10, SHELL_COMMAND, shutdown_funkey, N_OE, Poweroff because of N_OE 7+15+2, SHELL_COMMAND, display_notif_system_stats, Fn+L1+L2, display system cpu and ram usage #7+12, KEYBOARD, KEY_G, KEY_G, Brightness++ diff --git a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu index e79110e..1048ec7 100755 --- a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu +++ b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu @@ -62,9 +62,9 @@ menu_display () { # Factory tests enable/disable if [ -e /mnt/.assembly_tests ]; then - message=" FACTORY TESTS DISABLE" + message=" FACTORY TESTS DISABLE" else - message=" FACTORY TESTS ENABLE" + message=" FACTORY TESTS ENABLE" fi ;; @@ -223,21 +223,15 @@ menu_run () { 6) # Factory tests enable/disable - mount | grep -q /dev/mmcblk0p4 - if [ $? -eq 0 ]; then - if [ -e /mnt/.assembly_tests ]; then - rm -f /mnt/.assembly_tests + RUN_ENV_VAR=$(fw_printenv -n assembly_tests 2>/dev/null) + if [ "x${RUN_ENV_VAR}" == "x1" ]; then fw_setenv assembly_tests 0 message=" FACTORY TESTS ENABLE" else - #touch /mnt/.assembly_tests fw_setenv assembly_tests 1 message=" FACTORY TESTS DISABLE" fi notif "${message}" - else - notif "${message}...^CANNOT TEST IF MOUNTED!" - fi ;; 7)