Build for WNDR3700v1/v2 / WNDR3800 (discontinued)

One user reported that 4.14 actually was slower than 4.9 on his ar71xx (haven't benchmarked myself) so you probably wont see much of an improvement unless you're using flow offloading which may even it out.

Yes, build for wndr3700v2 from ath79 target works very well, but on new kernels ( > 4.14.68) wifi leds not works, so better is forgot new target and works on old ar71xx.

I am having no issues with the new kernel so far. The only thing I've noticed is with a WNDR3700v1 router which reproducible is not reachable via webinterface after update. Although I can reach it via ssh connection. When rebooting it reverts to the default IP address and to the default WifI settings. Sometimes even the password is lost. My guess is that it overwrites some of it's configuration. Probably the image is too big for the 7.5MB of internal Flash memory?

When connecting via ethernet 192.168.1.1 I can login either with the configured password or without any password and restore the configuration from a backup. After this it seems to run without any issues.

The only issues arise when updating. I always have to get it out behind the televison and connect it directly to my PC to restore the configuration.

Does anybody else have this issue? Shall I do an update without keeping settings and enter them manually after the update again?

Thanks for any advice!
nieroster

You can easily see from "df -h" is the overlay is mounted on a mtdblock, or ramdisk (tmpfs).
This is from 3700v2:

 OpenWrt SNAPSHOT, r8379-a6d02a7572
 -----------------------------------------------------
root@router2:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.5M      5.5M         0 100% /rom
tmpfs                    29.1M    936.0K     28.2M   3% /tmp
/dev/mtdblock5            8.6M    388.0K      8.2M   4% /overlay
overlayfs:/overlay        8.6M    388.0K      8.2M   4% /
tmpfs                   512.0K         0    512.0K   0% /dev

There is 8.6 MB left, and my settings etc. use 0.4 MB, leaving 8.2 free. Downscaling that to 3700v1 with 8MB instead of 16MB would mean only 0.2 MB free. If you have any additional settings crust, that can easily be consumed.

You are likely right: the image starts to be too large for v1.
I have currently only v2 and 3800, while my v1 is used by some relatives and still with a year-old version. So I am not testing v1 currently.

I can try cutting a few non-essential user-space packages away from the build, so that the image would be somewhat smaller. But likely the master with 4.14 is starting to reach the upper limits. (that is the reason why ath79 has been invented, but that is still incomplete work although the 3700v1/v2/37800 work pretty ok)

Is anybody using ext4 FS with usb drive etc.???
It is over 200kb sized package and I am not really using it yself, currently.

So that might be a target for removal.

hnyman, thnk you for your quick reply!

This is what it looks like on a WNDR3700v1, no additonal packets installed except for iputils-traceroute6:

BusyBox v1.29.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r8379-a6d02a7572
 -----------------------------------------------------
root@OpenWRT:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.5M      5.5M         0 100% /rom
tmpfs                    29.1M      1.8M     27.3M   6% /tmp
/dev/mtdblock5          576.0K    368.0K    208.0K  64% /overlay
overlayfs:/overlay      576.0K    368.0K    208.0K  64% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWRT:~#
                                         

In the Software tab it shows: Free space: 36% ( 208.00 KB ) This is probably enough to run the firmware but the update might use some temporary space too.

Can I point overlay to an external USB drive? Would this be a temporary solution?

nieroster

Hi there,

hnyman hnyman
October 26
Is anybody using ext4 FS with usb drive etc.???

Yes, I am on a 16GB USB2 stick.

It is over 200kb sized package and I am not really using it yself, currently.

Ah, then my usage is not well aligned...

So that might be a target for removal.

Well, is there any other "real"* that stays supported? I could then switch over before you drop ext4.... 

Best Regards

*) I guess I only really need long names and hardlinks

208K might be enough but just barely. If I remember right, 3 (or 4?) erase blocks (64 kB ?) are needed for overlayfs operations, so 208 kB might be just over 192 kB but below 256 kB. Makes it tight.

