add initial support for automated updates

This commit is contained in:
Alfonso Gamboa
2022-05-28 05:39:07 -07:00
parent 0fe6a1ffa2
commit e301cb2c06
4 changed files with 79 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ GPIO=63
mount --bind /opt/wz_mini/bin/busybox /bin/busybox
#test for v2
if [ -b /dev/mtdblock7 ]; then
if [ -b /dev/mtdblock9 ]; then
mount -t jffs2 /dev/mtdblock9 /params
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
@@ -152,21 +152,23 @@ if [[ "$DEBUG_ENABLED" == "true" ]]; then
sed -i '/app_init.sh/,+4d' /opt/wz_mini/tmp/.storage/rcS
sed -i '/^# Run init/i/bin/sh /etc/profile' /opt/wz_mini/tmp/.storage/rcS
touch /tmp/dbgflag
else
if [[ "$WEB_CAM_ENABLE" == "true" ]]; then
elif [[ "$WEB_CAM_ENABLE" == "true" ]]; then
sed -i '/app_init.sh/,+4d' /opt/wz_mini/tmp/.storage/rcS
sed -i '/^# Run init/i/opt/wz_mini/etc/init.d/wz_cam.sh' /opt/wz_mini/tmp/.storage/rcS
touch /tmp/dbgflag
fi
elif [[ -d /opt/Upgrade ]]; then
sed -i '/app_init.sh/,+4d' /opt/wz_mini/tmp/.storage/rcS
sed -i '/^# Run init/i/bin/sh /etc/profile' /opt/wz_mini/tmp/.storage/rcS
sed -i '/^# Mount configs.*/i/opt/wz_mini/usr/bin/upgrade-run.sh\n' /opt/wz_mini/tmp/.storage/rcS
touch /tmp/dbgflag
fi
if ! [[ -e /tmp/dbgflag ]]; then
# /opt/wz_mini/run_mmc.sh &
/opt/wz_mini/etc/init.d/wz_user.sh &
else
echo "debug enabled, ignore run_mmc.sh"
echo "debug enabled, ignore wz_user.sh"
fi

View File

@@ -6,6 +6,11 @@ exec 1> /opt/wz_mini/log/v3_post.log 2>&1
set -x
if [[ -e /tmp/dbgflag ]];then
echo "debug mode, disabled"
exit 0
fi
export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
[ -f $WZMINI_CFG ] && source $WZMINI_CFG