EliasKotlyar / Xiaomi-Dafang-Hacks

4.17k stars 1k forks source link

Wyze Cam v2 CFW install fails: No filesystem could mount root, tried: squashfs #1659

Closed BlessDeix92 closed 3 years ago

BlessDeix92 commented 3 years ago

I just obtained a Wyze Cam v2 from Amazon USA and am attempting to install the CFW, but it's not working.

I searched existing bugs and info and double checked my work, but I think there's something else wrong that is outside of my control or knowledge.

It looks like there may be something different about the uboot or existing firmware which is incompatible with the custom firmware.

The board inside has some silkscreen dates on it, including "2020_02_22" and "2020.06.30", so it's a fairly recent revision.

I verified the hashes on the demo.bin file as correct and the console log seems to indicate it is being flashed correctly, but then the device won't boot at all.

I was able to restore the OEM firmware file demo_4.9.5.115.bin and that appears to restore the device to an operational condition.

I pulled the firmware_mod dir from git master, origin at 7d2eebaed6b991a84e66bfdba807da8edcee105d, which is current.

I am an experienced linux user and experienced with embedded type devices such as this, so I connected a serial port to get debugging info.

The key part of the boot log seems to be this:

[    1.851090] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    1.858332] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    1.867496] List of all partitions:
[    1.871148] 1f00             256 mtdblock0  (driver?)
[    1.876514] 1f01            2048 mtdblock1  (driver?)
[    1.881756] 1f02            3392 mtdblock2  (driver?)
[    1.887042] 1f03             640 mtdblock3  (driver?)
[    1.892284] 1f04            4736 mtdblock4  (driver?)
[    1.897562] 1f05            2048 mtdblock5  (driver?)
[    1.902824] 1f06             640 mtdblock6  (driver?)
[    1.908066] 1f07            2048 mtdblock7  (driver?)
[    1.913320] 1f08             256 mtdblock8  (driver?)
[    1.918562] 1f09             256 mtdblock9  (driver?)
[    1.923818] 1f0a              64 mtdblock10  (driver?)
[    1.929142] No filesystem could mount root, tried:  squashfs
[    1.935028] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[    1.943686] Rebooting in 3 seconds..

Serial console log attached. It shows the CFW install, then the boot fail after the sdcard was swapped with the firmware_mod files.

console.log

BlessDeix92 commented 3 years ago

Also I can't break uboot. It's autoboot timer is set to 0, so I can't do anything with it, which is frustrating. I'm not sure if that's expected or not for the OEM uboot.

jmtatsch commented 3 years ago

Hmm, you might want to try building a new custom firmware for your camera based on a more recent wyzecam v2 firmware.

BlessDeix92 commented 3 years ago

Thanks for the advice. I had assumed that the pre-built image for the on-board spi-nor flash shim (or whatever it's called) was kept up to date. I will try compiling from source and installing that. Will report back in a day or two.

BlessDeix92 commented 3 years ago

Are there any instructions for how to build a new CFW/shim?

I think the script is at hacks/firmware/create_hacked_firmware_wyzecam_v2.sh. That seems to use OEM firmware "4.9.4.2".

BlessDeix92 commented 3 years ago

./packer.py requires $FIRMWARE_ROOT/kernel.bin $OUTFILE $FIRMWARE_ROOT/driver.bin $FIRMWARE_ROOT/appfs.bin

Where do I get those?

BlessDeix92 commented 3 years ago

Also documentation/notes for this project don't exist.

jmtatsch commented 3 years ago

When you dump the firmware from a fresh device (not yours because its overwritten with an older firmware) you get those files. Also you get those files if you unpack a firmware file. Documentation needs knowing people willing to write it, which are always scarce. There is a reason why this project is called Dafang hacks not alternative Dafang production firmware ;)

BlessDeix92 commented 3 years ago

That didn't help me at all. But at least you feel good about yourself.

jmtatsch commented 3 years ago

This is free software maintained in my free time. If you want something to be improved DO IT YOURSELF BUT DONT EXPECT OTHERS TO DO IT FOR YOU. IF YOU ARE NOT ABLE TO DO IT PAY SOMEONE TO DO IT. BUT STOP ACTING LIKE AN ENTITLED LITTLE PR***.