improve v2 install script

This commit is contained in:
Alfonso Gamboa 2022-07-25 07:14:10 -07:00
parent 1a48a779e3
commit 79a25ff331
3 changed files with 34 additions and 4 deletions

View File

@ -1 +1 @@
Sat Jul 23 11:40:03 PM PDT 2022
Mon Jul 25 07:14:00 AM PDT 2022

View File

@ -113,7 +113,7 @@ b339aee882a5d1c943ad08e4282ec3fd SD_ROOT/wz_mini/usr/bin/iCamera-dbg
20b061689308b2cee7edf3b9b906bca7 SD_ROOT/wz_mini/usr/bin/ucamera
3777d9e80c8b517c01a124e6360b6525 SD_ROOT/wz_mini/usr/bin/imp_helper.sh
580b1b6e91e72b4a4fef7b21d8954403 SD_ROOT/wz_mini/usr/bin/getSensorType
516d785d98365c61d646b1c45b134bb4 SD_ROOT/wz_mini/usr/bin/app.ver
65e466ffca31c323ec43391db68fe7d2 SD_ROOT/wz_mini/usr/bin/app.ver
4c780f0455481d106d47d89f0ae04ed5 SD_ROOT/wz_mini/lib/uClibc.tar
9afeb088e4cbabbe0b04033b560204d0 SD_ROOT/wz_mini/lib/libimp.so
4100755cb6cc6e3b76da20c7e3690e16 SD_ROOT/wz_mini/lib/libalog.so
@ -264,7 +264,7 @@ bd383994491e4bdca81788c168feb2eb SD_ROOT/wz_mini/lib/libasound.so.2
f6f0d5a9ebd916de6bdb9695067809ae SD_ROOT/wz_mini/lib/libaudioProcess.so
ac436b39b69f26fb65e993c2dfefb421 SD_ROOT/wz_mini/wz_mini.conf
d41d8cd98f00b204e9800998ecf8427e SD_ROOT/wz_mini/tmp/.gitignore
30cd28d6e52753c4afe5d6bca209bfc7 v2_install/compile_image.sh
283fca97d62c1c199eb2b04877998879 v2_install/compile_image.sh
53db8da5b90bc9b219dbb1d58e934bda v2_install/fw_tool.sh
71f103530794f9cb15aa6bb7f1e5b8a7 v2_install/v2_kernel.bin
f01d641b98388e273c1f0ba682ebc75b v2_install/.gitignore

View File

@ -4,10 +4,16 @@ UA_STRING="Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KH
DL_URL=$(wget --header="Accept: text/html" --user-agent="$UA_STRING" -qO- https://support.wyze.com/hc/en-us/articles/360024852172-Release-Notes-Firmware | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*" | grep /v2/ | sort -t . -k2r,5 | grep demo | head -1)
PAN_DL_URL=$(wget --header="Accept: text/html" --user-agent="$UA_STRING" -qO- https://support.wyze.com/hc/en-us/articles/360024852172-Release-Notes-Firmware | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*" | grep /pan/ | sort -t . -k2r,5 | grep demo | head -1)
tools() {
echo "checking for tools"
command -v wget >/dev/null 2>&1 || { echo >&2 "wget is not installed. Aborting."; exit 1; }
command -v mkimage >/dev/null 2>&1 || { echo >&2 "mkimage is not installed. Aborting."; exit 1; }
command -v unzip >/dev/null 2>&1 || { echo >&2 "unzip is not installed. Aborting."; exit 1; }
echo "tools OK"
}
download(){
rm -f demo.bin
echo "create temporary work directory"
mkdir v2_ro
@ -22,12 +28,23 @@ else
if [[ "$1" == "pan" ]]; then
echo "build for pan"
wget $PAN_DL_URL -O ./v2_ro/demo.zip
elif [[ "$1" == "" ]]; then
else
echo "build for v2"
wget $DL_URL -O ./v2_ro/demo.zip
fi
if [[ $(md5sum ./v2_ro/demo.zip) == *"a69b6d5ffdbce89463fa83f7f06ec10b"* ]]; then
echo "v2 4.9.8.1002"
elif [[ $(md5sum ./v2_ro/demo.zip) == *"91793d32fd797a10df572f4f5d72bc55"* ]]; then
echo "pan v1 4.10.8.1002"
else
echo "md5sum failed check, please manually supply file"
rm -rf v2_ro
exit 1
fi
fi
echo "extracting firmware to temporary work directory"
unzip v2_ro/demo*.zip -d ./v2_ro/
@ -47,3 +64,16 @@ echo "remove temporary work directory"
rm -rf v2_ro
echo "demo.bin ready. Please copy demo.bin to your memory card"
}
read -r -p "wz_mini: this will download the latest firmware version from the vendor and compile a modified demo.bin. Are you sure? [y/N]" response
case "$response" in
[yY][eE][sS]|[yY])
tools
download $1
;;
*)
echo "User declined, exit"
;;
esac