How to build OpenWrt from trunk for 4/32 device?

Hi! 19.07.4 is the last version that supports 4/32 devices, but if i do hardware upgrade (to 16/64 or 16/128) then how to build openwrt if previously listed device doesn't exist anymore? For example, MR3220 v2 can be upgraded to 16/64.

You modify all relevant parts of the source code.

You first revert the removal of that device (and all related stuff).
Then you change the needed parts of source to accommodate for your hardware changes (at least DTS or mach, possibly image creation).

Hardware upgrading 4/32 to 16/64 sounds like a hobby, as new 16/128 or better devices can be bought with a few euros.

1 Like

You can also build a very minimal image that has only the needed stuff instead of a hardware upgrade.

For example, I use some old tp-link wr841 v11 4/32 devices as vpn client for home office usage.
But to fit the needed stuff into such small flash, you have to choose your requirements very good.
Since linux 5.4 there isn't much free space for the rootfs...

If you're interested, i can share my minimal build config that can be extended to your needs...

"A few euros" - it's how much? Because really cheap routers - it is 4/32 with hardware upgrade, and 'normal' routers beginning from ~30$, it will very expensive for many devices.

4mb isn't enough to use openvpn-openssl, but yes, we can include wireguard, but some providers block p2p traffic so wireguard is not usable.
Did you build from trunk for your wr841?

And, what you mean "revert"? Copy some information of that devices from old releases or what?

You reverse the source changes that removed (or disabled) the device from source code.
"git revert" is the git command for reverting individual commits.

It's it possible to get openvpn running on Rel 19.07.4 with 4m. You have to side load to ram.
It does run for a few clients but nothing heavy duty.

Yes i build from trunk and i use openvpn-mbedtls.
Mbedtls gives a bit more performance on mips archs.

It will definitely fit into the 4 m flash of the wr841 with linux 5.4 on ath79.
I'v disabled only some debugging stuff, ppp, opkg and the other unrequited ssl stuff like ca-certificates, libustream-mbedtls and so on...

If anyone is really interested i can share the diffconfig.

1 Like

This are my minimal diffconfig for ath79 builds from latest master branch with linux 5.4:

Abosolute minimal (stripped kernel and libs, disabled stuff: ppp, opkg, ssl, debug):

CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_tplink_tl-wr841-v11=y
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_tplink_tl-wr841-v8=y
# CONFIG_KERNEL_CRASHLOG is not set
# CONFIG_KERNEL_DEBUG_FS is not set
# CONFIG_PACKAGE_ATH_DFS is not set
# CONFIG_PACKAGE_MAC80211_DEBUGFS is not set
# CONFIG_PACKAGE_MAC80211_MESH is not set
# CONFIG_PACKAGE_ca-bundle is not set
# CONFIG_PACKAGE_kmod-lib-crc-ccitt is not set
# CONFIG_PACKAGE_kmod-ppp is not set
# CONFIG_PACKAGE_libpthread is not set
# CONFIG_PACKAGE_libuclient is not set
# CONFIG_PACKAGE_libustream-wolfssl is not set
# CONFIG_PACKAGE_libwolfssl is not set
# CONFIG_PACKAGE_openwrt-keyring is not set
# CONFIG_PACKAGE_opkg is not set
# CONFIG_PACKAGE_ppp is not set
# CONFIG_PACKAGE_uboot-envtools is not set
# CONFIG_PACKAGE_uclient-fetch is not set
# CONFIG_PACKAGE_usign is not set
CONFIG_PACKAGE_wpad-basic=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
# CONFIG_SIGNATURE_CHECK is not set
# CONFIG_SIGNED_PACKAGES is not set
CONFIG_STRIP_KERNEL_EXPORTS=y
CONFIG_USE_MKLIBS=y
# CONFIG_WPA_WOLFSSL is not set

To use it for your own builds create the file .config with the content above inside the top dir of the openwrt source.

With openvpn-mbedtls and nano added i get 3605305 Bytes for the sysupgrade image of wr841 v11 which results in about 386 kb free flash for configs.

2 Likes