automated installation update

This commit is contained in:
Alfonso Gamboa 2022-04-02 21:44:06 -07:00
parent cd6687f917
commit c60696010e
3 changed files with 42 additions and 62 deletions

View File

@ -1,7 +1,7 @@
# wz_mini_hacks
### v3 devices ONLY
Run the latest stable firmware on your v3 cam and have root access to the device. This is in early stages of testing, use CAUTION if you are unsure of what you are doing. No support whatsoever is offered with this release.
Run the latest stable ( 4.36.8.32 ) firmware on your v3 cam and have root access to the device. This is in early stages of testing, use CAUTION if you are unsure of what you are doing. No support whatsoever is offered with this release.
## Features
@ -13,27 +13,19 @@ Run the latest stable firmware on your v3 cam and have root access to the device
* Ability to block remote AND app initiated firmware updates.
* An Internet connection is required to download and patch the files required for this to work.
* Inspired by HclX and WyzeHacks, borrowed busybox and dropbearmulti from his v2 repo. Bless you for all your work! You are the master!
* *NEW* Automated installer, put files on the micro sd card and wait for the unit to reboot.
## Setup
1. Flash your v3 to 4.36.0.280, then use wyze hacks to get telnet running on your device.
2. git clone the repo, then run ./setup.sh compile to generate the files to be copied to your SD card
3. copy all the files inside of SD_ROOT to your micro sd card, then put the card in your v3.
4. telnet to your device, then cd to /media/mmc
5. run ./wz_mini_installer.sh, this will flash the modified partitions and enable ssh.
6. The camera will reboot, then connect via the IP address of your device using SSH, port 22. username is root password is WYom2020.
1. git clone the repo, then run ./setup.sh compile to generate the files to be copied to your SD card
2. copy all the files inside of SD_ROOT to your micro sd card
On PC:
```bash
./setup.sh compile
```
On Device:
```bash
cd /media/mmc
./wz_mini_installer.sh
```
To disable automatic firmware updates, edit run_mmc.sh on your micro sd card, un-comment the lines following:
```bash
#echo "Disable remote firmware upgrade, uncomment lines below to enable"
@ -41,6 +33,16 @@ To disable automatic firmware updates, edit run_mmc.sh on your micro sd card, un
If a remote or app update is initiated, the camera will reboot due to the failure of the update. The firmware update should not proceed again for some time, or at all again.
## Installation
1. Insert the micro sd memory card into the v3 camera
2. The installation will begin when the front led light blinks slowly between red and blue.
3. The installation will complete when the front led light blinks rapidly red and blue.
4. The camera will reboot, then you may connect via the IP address of your device using SSH, port 22. username is root password is WYom2020.
## Customization
Edit run_mmc.sh, this is a script stored on the micro sd card that is run when the camera boots. You can change the hostname of the camera, mount NFS, add ping commands, anything you like.
## WARNING
```
AS WITH ANY UNSUPPORTED SYSTEM MODIFICATIONS, USING THIS MAY LEAD TO A DEVICE BRICK
@ -54,3 +56,9 @@ DO NOT USE THIS SOFTWARE IF YOU ARE NOT CONFIDENT IN RESTORING YOUR DEVICE FROM
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## Thank You
Thank you to everyone who is passionate about Wyze products for making the devices popular, and thank you to Wyze for producing them. Sign up for CamPlus, show some love to the company.
Thanks for HclX for WyzeHacks!
Thank you bakueikozo for his atomcam_tools repo! https://github.com/bakueikozo/atomcam_tools
Thank you to virmaior for the atomcam_tools info!

BIN
Test.tar Normal file

Binary file not shown.

View File

