HooToo TM-05, Add LZMA Loader

Don't steal others topic! :grinning:

Finding the offset:

  • create the loader-okli and initramfs recipes as usual
  • flash the OKLI factory.bin to device
  • boot the initramfs through TFTP
  • examine the flash!

LOL - you are right, sorry! Stopping now :laughing:

100% agree with the steps, except ... no serial access, can't see the flash. Ahhh - you're right, thanks! Boot initramfs.

1 Like

Does Ravpower support booting from TFTP ... without serial access? :thinking:

It's not looking like it, but again - flying blind. I can go back to an older / stock sysupgrade.bin, but not quite sure how to find the flash address inside the (ssh) shell.

Should I open a new discussion topic for Ravpower? I do agree with your comment above!

Yup, as it could be another long journey without serial! :upside_down_face:

Sadly, yes .. :stuck_out_tongue_winking_eye:. New posting created, here ... RAVPower WD-03, Add LZMA Loader

BTW, do you know what is still open on the Hootoo TM-05 PR? Just to avoid more git-heck, would be nice to have one working, before messing with other code.

Thanks!

At least the commit message should cleaned up!

The loader-okli things also needs a reviewer, as Adrian don't want to review that part! I wanted to help on that part, but Adrian didn't respond yet.

Sorry, you lost me there - do you mean something needs to be changed in it?

NP, makes sense - thanks!

About the commit message, see my inline comments below!

The HooToo TM05 is a battery powered router, with an Ethernet and USB port.
Vendor U-Boot limited to 1.5 MB kernel size, so use lzma loader (loader-okli).
Updated from PR review comments. MAC assignment based on vendor firmware,

"Updated from PR review comments." is not needed here.

2.4 GHz, *:b4 (factory 0x04)
LAN/label, *:b4 (factory 0x28)
WAN, *:b5 (factory 0x2e)

Specifications:
SOC: MediaTek MT7620N
BATTERY: 10400mAh
WLAN: 802.11bgn
LAN: 1x 10/100 Mbps Ethernet
USB: 1x USB 2.0 (Type-A)
RAM: 64 MB
FLASH: GigaDevice GD25Q64, Serial 8 MB Flash
Speed increased to 80 MHz, with PR comments / updates.

"...Serial 8 MB flash, clocked at 80 Mhz" is more than enough!

LED: Status LED (blue after boot, green with WiFi traffic
4 leds to indicate power level of the battery (unable to control)
INPUT: Power, reset button

Tested and working:

  • Ethernet
  • 2.4 GHz WiFi (Correct MAC-address)
  • Installation from TFTP (recovery)
  • OpenWRT sysupgrade (Preserving and non-preserving)
  • LEDs (except as noted above)
  • Button (reset)
  • I2C, which is needed for reading battery charge status and level

Installation:

  • Download the factory image (TFTP recovery handles directly!).
  • Place it in the root of a clean TFTP server running on your computer.
  • Rename the image to "kernel" be sure there is no file extension.
  • Plug the router into your computer via Ethernet.
  • Set your computer to use 10.10.10.254 as its IP address.
  • With your router shut down, hold down the power button until the first
    white LED lights up.
  • Push and hold the reset button and release the power button. Continue
    holding the reset button for 30 seconds or until it begins searching
    for files on your TFTP server, whichever comes first.
  • The router (10.10.10.128) will look for your computer at 10.10.10.254
    and install the kernel file. Once it has finished installation of the
    kernel file, it will search for a (nonexistent) rootfs file when it
    begins searching for this file, shut down the router by holding the
    power button normally.
  • Start up your router normally.

Notes:

  • U-Boot environment cannot be modified, as it will conflict with rootfs

BIG THANKS to @mpratt14 and @xabolcs - without them this would not have
happened (and getting the lzma loader to work, awesome!)

Just reword this to something like: "I would like to thank @mpratt14 and @xabolcs for their help getting the lzma loader to work!"

1 Like

Done, thanks!

It might stay open for a while, no particular reason. Sometimes they don't merge things right away, maybe waiting until version 20 release is closer.

You should make a new branch for your work on the Ravpower

git checkout -b ravpower-wd03
git reset --hard HEAD^

1 Like

Agreed - thanks!

To understand ... which HEAD does this reset to? Meaning .... master, or another branch?

HEAD^ actually means "the commit right before HEAD"

if you were on branch hootoo-tm05 and you did git checkout -b <something else>
the new branch will be an exact copy, so you need to undo your HooToo commit which is HEAD on the original branch (aka the first commit you see in git log while on that branch)

1 Like

That actually makes sense :smile:. Thanks!

BTW, if you're interested - while I have been waiting on some of these longer runs, did give me a bit of time to get back to this,

Being a battery powered device, I wanted the web interface to show me battery status! This is from the HooToo,

2 Likes

Wow thats really cool. Too much JS for me, I am not a web developer lol

However I see that you have an accidental extra commit, looks like you merged instead of rebased.

BTW, perhaps a dumb question, but - on this part of the recipe, why pad-to 64k, and then compress? Just to understand.

  COMPILE/loader-$(1).bin := loader-okli-compile | pad-to 64k | lzma | \
        uImage lzma

Thanks!

Because it just hangs without pad-to! :person_shrugging:
See my mailing list mail for DIR-860L at the beginning of this thread! I had to use pad-to 32k.

Try with smaller values too!
Delete loader-*.bin and do make!

You should also try without pad-to too!

You could also try as uImage none:

  COMPILE/loader-$(1).bin := loader-okli-compile | uImage none

The bootloaders for whatever reason cannot handle (or maybe rejects) an image that small after decompression. Fortunately you can pad as much as you want before compression, and it doesn't really effect the size of the image after compression.

edit: meant to say "decompression"

LOL - OK, NP! Just wasn't understanding, but that makes sense ... and I wasn't completely crazy :laughing:

Agreed, I noticed that as well, and it makes sense. So no real reason to mess with it - I was just trying to understand.