mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-11-22 05:27:24 +00:00
enhance v2 image generation
This commit is contained in:
parent
10a27ca01f
commit
085183ccaa
@ -3,28 +3,40 @@
|
|||||||
UA_STRING="Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"
|
UA_STRING="Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"
|
||||||
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)
|
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)
|
||||||
|
|
||||||
echo "create work directory"
|
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 "create temporary work directory"
|
||||||
mkdir v2_ro
|
mkdir v2_ro
|
||||||
|
|
||||||
echo "download latest firmware"
|
echo "check for local zip"
|
||||||
wget $DL_URL -P ./v2_ro/
|
if [ -f demo_4.9.8.1002.zip ]; then
|
||||||
|
echo "local archive found"
|
||||||
|
mv demo_4.9.8.1002.zip ./v2_ro/
|
||||||
|
else
|
||||||
|
echo "local archive not found"
|
||||||
|
echo "downloading latest firmware"
|
||||||
|
wget $DL_URL -P ./v2_ro/
|
||||||
|
fi
|
||||||
|
|
||||||
echo "extracting firmware to workdir"
|
echo "extracting firmware to temporary work directory"
|
||||||
unzip v2_ro/demo_4.9.8.1002.zip -d ./v2_ro/
|
unzip v2_ro/demo_4.9.8.1002.zip -d ./v2_ro/
|
||||||
|
|
||||||
echo "create firmware dir"
|
echo "create firmware directory"
|
||||||
mkdir v2_ro/tmp_dir
|
mkdir v2_ro/fw_dir
|
||||||
|
|
||||||
echo "unpack stock firmware"
|
echo "unpack stock firmware image"
|
||||||
./fw_tool.sh unpack v2_ro/demo_4.9.8.1002.bin v2_ro/tmp_dir
|
./fw_tool.sh unpack v2_ro/demo_4.9.8.1002.bin v2_ro/fw_dir
|
||||||
|
|
||||||
echo "replace kernel"
|
echo "replace factory kernel"
|
||||||
cp v2_kernel.bin v2_ro/tmp_dir/kernel.bin
|
cp v2_kernel.bin v2_ro/fw_dir/kernel.bin
|
||||||
|
|
||||||
echo "pack firmware with new kernel"
|
echo "pack firmware image with new kernel"
|
||||||
./fw_tool.sh pack v2_ro/tmp_dir/ demo.bin
|
./fw_tool.sh pack v2_ro/fw_dir/ demo.bin
|
||||||
|
|
||||||
echo "md5sum is: " `md5sum demo.bin`
|
echo "remove temporary work directory"
|
||||||
rm -rf v2_ro
|
rm -rf v2_ro
|
||||||
|
|
||||||
echo "demo.bin ready. Please copy demo.bin to your memory card"
|
echo "demo.bin ready. Please copy demo.bin to your memory card"
|
||||||
|
Loading…
Reference in New Issue
Block a user