I have built master-r8380-6026356578-20181026-some_packages_removed that should offer 128 kB more space.

 OpenWrt SNAPSHOT, r8380-6026356578
 -----------------------------------------------------
root@router2:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.5M      5.5M         0 100% /rom
tmpfs                    29.1M    924.0K     28.2M   3% /tmp
/dev/mtdblock5            8.7M    388.0K      8.3M   4% /overlay
overlayfs:/overlay        8.7M    388.0K      8.3M   4% /
tmpfs                   512.0K         0    512.0K   0% /dev

No, sysupgrade is ramdisk based.

It could be a solution. search for "extroot". I have never used that myself, but should work.

To be honest, I may drop v1 from the master build and continue just with v2 and 3800, as I can test them. But v1 will still be in the 18.06 build, which is quite usable. WNDR3700v1 is getting old and small :frowning:

Yeah, I thought so that the ext4 package might be needed by some users.

The growth kernel 4.14 and the legacy device stuff in ar71xx is one of reasons, why ath79 DTS based firmware has been invented, but that is not quite ready for the mainstream, yet, I think.

Are you using the v1? or some other v2 or 3800?

Oh, I only have a lowly wndr3700v2, but thanks to your great builds, I never get around to press the turris omnia into service as main router, as I am drawn to more experimental master builts like a moth to the light :wink:
But please do not base the decision which packets to include on my usage, I will simply find another option (the reason for the usb stick was to get persistent storage for a vnstat database, back when my ISP actually threatened to charge by volume, which he never did).

Thank you so much!

As I am only using v2 and 3800 myself currently, I may well keep the package selection intact and just drop v1 from master builds. (having you online and SQM development etc. going on, is also important :wink: )

v2 with 16 MB flash is not the problem, but the old v1 with only 8 MB apparently now hits the size limit.

While I don't have either of those devices, 8 MB flash isn't too bad so far (using the tl-wdr3600 and tl-wdr4300 with 8 MB flash each myself), I guess you could easily improve your workflow by setting "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" and dropping some packages for the 8 MB wndr3[78]00 variants, e.g. luci-app-statistics, collectd, luci-theme-material and maybe curl sound like easy sacrifices (you can add modular packages on a per device basis or remove default packages from individual ones by prepending the package name with a minus sign).

Sure, I could drop some packages permanently to fit the build into 8 MB for v1. Material theme is one easy option, curl is another, also vsftpd and hfsplus-fs.

There are also some other packages that I do not currently use myself, but I am hesitant to drop any kernel packages, as those are checksumed to be build-specific.

hmm. That "minus sign" sounds more like the package list for the imagegenerator, not the full build toolchain that uses .config. But maybe I am wrong.

I have never tested the CONFIG_TARGET_PER_DEVICE_ROOTFS, but maybe I will need to familiarize myself with that.

