TL-wr841n v14 image (bounty?)

With the image builder i followed 4/32 reduction instructions, as per wiki page on that topic. That never produced a binary.

Compiling i just remember picking up a few configs from the forums. None produced a binary.
Then i starting slashing and it would still not compile. Until at some point i took out too much of busybox (all other candidates were gone) and that didn't boot. So i gave up and tossed the whole thing.

19.07 can not be compiled, as the commit for v14 never got back-ported (another good developer task).
I also tried compiling at the commit (which i found somewhere in the forum) but the feeds did not work (and i did not know how to work around that). The original commiter obviously got it to compile at the time but i don't know how to now. (another good candidate for a developers touch)

All in all it is a very weird edge case. I have seen other 4/32 devices with snapshot links, but v14 does not have anymore (even forms still link to non-existing snapshot downloads, so they must have existed)

so I've build around sept 2020 some images for another forum member that had an US hw version - i'm unsure if any changes were between the unit I had back hten - EU and his but it didn't work for him.
Anyhow this is all I have for this "beast" - outdated of course and without latest CVE patches:
some patches applies to 17.01 branch:
https://maurerr.github.io/lede-17.01.ng-mt7628/lede-ramips-mt7628-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin
https://maurerr.github.io/lede-17.01.ng-mt7628/lede-ramips-mt7628-tplink_tl-wr841n-v14-squashfs-tftp-recovery.bin
18.09 code from 09.2020
https://www.dropbox.com/s/5l48lmjapz6jvsp/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1
https://www.dropbox.com/s/9a0wrysxampxddn/openwrt-dnscrypt-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1 (dns over https included)
https://www.dropbox.com/s/9a0wrysxampxddn/openwrt-dnscrypt-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1 (dnscrypt v1 included)

1 Like

what does your routers need or will do? like i said, pppoe is a good candidate and/or firewall etc etc. but without the requirements its hard to make any good suggestions what can and should be striped.

That was a line from a movie. It was not intended to be personal. I apologize for it.

Version 21 brought a large increase in binary size by including libwolfssl (1.08 MB uncompressed) by default. The two packages that depend on libwolfssl are wpad-basic-wolfssl and libustream-wolfssl (which is used by uclient-fetch, also known as wget). Remove all of those, substituting wpad-mini with no SSL --which drops WPA3 functionality. hostapd-basic may be even smaller if you will never be needing wifi client capability. Also remove opkg if you haven't already. This is in addition to the usual removals of LuCI, everything related to ppp, and everything related to IPV6.

If you select v13 you will get a binary-- which you can't run, but you can see the size of the sysupgrade file to check how close it is to fitting in 4 MB flash to build the same thing for v14. I think it will need to be smaller than 4MiB minus eight 64 KiB blocks that are used for other things (bootloader 2, factory partition 1 and five free to build a jffs2 filesystem).

1 Like

