Creating "firmware.bin" for Sunvalley FileHub devices (RAVPower, HooToo) to be used "as a whole" for flashing as intended by the vendor

This is a spin-off topic from the HooToo TM05 supporting topic about creating a real factory.bin instead kernel and rootfs.

In this topic I'd like to talk about development such an upgrade script and an OpenWrt recipe.

I also need some help from people with serial access to their devices. It's even better if they have some flash programming gadgets! :grinning:

1 Like

Count me it! :smile:

One "warning" - the Sunvalley shell has less capability than OpenWrt, but it's what has to be assumed. Agreed?

Thanks!

Thanks for your help! :+1:

I see! No cut, no awk but at least sed, dd and mtd_write :upside_down_face: !

Right, wanted to make sure you knew the limits - what you have to work with :smile:

FYI, tried creating a "new" HooToo file, replacing the kernel and roofs inside the HooToo stock file, updating the checksum. Ya, that didn't work ... :laughing:

Ended up going the TFTP route, with the 2 files - worked perfectly!

1 Like

Nice findings, thanks!

NP at all, will help as much as I can. The vendor (OEM) script did help, shows how they separate the script and binary, and the checksum calculation (with the functions that are available in OEM).

The stock update system has a pretty interesting way of handling things. I have the dev environment for the WD009, which includes a builder for these update files.

Basically the CRC is checked by both the script and the updater on the device. It includes not just the image, but parts of the script too - I think the calculation is done on the whole firmware file sans the first 4 lines, but I have to verify this.

The script itself extracts a rootFS ext2 image, mounts it, unmounts all MTD partitions, and chroots into the new environment. Then it proceeds to run a script in it, which does the flashing of the bootloader, kernel, and new rootFS, then reboots.

This environment contains a much more feature rich busybox, with dd and mtd_write included. I think you should be able to cobble together a build system within OpenWrt for it, which would then build the conversion image for every nightly and release.

@arrmo, I'm going to base my work on your rp-wd03 branch, and will add some new image recipe to HT-TM05, RP-WD03 and RP-WD009.

If somebody has HT-TM02, that would be nice.

1 Like

That makes sense to me - thanks! I can try to test the HT-TM05 and RP-WD03 once I'm back home (later next week).

Yell if there is anything else I can help with!