@ -4,8 +4,7 @@ LATEST_ROOTFS="4.36.3.19"
LATEST_FW="4.36.8.32"
clean() {
rm -f *.tar*
rm -rf ./*_ext
rm -rf tmp_root
rm -rf SD_ROOT
}
@ -14,6 +13,9 @@ setup() {
echo "Create SD Card root directory"
mkdir SD_ROOT
echo "Copy test to SD_ROOT"
cp Test.tar SD_ROOT
echo "Download utilities to SD_ROOT"
wget https://www.busybox.net/downloads/binaries/1.21.1/busybox-mipsel -O SD_ROOT/busybox
@ -22,33 +24,37 @@ cp dropbearmulti SD_ROOT
echo "Download latest rootfs firmware $LATEST_ROOTFS"
wget https://s3-us-west-2.amazonaws.com/wuv2/upgrade/WYZE_CAKP2JFUS/firmware/$LATEST_ROOTFS.tar
mkdir "$LATEST_ROOTFS"_ext
tar -xf $LATEST_ROOTFS.tar -C ./"$LATEST_ROOTFS"_ext
wget https://s3-us-west-2.amazonaws.com/wuv2/upgrade/WYZE_CAKP2JFUS/firmware/$LATEST_ROOTFS.tar --directory-prefix=./tmp_root/
mkdir ./tmp_root/"$LATEST_ROOTFS"_ext
tar -xf ./tmp_root/$LATEST_ROOTFS.tar -C ./tmp_root/"$LATEST_ROOTFS"_ext
echo "Download latest stable firmware $LATEST_FW"
mkdir "$LATEST_FW"_ext
wget https://s3-us-west-2.amazonaws.com/wuv2/upgrade/WYZE_CAKP2JFUS/firmware/$LATEST_FW.tar
tar -xf $LATEST_FW.tar -C ./"$LATEST_FW"_ext
mkdir ./tmp_root/"$LATEST_FW"_ext
wget https://s3-us-west-2.amazonaws.com/wuv2/upgrade/WYZE_CAKP2JFUS/firmware/$LATEST_FW.tar --directory-prefix=./tmp_root/
tar -xf ./tmp_root/$LATEST_FW.tar -C ./tmp_root/"$LATEST_FW"_ext
echo "Extract rootfs, prepare for modification"
unsquashfs -d ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs
unsquashfs -d ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs
##test
mkdir ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/.ssh
echo "Change unknown stock password to WYom2020 in /etc/shadow"
rm -rf ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
echo "root:aVG8.5PMEOfnQ:0:0:99999:7:::" > ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
chmod 400 ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
rm -rf ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
echo "root:aVG8.5PMEOfnQ:0:0:99999:7:::" > ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
chmod 400 ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/shadow
echo "Add run_mmc.sh to rootfs rcS init.d script"
sed -i '/\-f\ \/system\/init\/app_init.sh/a { sleep 30; /media/mmc/run_mmc.sh > /media/mmc/wz_mini_hacks.log; } &' ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/init.d/rcS
sed -i '/\-f\ \/system\/init\/app_init.sh/a { sleep 30; /media/mmc/run_mmc.sh > /media/mmc/wz_mini_hacks.log; } &' ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir/etc/init.d/rcS
echo "repack rootfs for flashing"
mksquashfs ./"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir SD_ROOT/rootfs2.bin -noappend -all-root -comp xz
mksquashfs ./tmp_root/"$LATEST_ROOTFS"_ext/Upgrade/rootfs_dir SD_ROOT/rootfs2.bin -noappend -all-root -comp xz
echo "copy latest appfs and kernel to SD_ROOT"
cp ./"$LATEST_FW"_ext/Upgrade/app SD_ROOT/appfs.bin
cp ./"$LATEST_FW"_ext/Upgrade/kernel SD_ROOT/kernel.bin
cp ./tmp_root/"$LATEST_FW"_ext/Upgrade/app SD_ROOT/appfs.bin
cp ./tmp_root/"$LATEST_FW"_ext/Upgrade/kernel SD_ROOT/kernel.bin
echo "extract run_mmc.sh script to SD_ROOT"
@ -82,40 +88,6 @@ sleep 3
" > SD_ROOT/run_mmc.sh
chmod 755 SD_ROOT/run_mmc.sh
echo "extract wz_mini_installer.sh to SD_ROOT"
echo "#!/bin/sh
echo this must be run ON the camera itself
#add check to make sure this is only run on camera, use appver file -z
#check that bin files exist first before flashing, and compare SHA512
echo "create /configs/.ssh dir for dropbear ssh server"
mkdir /configs/.ssh
echo flash kernel to mtd1
flashcp -v /media/mmc/kernel.bin /dev/mtd1
echo flash apps to mtd3
flashcp -v /media/mmc/appfs.bin /dev/mtd3
echo flash modified rootfs to mtd2
flashcp -v /media/mmc/rootfs2.bin /dev/mtd2
echo done, rebooting.
echo WARN: IF REBOOT FAILS, OR SEGMENTATION FAULT ERROR OCCURS, PLEASE POWER CYCLE THE wyze v3 CAMERA MANUALLY BY REMOVING THE POWER CORD.
sync
sync
reboot
" > SD_ROOT/wz_mini_installer.sh
chmod 755 SD_ROOT/wz_mini_installer.sh
#echo "Extract appfsfs"
#unsquashfs -d ./436832_ext/Upgrade/ rootfs
}