now possible to make prod image (assembly tests at first boot) with make image-prod
This commit is contained in:
parent
311a200581
commit
29697c75cb
|
@ -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
|
||||
|
|
|
@ -130,8 +130,9 @@ format_backing_store_partition () {
|
|||
|
||||
copy_files_to_store_partition () {
|
||||
# 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
8
Makefile
8
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue