change camera model detection

This commit is contained in:
Alfonso Gamboa
2022-06-16 23:26:14 -07:00
parent 1082f675fd
commit 7d43095b72
8 changed files with 126 additions and 171 deletions

View File

@@ -71,44 +71,26 @@ export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
set -x
#WCV3 AUDIO GPIO
GPIO=63
V2="false"
#Set the correct GPIO for the audio driver (T31 only)
if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
GPIO=7
elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
GPIO=63
fi
#Check model, change GPIO is HL_PAN2
if [[ "$V2" == "false" ]]; then
mount -t jffs2 /dev/mtdblock6 /configs
if [[ $(cat /configs/.product_config | grep PRODUCT_MODEL) == "PRODUCT_MODEL=HL_PAN2" ]]; then
umount /configs
GPIO=7
fi
if [ -f /opt/wz_mini/tmp/.T20 ]; then
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14/extra/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
echo "not HL_PAN2"
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
#test for v2
if [ -b /dev/mtdblock9 ]; then
mount -t jffs2 /dev/mtdblock9 /params
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
fi
if [[ "$V2" == "true" ]]; then
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14/extra/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
echo UPGRADE MODE
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "Upgrading kernel"
flashcp -v /opt/Upgrade/wz_mini_hacks-master/v2_install/v2_kernel.bin /dev/mtd1
fi

View File

@@ -21,22 +21,7 @@ set -x
echo "welcome to wz_cam.sh"
echo "PID $$"
#test for v2
v2_test() {
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
}
if mountpoint -q /params; then
echo "params already mounted"
v2_test
else
mount -t jffs2 /dev/mtdblock9 /params
v2_test
fi
if [ "$V2" == "false" ]; then
if [ -f /opt/wz_mini/tmp/.T31 ]; then
cp /opt/wz_mini/etc/uvc.config /opt/wz_mini/usr/bin/uvc.config

View File