Using the minus sign also works for (=y) default packages in the full buildroot (but it won't remove its dependencies automatically).

As an example, this works just fine:

##### brcm47xx-legacy.init: start #####

CONFIG_TARGET_brcm47xx=y
CONFIG_TARGET_brcm47xx_legacy=y
CONFIG_TARGET_DEVICE_brcm47xx_legacy_DEVICE_asus-wl-500gd=y
CONFIG_TARGET_DEVICE_PACKAGES_brcm47xx_legacy_DEVICE_asus-wl-500gd="-b43legacy-firmware -kmod-b43legacy kmod-b43 -kmod-usb-ohci -kmod-usb2 luci wpad-mini"
CONFIG_TARGET_DEVICE_brcm47xx_legacy_DEVICE_asus-wl-500gp-v1=y
CONFIG_TARGET_DEVICE_PACKAGES_brcm47xx_legacy_DEVICE_asus-wl-500gp-v1="6in4 -b43legacy-firmware blockd ddns-scripts_no-ip_com kmod-ath5k -kmod-b43 -kmod-b43legacy kmod-fs-ext4 kmod-nls-utf8 kmod-usb2 kmod-usb-printer kmod-usb-storage luci-app-bcp38 luci-app-ddns luci-app-p910nd luci-app-uhttpd luci-app-vnstat luci-ssl-openssl opkg -wpad-basic -wpad-mini wpad -wpad-openssl"
CONFIG_TARGET_DEVICE_brcm47xx_legacy_DEVICE_linksys-wrt54g=y
CONFIG_TARGET_DEVICE_PACKAGES_brcm47xx_legacy_DEVICE_linksys-wrt54g="-b43legacy-firmware -ip6tables -kmod-b43legacy -kmod-ipv6 -kmod-ip6tables -kmod-nf-conntrack6 -kmod-nf-ipt6 -kmod-ppp -kmod-pppoe -kmod-pppox -libip6tc -odhcp6c -odhcpd-ipv6only -ppp -ppp-mod-pppoe -wpad-basic wpad-mini -wpad -wpad-openssl"

### Debugging options
# CONFIG_KERNEL_KALLSYMS is not set
# CONFIG_KERNEL_DEBUG_FS is not set
# CONFIG_PACKAGE_MAC80211_DEBUGFS is not set

### Minify lua
CONFIG_LUCI_SRCDIET=y

### reduce PHY support
CONFIG_B43_FW_SQUASH_COREREVS="5,9"
CONFIG_B43_FW_SQUASH_PHYTYPES="G"
# CONFIG_PACKAGE_B43_PHY_LP is not set
# CONFIG_PACKAGE_B43_PHY_N is not set

### enable ath5k
CONFIG_PACKAGE_kmod-ath5k=m

##### brcm47xx-legacy.init: stop #####

##### config.init: start #####

### Enable per device rootfs
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y

### Debugging options
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
CONFIG_PACKAGE_kmod-ikconfig=m

### IPv6 support
CONFIG_PACKAGE_6in4=m

### build kmod-mtd-rw, so it is available for installing later
CONFIG_PACKAGE_kmod-mtd-rw=m

### USB device mount & filesystem support
CONFIG_PACKAGE_blockd=m
CONFIG_PACKAGE_kmod-usb-storage=m
CONFIG_PACKAGE_kmod-usb-storage-uas=m
CONFIG_PACKAGE_kmod-fs-ext4=m
CONFIG_PACKAGE_kmod-fs-f2fs=m
CONFIG_PACKAGE_kmod-nls-utf8=m
CONFIG_PACKAGE_kmod-usb2=m

### display and edit the uboot environment
CONFIG_PACKAGE_uboot-envtools=m
CONFIG_PACKAGE_nand-utils=m

### SMP CPUs need irqbalance, install htop where possible
CONFIG_PACKAGE_irqbalance=m
CONFIG_PACKAGE_htop=m

### ip full
CONFIG_PACKAGE_ip-full=m

### SSL certificates
CONFIG_PACKAGE_ca-certificates=m

### Luci (SSL from OpenSSL)
CONFIG_PACKAGE_luci-ssl-openssl=m
CONFIG_PACKAGE_luci-app-uhttpd=m

### Adblock package with Luci support, initially disabled
CONFIG_PACKAGE_luci-app-adblock=m

### Support for IETF BCP38
CONFIG_PACKAGE_luci-app-bcp38=m

### Dynamic DNS support
CONFIG_PACKAGE_luci-app-ddns=m
CONFIG_PACKAGE_ddns-scripts_no-ip_com=m

### p910nd support for USB printers
CONFIG_PACKAGE_luci-app-p910nd=m
CONFIG_PACKAGE_kmod-usb-printer=m

### bandwidth monitoring support for Luci
CONFIG_PACKAGE_luci-app-nlbwmon=m

### (luci-)SQM support
CONFIG_PACKAGE_luci-app-sqm=m
CONFIG_PACKAGE_sqm-scripts-extra=m

### WoL support for Luci
CONFIG_PACKAGE_luci-app-wol=m

### mwan3 support for Luci
CONFIG_PACKAGE_luci-app-mwan3=m

### don't build deprecated ciphers for openssl
# CONFIG_OPENSSL_WITH_DEPRECATED is not set

### WLAN support
CONFIG_PACKAGE_wpad=m
CONFIG_PACKAGE_wpad-basic=m
CONFIG_PACKAGE_wpad-openssl=m
CONFIG_PACKAGE_wpad-mini=m
CONFIG_WPA_SUPPLICANT_INTERNAL=y
CONFIG_WPA_RFKILL_SUPPORT=y
CONFIG_PACKAGE_wpa-cli=m
CONFIG_PACKAGE_hostapd-utils=m

### ath9k_htc/ carl9170
CONFIG_PACKAGE_kmod-ath9k-htc=m
CONFIG_PACKAGE_kmod-carl9170=m
CONFIG_PACKAGE_kmod-usb-ledtrig-usbport=m

##### config.init: stop #####

The config.init part is generic for all my builds, brcm47xx-legacy.init gets replaced by ath79.init, brcm47xx-generic.init, ipq806x.init or lantiq.init as needed (ath79, ipq806x and lantiq get an additional set of (modular) packages via strongswan.init, lantiq also asterisk.init on top), taking brcm47xx-legacy as the most ressource constrained example. All simple text config snippets, concatenated and expaned to a full config via make defconfig oldconfig as needed for the individual target arch.

In comparison a rather full config for ipq806x.init:

##### ipq806x.init: start #####

CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_netgear_r7800=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_netgear_r7800="6in4 blockd ca-certificates collectd-mod-conntrack collectd-mod-cpufreq collectd-mod-entropy collectd-mod-ping collectd-mod-thermal collectd-mod-uptime collectd-mod-wireless ddns-scripts_no-ip_com hostapd-utils htop irqbalance kmod-fs-ext4 kmod-fs-f2fs kmod-nls-utf8 kmod-usb2 kmod-usb-printer kmod-usb-storage kmod-usb-storage-uas luci-app-adblock luci-app-bcp38 luci-app-ddns luci-app-p910nd luci-app-sqm luci-app-statistics luci-app-uhttpd luci-app-vnstat luci-app-wol luci-ssl-openssl openssl-util opkg sqm-scripts-extra strongswan-default strongswan-mod-addrblock strongswan-mod-ccm strongswan-mod-cmac strongswan-mod-ctr strongswan-mod-curve25519 strongswan-mod-dhcp strongswan-mod-eap-identity strongswan-mod-eap-md5 strongswan-mod-eap-mschapv2 strongswan-mod-eap-tls strongswan-mod-gcm strongswan-mod-hmac strongswan-mod-openssl strongswan-mod-xauth-eap strongswan-ipsec strongswan-pki wpa-cli -wpad-basic -wpad-mini -wpad wpad-openssl"
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_zyxel_nbg6817=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_zyxel_nbg6817="6in4 blockd ca-certificates collectd-mod-conntrack collectd-mod-cpufreq collectd-mod-entropy collectd-mod-ping collectd-mod-thermal collectd-mod-uptime collectd-mod-wireless ddns-scripts_no-ip_com hostapd-utils htop ip-full irqbalance kmod-fs-ext4 kmod-fs-f2fs kmod-ikconfig kmod-nls-utf8 kmod-usb2 kmod-usb-printer kmod-usb-storage kmod-usb-storage-uas luci-app-adblock luci-app-advanced-reboot luci-app-bcp38 luci-app-ddns luci-app-nlbwmon luci-app-p910nd luci-app-sqm luci-app-statistics luci-app-uhttpd luci-app-vnstat luci-app-wol luci-ssl-openssl nbg6817-tools openssl-util opkg sqm-scripts-extra strongswan-default strongswan-mod-addrblock strongswan-mod-ccm strongswan-mod-cmac strongswan-mod-ctr strongswan-mod-curve25519 strongswan-mod-dhcp strongswan-mod-eap-identity strongswan-mod-eap-md5 strongswan-mod-eap-mschapv2 strongswan-mod-eap-tls strongswan-mod-gcm strongswan-mod-hmac strongswan-mod-openssl strongswan-mod-xauth-eap strongswan-ipsec strongswan-pki uboot-envtools wpa-cli -wpad-basic -wpad-mini -wpad wpad-openssl"

### dual-boot selection for Luci
CONFIG_PACKAGE_luci-app-advanced-reboot=m
CONFIG_PACKAGE_nbg6817-tools=m

### Luci statistics
CONFIG_PACKAGE_luci-app-statistics=m
CONFIG_PACKAGE_collectd-mod-conntrack=m
CONFIG_PACKAGE_collectd-mod-cpufreq=m
CONFIG_PACKAGE_collectd-mod-entropy=m
CONFIG_PACKAGE_collectd-mod-ping=m
CONFIG_PACKAGE_collectd-mod-thermal=m
CONFIG_PACKAGE_collectd-mod-uptime=m
CONFIG_PACKAGE_collectd-mod-wireless=m

### optimize for speed
CONFIG_OPENSSL_OPTIMIZE_SPEED=y
CONFIG_ZLIB_OPTIMIZE_SPEED=y

### enable Elliptic curve cryptography for dropbear
CONFIG_DROPBEAR_ECC=y
CONFIG_DROPBEAR_ECC_FULL=y

##### ipq806x.init: stop #####
1 Like

Thanks for info. Will look into it. I use similar .config recipe + make defconfig approach, so this might be quite usable for my WNDR3700 build.

@nieroster
Based on the input from @slh I dropped some packages from the 3700v1 build.

Since master-r8381-4056be58f3-20181027, the master build does not contain these packages and dependencies:

  • vsftpd-tls tree fs-hfsplus fs-ntfs wake-on-lan upnp Material-theme

I also totally dropped curl and 3G USB modem user space parts (which can be installed from snapshot repo).

Now the v1 build has only a 6.65 MB firmware file, while v2 & 3800 are 6.9 MB instead of the old 7.1 MB.

@hnyman
Thank you very much for the quick help! It works perfectly!

BusyBox v1.29.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r8381-4056be58f3
 -----------------------------------------------------
root@OpenWRT:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.0M      5.0M         0 100% /rom
tmpfs                    29.1M      1.5M     27.6M   5% /tmp
/dev/mtdblock5            1.0M    400.0K    624.0K  39% /overlay
overlayfs:/overlay        1.0M    400.0K    624.0K  39% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWRT:~#

On the Software tab: Free space: 61% ( 624.00 KB )

nieroster

Now that curl has been removed I had to modify a script that checks internet connectivity.

I noticed that the script is working, if I run it from a terminal window, but it does not, when running from the Custom Commands Dashboard. The command which behaves differently is:

echo $(wget --timeout=2 --spider --server-response www.google.com -q 2>&1 | sed 's/^[^ ]*  *\([0-9]\).*/\1/; 1q')

If I run it from a terminal window it returns:

HTTP/1.1 200 OK

If I run the same command from a shell script at the Custom Commands page it returns:

wget: unrecognized option: server-response

Why does it behave differently depending on where it is started?

nieroster

I guess I should note that I am just the junior partner on sqm, @tohojo is the responsible adult :wink: ermh guiding spirit...

Anyway, just upgraded to your " OpenWrt SNAPSHOT, r8379-a6d02a7572" and I am still amazed how well the 3700v2 still behaves. Sure it is only on a lowly (by today's standards) 50/10 link, but still I this thing is punching way above its weight since 2011/12, making it >= 7 years.

First guess is that your script finds the limited-feature wget tool uclient-fetch from /bin, while you actually want the full-fledged GNU wget from /usr/bin

PATH should take care of that, but if you run the script in /bin, it may find the wrong wget

root@router1:~# ls -l /bin/wg*
lrwxrwxrwx    1 root     root            13 Oct 26 23:16 /bin/wget -> uclient-fetch
root@router1:~# ls -l /usr/bin/wg*
lrwxrwxrwx    1 root     root             8 Oct 26 23:16 /usr/bin/wget -> wget-ssl
-rwxr-xr-x    1 root     root        394137 Oct 26 23:16 /usr/bin/wget-ssl