@maurer Thanks for chipping in. Did i find these binaries in some other thread already? (those bricked my device)
I am curious (before trying) how you obtained/compiled v14 code for 17/18 version of openwrt. As the v14 commit was after 19.07.
(I'll try and follow mk24 now and see again if there is still a chance to build this "beast")

@mk24 Sure, which movie?

So i am setting up the compile again. Good idea with the v13 hack to check. Unedited i start at 4.719.421 bytes.
Both tp-link official firmware and were around 4.2500.00
I'll start cutting. But some questions come up:

tbc

V14's tftp won't allow v13 images - hex editing it might work though
As for my binaries I've applied the patches to my tree see github.com/maurerr/openwrt

Good news: without ssl imagebuilder can build an image. Even better, luci fits in. (EDIT: this image does not retain data, see below)
Not so good: that means no encrypted wifi, kind of a deal breaker for me. But the device can be used as a simple vlan switch, which for the 10 euro is ok.

@maurer lede (17) and opwenwrt (18) did not boot.

I tried again to build with menuconfig and got nowhere (ok because i like the imagebuilder).
With using v13 trick i could get to within 10k, but not closer :frowning:

Adding back wpad-mini or wpad-basic or hostapd-basic all support WPA2 (but not WPA3) and do not require a SSL library.

On the other hand, the build you made still includes a lot of packages that are only needed for wifi (iw, iwinfo, cfg80211, kmod-mt76, etc.) which could be removed when using the router in a wired only role.

indeed removing luci and adding wpad-mini produces an image

 make image PROFILE=tplink_tl-wr841n-v14 PACKAGES="-ppp -ppp-mod-pppoe -uclient-fetch -kmod-ip6tables -ip6tables -odhcpd-ipv6only -libip6tc2 -wpad-basic-wolfssl -kmod-ppp -kmod-pppoe -kmod-pppox -opkg -libwolfssl -firewall -kmod-ipv6 -odhcp6c -libustream-wolfssl -odhcpd -iptables  -dnsmasq -urngd  wpad-mini"

https://anonfiles.com/v1K931Mfxb/openwrt-21.02.2-ramips-mt76x8-tplink_tl-wr841n-v14_zip

@maurer I can confirm that. Unfortunately the device does not hold information (even just a password) with an image like that.
That was probably the case with my first image too.

@mk24 Removing those wifi modules makes the device usable (ie it holds its info), thanks

Just for completeness, here is my command line:
make -j17 image PROFILE=tplink_tl-wr841n-v14 PACKAGES="-ppp -ppp-mod-pppoe -uclient-fetch -kmod-ip6tables -ip6tables -odhcpd-ipv6only -libip6tc2 -wpad-basic-wolfssl -kmod-ppp -kmod-pppoe -kmod-pppox -opkg -libwolfssl -firewall -kmod-ipv6 -odhcp6c -libustream-wolfssl -odhcpd -iptables luci-base uhttpd -dnsmasq -urngd luci-theme-bootstrap luci-mod-admin-full -iw -iwinfo -cfg80211 -kmod-mt76-core -kmod-mt7603 -cfg80211"

The sysupgrade is 3474221 bytes, pretty good.

Possibly (maybe?) the open wifi can be made to work. But i am not working without GUI anymore.
For me this makes a 10e device a vlan managed switch (40e) and even it only has 100Mb, for my IOT network this is ok. I'll use stock firmware on the AP's (behind the vlan switch) and conclude this experiment.
Thanks everyone

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

so I've manage to build a 3.5MB image with the help of @Ashus 's config for ath79 tiny
maybe @rubydesign you have some time to test it https://anonfiles.com/Nfx5T9M3x0/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14_zip (remember you need to flash both files - first via tftp then from openwrt web/cli upgrade)

@maurer I did flash just to see if this really could be done. Alas, it does not boot :frowning:

I tftf'd the kernel over, even made sure with wireshark that it got there, but then only flashing leds, no response. Maybe you can link your config to see what could be the issue.
I'll try again if you want, i mean it would be a bit of a miracle.

PS: i don't fully understand this initial tftp and then sysupgrade, but it is what i did with my own images, even the ones i said are not keeping data.

sure here's the config file http://paste.debian.net/1233566/
and I've realized I've put CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=1024 same as ath79 instead of CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 for mt76x8
anyway here is another attempt with 256 "https://anonfiles.com/BbufW5Mcxd" and https://anonfiles.com/z0u5WfM5x1

1 Like

Well, first impressions are GOOD. configured it like normal, with vlans and 2 ap's and seems to be holding up. That make you @maurer some kind of code wizzard, and if i can send you a voucher or coffe say where!

I looked at the config and can't say i understand where that amount of saving comes from. I mean i was relatively close to getting luci in there. But half a meg less and did i see firewall and dhcp (and even remnants of ip6). Which all can go imho.

I'll post is problems occur later, but otherwise i must say this far exceeds expectations

2 Likes

Great to see it s working. Saving come from kernel striping :slight_smile: . Did you rebuild the image or used my builds? Just want to confirm it's working as I don't have a unit to test it anymore

1 Like

I started with yours. They seemed to work, i only ran it for an hour.
Then i recompiled and switched dnsmesg and dropbear off. Couldn't switch off firewall and didn't bother with ip6.
The result was 30k smaller (insignificant) but had several Mb more RAM available, so i kept with that and flashed already 12.
Thanks again man. That is really magic (in the definition of so complicated it may as well be). If you want to do some wizardry on Archer C50 v6 (unstable wifi) just say the word :slight_smile: I have 6 of those.

1 Like

Thaks for the confirmation.
Again glad it all worked out. Unfortunately can't help with the c60v6
V14 was an "old aquintance" so it was somehow easy to deal with it

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.