@@ -36,40 +36,59 @@ echo '
set -x
#WCV3 AUDIO GPIO
GPIO=63
V2="false"
#replace stock busybox
mount --bind /opt/wz_mini/bin/busybox /bin/busybox
#test for v2
echo "replace stock fstab"
mount --bind /opt/wz_mini/etc/fstab /etc/fstab
echo "mount workplace dir"
mount -t tmpfs /opt/wz_mini/tmp
echo "install busybox applets"
mkdir /opt/wz_mini/tmp/.bin
/opt/wz_mini/bin/busybox --install -s /opt/wz_mini/tmp/.bin
##DETECT CAMERA MODEL & PLATFORM TYPE
#V2=WYZEC1-JZ
#PANv1=WYZECP1_JEF
#PANv2=HL_PAN2
#V3=WYZE_CAKP2JFUS
#DB3=WYZEDB3
#mtdblock9 only exists on the T20 platform, indicating V2 or PANv1
if [ -b /dev/mtdblock9 ]; then
mount -t jffs2 /dev/mtdblock9 /params
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
mkdir /opt/wz_mini/tmp/params
mount -t jffs2 /dev/mtdblock9 /opt/wz_mini/tmp/params
touch /opt/wz_mini/tmp/.$(cat /opt/wz_mini/tmp/params/config/.product_config | grep PRODUCT_MODEL | sed -e 's#.*=\(\)#\1#')
touch /opt/wz_mini/tmp/.T20
umount /opt/wz_mini/tmp/params
rm -rf /opt/wz_mini/tmp/params
elif [ -b /dev/mtdblock6 ]; then
mkdir /opt/wz_mini/tmp/configs
mount -t jffs2 /dev/mtdblock6 /opt/wz_mini/tmp/configs
touch /opt/wz_mini/tmp/.$(cat /opt/wz_mini/tmp/configs/.product_config | grep PRODUCT_MODEL | sed -e 's#.*=\(\)#\1#')
touch /opt/wz_mini/tmp/.T31
umount /opt/wz_mini/tmp/configs
rm -rf /opt/wz_mini/tmp/configs
fi
#Check model, change GPIO is HL_PAN2
if [[ "$V2" == "false" ]]; then
mount -t jffs2 /dev/mtdblock6 /configs
if [[ $(cat /configs/.product_config | grep PRODUCT_MODEL) == "PRODUCT_MODEL=HL_PAN2" ]]; then
umount /configs
GPIO=7
fi
else
echo "not HL_PAN2"
#Set the correct GPIO for the audio driver (T31 only)
if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
GPIO=7
elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
GPIO=63
fi
if [[ -e /opt/wz_mini/etc/.first_boot ]]; then
if [ -e /opt/wz_mini/etc/.first_boot ]; then
echo "first boot already completed"
else
echo "first boot, initializing"
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14/extra/audio.ko
if [ -f /opt/wz_mini/tmp/.T20 ]; then
#May need different gpio for PANv1
#We don't rmmod this module, as it is marked [permanent] by the kernel on T20
insmod /opt/wz_mini/lib/modules/3.10.14/extra/audio.ko sign_mode=0
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/init_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/init.wav $AUDIO_PROMPT_VOLUME
@@ -88,25 +107,13 @@ echo "mounting tmpfs"
mount -t tmpfs /tmp
echo "mount system to replace factorycheck with dummy, to prevent bind unmount"
if [[ ! "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T31 ]; then
mount /dev/mtdblock3 /system
mount --bind /opt/wz_mini/bin/factorycheck /system/bin/factorycheck
else
echo "v2 doesn't need factorycheck"
fi
touch /tmp/usrflag
echo "replace stock fstab"
mount --bind /opt/wz_mini/etc/fstab /etc/fstab
echo "mount workplace dir"
mount -t tmpfs /opt/wz_mini/tmp
echo "install busybox applets"
mkdir /opt/wz_mini/tmp/.bin
/opt/wz_mini/bin/busybox --install -s /opt/wz_mini/tmp/.bin
echo "create workspace directory"
mkdir /opt/wz_mini/tmp/.storage
@@ -124,7 +131,7 @@ sed -i '/system\/\lib/s/$/:\/opt\/wz_mini\/lib/' /opt/wz_mini/tmp/.storage/rcS
#sed -i '/^# Run init script.*/i#Hook Library PATH here\nexport LD_LIBRARY_PATH=/tmp/test/lib:$LD_LIBRARY_PATH\n' /opt/wz_mini/tmp/.storage/rcS
#sed -i '/^# Run init script.*/i#Hook system PATH here\nexport PATH=/tmp/test/bin:$PATH\n' /opt/wz_mini/tmp/.storage/rcS
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
mount -t jffs2 /dev/mtdblock4 /system
fi
@@ -147,10 +154,8 @@ mount --bind /opt/wz_mini/tmp/.storage/shadow /etc/shadow
chmod 400 /etc/shadow
if [[ -e /opt/wz_mini/swap.gz ]]; then
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14/extra/audio.ko
if [ -f /opt/wz_mini/tmp/.T20 ]; then
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/swap_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/swap.wav $AUDIO_PROMPT_VOLUME
@@ -161,10 +166,10 @@ if [[ -e /opt/wz_mini/swap.gz ]]; then
mkswap /opt/wz_mini/swap
sync;echo 3 > /proc/sys/vm/drop_caches
else
echo "swap archive not present, not extracting"
echo "swap archive missing, not extracting"
fi
if [[ -d /opt/wz_mini/usr/share/terminfo ]]; then
if [ -d /opt/wz_mini/usr/share/terminfo ]; then
echo "terminfo already present"
else
echo "terminfo not present, extract"

View File

@@ -16,7 +16,7 @@ exec 1> $LOG_NAME.log 2>&1
set -x
if [[ -e /tmp/dbgflag ]];then
if [ -e /tmp/dbgflag ];then
echo "debug mode, disabled"
exit 0
fi
@@ -40,20 +40,14 @@ if [ -d /lib/modules ]; then
mount --bind /opt/wz_mini/lib/modules /lib/modules
fi
if [ -f /params/config/.product_config ]; then
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
fi
## REPLACE STOCK MODULES
if [[ "$ENABLE_RTL8189FS_DRIVER" == "true" ]]; then
#V2/V3 ONLY
#V2/V3 ONLY [DB3 untested]
echo "Enable RTL8189FS"
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.WYZEC1-JZ ]; then
sed -i 's/\/driver\/rtl8189ftv.ko/\/opt\/wz_mini\/lib\/modules\/3.10.14\/extra\/8189fs.ko rtw_power_mgnt=0 rtw_enusbss=0/g' /opt/wz_mini/tmp/.storage/app_init.sh
else
elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
sed -i 's/\/system\/driver\/rtl8189ftv.ko/\/opt\/wz_mini\/lib\/modules\/3.10.14\_\_isvp_swan_1.0\_\_\/extra\/8189fs.ko rtw_power_mgnt=0 rtw_enusbss=0/g' /opt/wz_mini/tmp/.storage/app_init.sh
fi
fi
@@ -62,7 +56,7 @@ fi
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]] || [[ "$RTSP_LOW_RES_ENABLED" == "true" ]] && ! [[ -e /tmp/dbgflag ]]; then
if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]] && [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "load video loopback driver at video6 video7"
insmod /opt/wz_mini/lib/modules/3.10.14/extra/v4l2loopback_V2.ko video_nr=6,7
else
@@ -70,7 +64,7 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]] || [[ "$RTSP_LOW_RES_ENABLED" == "tru
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/v4l2loopback.ko video_nr=1,2
fi
elif [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "load video loopback driver at video7"
insmod /opt/wz_mini/lib/modules/3.10.14/extra/v4l2loopback_V2.ko video_nr=7
else
@@ -78,7 +72,7 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]] || [[ "$RTSP_LOW_RES_ENABLED" == "tru
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/v4l2loopback.ko video_nr=2
fi
elif [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "load video loopback driver at video6"
insmod /opt/wz_mini/lib/modules/3.10.14/extra/v4l2loopback_V2.ko video_nr=6
else

View File

@@ -33,7 +33,7 @@ hostname_set() {
}
first_run_check() {
if [[ -e /opt/wz_mini/tmp/.wz_user_firstrun ]]; then
if [ -e /opt/wz_mini/tmp/.wz_user_firstrun ]; then
echo "wz_user.sh already run once, exit."
exit 0
fi
@@ -76,7 +76,7 @@ eth_wlan_up() {
ifconfig wlan0 up
pkill udhcpc
udhcpc -i wlan0 -x hostname:$HOSTNAME -p /var/run/udhcpc.pid -b
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
mount -o bind /opt/wz_mini/bin/wpa_cli.sh /system/bin/wpa_cli
else
mount -o bind /opt/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
@@ -86,7 +86,7 @@ eth_wlan_up() {
wpa_check() {
#Check if wpa_supplicant has been created by iCamera
if [[ -e /tmp/wpa_supplicant.conf ]]; then
if [ -e /tmp/wpa_supplicant.conf ]; then
echo "wpa_supplicant.conf ready"
wlanold_check $1
else
@@ -103,7 +103,7 @@ wpa_check() {
wlanold_check() {
#Have we renamed interfaces yet?
if [[ -d /sys/class/net/wlanold ]]; then
if [ -d /sys/class/net/wlanold ]; then
echo "wlanold exist"
eth_wlan_up
else
@@ -123,7 +123,7 @@ netloop() {
}
swap_enable() {
if [[ -e /opt/wz_mini/swap ]]; then
if [ -e /opt/wz_mini/swap ]; then
echo "Swap file exists"
if cat /proc/swaps | grep "mini" ; then
echo "Swap is already enabled"
@@ -165,12 +165,11 @@ done
first_run_check
wait_wlan
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14"
#Set module dir depending on platform
if [ -f /opt/wz_mini/tmp/.T20 ]; then
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14"
else
V2="false"
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__"
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__"
fi
swap_enable
@@ -193,8 +192,8 @@ else
fi
if [[ "$ENABLE_IPTABLES" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
echo "v2 has iptables built in"
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "T20 has iptables built in"
else
insmod /lib/modules/3.10.14__isvp_swan_1.0__/kernel/net/netfilter/x_tables.ko
insmod /lib/modules/3.10.14__isvp_swan_1.0__/kernel/net/ipv4/netfilter/ip_tables.ko
@@ -236,7 +235,7 @@ if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
HOST_MACADDR=$(echo "$HOSTNAME"|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo connect > /sys/devices/platform/jz-dwc2/dwc2/udc/dwc2/soft_connect
sleep 1
devmem 0x10000040 32 0x0b800096
@@ -252,7 +251,7 @@ if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
insmod $KMOD_PATH/kernel/drivers/usb/gadget/libcomposite.ko
if [[ "$V2" == "false" ]]; then
if [ -f /opt/wz_mini/tmp/.T31 ]; then
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/u_ether.ko
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/usb_f_ncm.ko
fi
@@ -341,7 +340,7 @@ else
fi
if [[ "$ENABLE_EXT4" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
insmod $KMOD_PATH/kernel/lib/crc16.ko
fi
@@ -370,8 +369,8 @@ else
fi
if [[ "$ENABLE_MP4_WRITE" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
echo "mp4_write is not supported on v2"
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "mp4_write is not supported on T20"
else
/opt/wz_mini/bin/cmd mp4write on
echo "mp4_write enabled"
@@ -382,7 +381,7 @@ fi
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
HI_VIDEO_DEV="/dev/video6"
else
HI_VIDEO_DEV="/dev/video1"
@@ -407,7 +406,7 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 &
sleep 5
@@ -425,7 +424,7 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_HI_RES_MAX_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:28:4:$RTSP_HI_RES_MAX_BITRATE" > /dev/null 2>&1 &
sleep 5
else
@@ -435,8 +434,8 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_HI_RES_TARGET_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then
echo "not supported on v2"
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "not supported on T20"
else
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:48:4:$RTSP_HI_RES_TARGET_BITRATE" > /dev/null 2>&1 &
sleep 5
@@ -444,7 +443,7 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_HI_RES_FPS" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:8:4:$RTSP_HI_RES_FPS" > /dev/null 2>&1 &
sleep 5
else
@@ -461,7 +460,7 @@ fi
if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
LOW_VIDEO_DEV="/dev/video7"
else
LOW_VIDEO_DEV="/dev/video2"
@@ -486,7 +485,7 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 &
sleep 5
@@ -503,7 +502,7 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_LOW_RES_MAX_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:28:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 &
sleep 5
else
@@ -512,15 +511,15 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
fi
if [[ "$RTSP_LOW_RES_TARGET_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then
echo "not supported on v2"
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "not supported on T20"
else
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:48:4:$RTSP_LOW_RES_TARGET_BITRATE" > /dev/null 2>&1 &
fi
fi
if [[ "$RTSP_LOW_RES_FPS" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [ -f /opt/wz_mini/tmp/.T20 ]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:8:4:$RTSP_LOW_RES_FPS" > /dev/null 2>&1 &
sleep 5
else
@@ -552,7 +551,7 @@ fi
hostname_set
touch /opt/wz_mini/tmp/.wz_user_firstrun
pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores when something crashes
pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores and uploading them when something crashes
sysctl -w kernel.core_pattern='|/bin/false'
dmesg_log
trim_logs

View File

@@ -44,6 +44,9 @@ fi
install_upgrade_script() {
echo "Installing latest upgrade-script"
cp /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/bin/upgrade-run.sh /opt/wz_mini/bin/upgrade-run.sh
sleep 5
/opt/wz_mini/bin/upgrade-run.sh backup_begin
}
@@ -68,43 +71,30 @@ export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
set -x
#WCV3 AUDIO GPIO
GPIO=63
V2="false"
#Set the correct GPIO for the audio driver (T31 only)
if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
GPIO=7
elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
GPIO=63
fi
#Check model, change GPIO is HL_PAN2
if [[ "$V2" == "false" ]]; then
mount -t jffs2 /dev/mtdblock6 /configs
if [[ $(cat /configs/.product_config | grep PRODUCT_MODEL) == "PRODUCT_MODEL=HL_PAN2" ]]; then
umount /configs
GPIO=7
fi
if [ -f /opt/wz_mini/tmp/.T20 ]; then
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14/extra/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
echo "not HL_PAN2"
insmod /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/usr/share/audio/upgrade_mode.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
#test for v2
if [ -b /dev/mtdblock9 ]; then
mount -t jffs2 /dev/mtdblock9 /params
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
fi
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14/kernel/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/upgrade_mode_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/upgrade_mode.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
echo UPGRADE MODE
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo "Upgrading kernel"
flashcp -v /opt/Upgrade/wz_mini_hacks-master/v2_install/v2_kernel.bin /dev/mtd1
fi
umount -l /opt/wz_mini/tmp
ls -l /opt/wz_mini/
rm -rf /opt/wz_mini/*