@xabolcs' custom builds for ramips/rt305x Sunvalleytek Tripmate devices: stock compatible flash layout for HooToo HT-TM01, HT-TM02 and RAVPower RP-WD02

TODO

Placeholder

Current status

  • sysupgrade doesn't work: it starts upgrading, reboots but keeps the system intact
  • sysupgrading from Offical OpenWrt image is still possible :frowning:
    • should be avoided (to prevent bricked devices) with some compatible or something
    • or just disable sysupgrade.bin :upside_down_face:
  • the release GitHub Action doesn't work, so no repacked images for OpenWrt 19.07.8 service release
  • it's compatible with HT-TM02 clones, but doesn't supports any of the extras: battery reading, microSD slot, etc

Support for battery reading has been started and it doesn't work at first try. As usual! :see_no_evil:

Sysupgrade serial log:

Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
killall: ash: no process killed
Sending TERM to remaining processes ... dnsmasq ubusd askfirst urngd logd netifd odhcpd ntpd 
Sending KILL to remaining processes ... ntpd 
Switching to ramdisk...
Performing system upgrade...
Could not open mtd device: firmware
Can't open device for writing!
cat: write error: Broken pipe
sysupgrade abort[  670.661483] reboot: Restarting system

Which means a porting error to me.


Battery reading now had a progress:

[   22.237524] i2c /dev entries driver
[   22.259628] i2c-ralink 10000900.i2c: clock 100KHz, re-start support

@arrmo , where did you get your i2cset and i2cget addresses?
I got errors only:

root@OpenWrt:~# i2cset -y 0 0x0a 0x0a 0x10
Error: Write failed
root@OpenWrt:~# i2cget -y 0 0x0a 0x0a
Error: Read failed

and the i2cdump script below returns nothing for me:

for i in 0 1 2 3 4 5 6 7; do for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do i2cdump -y 0 0x${i}${j} 2>/dev/null|grep -v 0123456789abcdef|grep -v XXXXXXXXXXXXXXXX; done; done;

I'm hacking at my branch-19.07-ht-tm02-new-dts branch.

  • sysupgrade-tar will be the aid for the sysupgrade error
  • I'm unsure about the DTS changes (enabling i2c for HT-TM01, enabling mode switch for HT-TM02): they works, but ...
  • i2c driver loads but nothing else :roll_eyes: (as already commented)

Sorry for the slow reply! Been out of pocket a few days, just saw this.

Got the info two places (and of course, tested to confirm :stuck_out_tongue_winking_eye:),

  1. I found some similar code here, and then pulled the datasheet for the HT66F40 to debug.
  2. I got the source code for the Hootoo from the vendor. Quick look now and I can't find it, but it was in there somewhere. LOL.

Bummer, HT-TM01 has HT66F30. That's why it doesn't work. :confused:

Dang it! :frowning_face:

Wizard @jwmullally, as you already know I use your awesome Image Builder frontend to hack around with some ramips/rt305x HooToo images.

After successfully adding a new device, I'm having problems improving the Makefile futher, my Makefile-fu ended here. :sweat_smile:
Could you give me a few hint in the following topics?

Adding new device

touching $(TOPDIR)/target/linux/$(BOARD)/base-files

Adding a new device I had to touch some base-files files in $(TOPDIR)/target/linux/$(BOARD)/base-files.
These files don't make their ways into image, only with the Image Builder's FILES="path" parameter.:confused:
Any hint?

handling patch series

I added the new devices as a separate commit on my branch, so I would like to apply all the patch automatically instead of listing them in Makefile.

OpenWrt uses quilt to handle patch series, but in Image Builder only the wrapper is included. It's command list is empty:

$ ./staging_dir/host/bin/quilt 
Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ...
       quilt --version
Commands are:

Global options:

--trace
	Runs the command in bash trace mode (-x). For internal debugging.

--quiltrc file
	Use the specified configuration file instead of ~/.quiltrc (or
	/builder/shared-workdir/build/staging_dir/host/etc/quilt.quiltrc if ~/.quiltrc does not exist).  See the pdf
	documentation for details about its possible contents.  The
	special value "-" causes quilt not to read any configuration
	file.

--version
	Print the version number and exit immediately.

Should I install quilt at OS level instead trying to revive IB's wrapper?
Thankfully there is an answered question at SO related to Makefile and quilt. :+1:

multi-profile support

Now I have ht-tm02 and ht-tm01 and I'd like to build them in one make command.
Without hard coding $(PROFILE) and/or duplicating the whole line:

	cd $(BUILDER) && make image PROFILE="$(PROFILE)" EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" PACKAGES="$(PACKAGES)" FILES="$(FILES)"

could you give me some hint for magical rules to achieve this?

Thanks! :slight_smile:

RE: HT66F30

There is a post at doozan.com - NSA325 fan control, which I paste here:

Hi @xabolcs , good to hear the method is useful, it does look like a handy approach to maintaining custom OpenWRT images.

Yes, I found that too a few months ago. Originally I didn't need to modify anything in base-files so I hadn't noticed it. I think the issue is that with Image Builder, those files come from the already built base-files packages (e.g. here). I found the easiest solution was specifying FILES= as you suggest. Because those are applied at the end of the filesystem build, it means anything can be customized easily, which is nice.

You could try something simple like this in your Makefile. It would save you having to install quilt and update a list of patches.

    $(foreach file, $(sort $(wildcard patches/*.patch)), echo "Patch file $(file)";)

Image Builder seems designed around building one profile at a time (I think?), so I wasn't able to find any alternative that didn't look overly complex. In the end I just went with the simple approach).

You could use another loop like:

PROFILES_TO_BUILD := myprofile1 myprofile2

images:
        $(foreach profile, $(PROFILES_TO_BUILD), echo "Building this profile: $(profile)";)

Or something more complicated like this with a dynamic rule per profile, but IMHO its better to keep Makefiles simple and easy to maintain :slight_smile:

1 Like

It just simply awesome!

Practically I added a whole new device to Image Builder, so it can use the packages from the official releases. :+1:

Thanks for all the hints, will bake them into my fork! :ok_hand: