Warning about 4/32 devices

TL;DR - For OpenWrt 21.02, we recommend 16/128 devices - at least 16Mbytes Flash and 128MBytes RAM.

Devices with ≤4MB Flash and/or ≤32MB RAM (so-called “4/32 devices”) may be made to work but they will be very limited (usually you won't be able to install or run additional packages) because they have low RAM and Flash space.
Consider this when choosing a device to buy, or when deciding to flash OpenWrt on your device because it is listed as supported.

Default builds of OpenWrt 21.02 can only run on 8/64 devices. Every operating system requires:

  1. Sufficient RAM for stable operation
  2. Sufficient Flash to accommodate the firmware image
  • 32 MB can barely work for minimal router/AP functions, but may repeatedly “crash”, depending on your hardware and use case
  • 64 MB may still have issues with stability, depending on your hardware and use cases
  • 128 MB or more is recommended (in 2021) if software past basic router/AP functionality is to be used
  • 4MB is absolute minimum (but you won't be able to install LuCI web interface) / 8MB is barely enough (will fit LuCI and some other applications) / 16MB offers more flexibility
  • 4MB devices can't fit anything noteworthy unless you use the Image Generator (Image Builder) (that requires a Linux system and some mild experience) or use Extroot. Experienced users creating custom builds may be able to Saving firmware space, but many packages won't ever fit no matter what you do.
  • 8MB (or more) of Flash lets install at least a few additional software packages,
  • 16MB Flash (minimum) is recommended for the foreseeable future (in 2021)

Most probably, you will not be able to install the following popular packages (and others) on a device with only 4MB flash:

  • VPNs and any other package requiring encryption
  • Samba (shared folders)
  • 3G/4G dongle support
  • filesystem drivers/tools for formatting and checking a filesystem for Extroot

As the current stable 21.02 release uses kernel 5.4 that is roughly 0.5 MB larger than the kernel 4.14 used in the old 19.07.x releases, and SSL/HTTPS has been enabled by default needing at least some 0.3 MB flash space for the SSL libraries, the free flash space available on 8MB flash systems will be rather small in the current OpenWrt 21.02 release. OpenWrt master has already partially moved to kernel 5.10, which is still larger.

It is getting harder or even impossible over time to support devices with low Flash + RAM. You will be less likely to find people willing to assist on the forums.

The 32 MB RAM is harder limitation than the flash size. The current Linux 5.4 barely works with a 32 MB RAM system and spikes in memory consumption can easily crash the router with OOM (Out-of-Memory) errors.

OpenWrt support for those devices has been end with the 19.07 release, ie. 19.07 was the last release with support for 4/32 MB devices. There is no future releases and no images ready for download after 19.07.

If you are not an expert user of OpenWrt (that is, if you do not build your own images), you should consider

16/64 as an absolute minimum for any device, with at least 128 MB of RAM being preferred.

If a device has less than 16 MB of Flash and/or less than 64 MB of RAM, it may be unstable in basic operation under OpenWrt from 19.07 onward. Further expect that support for the device may be dropped at any time and that security patches/updates to the kernel, drivers, and/or application software will not be available. While there is no warranty of ongoing support for any device under OpenWrt, those with insufficient resources are at great risk for “end of support”.

Previous versions of OpenWrt (such as earlier versions of 18.06.x, 17.01.x, 15.05.x “Chaos Calmer” and prior) contain now-known security vulnerabilities in the kernel, wireless implementation, and/or application code. The OpenWrt community cannot support running known-vulnerable code under any situation. “It's just my router” is not justification as your router becoming compromised can impact others as a jump-point, command-and-control, or other participant in an attack. In many cases, these known vulnerabilities are being actively targeted, potentially including by advanced, likely state-sponsored or state-affiliated actor or actors.

As example, the size of the sysupgrade release image for WNDR3700v1, an ar71xx/ath79 device that has been supported by Openwrt for ten years:

master:        5824.3 KB (snapshot without LuCI)
22.03.2:       5952.3 KB
21.02.5:       5312.3 KB
19.07.8:       4096.3 KB
18.06.8:       3712.0 KB
17.01.7:       3584.0 KB
15.05.1:       3584.0 KB
14.07:         3328.0 KB
12.09:         2816.0 KB

Main reason is growth in size of the Linux kernel itself, but all included core packages (wifi, LuCI, etc.) also tend to grow as their features get expanded.

As written in this forum post by forum user slh.

First of all, I'm not pretending to speak for the LEDE team, however looking at the plain numbers presents a quite obvious situation.

Taking “ Why no images generated for default D-Link DIR-600A1?” as an example (yes, some other 4 MB flash devices are a bit better than this particular specimen, the trend remains to be the same though).

D-Link DIR-600A1:
Backfire 10.03..............: 2293764 bytes
Backfire 10.03.1............: 2949124 bytes
Attitude Adjustment 12.09...: 2883588 bytes
Barrier Breaker 14.07.......: 3276804 bytes
Chaos Calmer 15.05..........: 3342340 bytes
Chaos Calmer 15.05.1........: 3407876 bytes
LEDE 17.01 release branch...: 3473412 bytes
absolute firmware size......: 3735576 bytes
maximum usable firmware size: 3538944 bytes

(all of these figures are for release images, including luci and a more or less identical feature set).

The erase block size for this (and most other) devices is 64 KB, so you now end up with 256 KB (== 4 erase blocks) free space, compared to 320 KB (== 5 erase blocks before). While this may look comfortable at a first glance, you have to consider that free space can only be assigned in (full) block size chunks, so once you touch the overlay partition at all, you already have one erase block in use (64 KB). Therefore the firmware creation tools used by LEDE enforce at least 3 erase blocks reserve for the overlay filesystem (that's where the maximum usable firmware size comes from, compared to the total size of the firmware partition). In other words, with 17.01 you'll only have 1 erase block (64 KB) before the hard limit, while 15.05.1 still gave you 2 spare erase blocks (128 KB) for your own use. On top of this there is the file system overhead needed for formatting to jffs2 as well (jffs2 does some light compression, but its fs header and log (more or less directory entries) need some space, then there is the hard requirement to keep some free space (in erase block == 64 KB chunks) for the garbage collection to work) at all times, reducing the usable free space even further. Around 25 KB are used by the configuration overlay immediately after firstboot, before you actually get a chance to configure anything.

Assuming pure statistics, what will the situation be in 12 or 24 months[1]?

No one has yet raised the suggestion to actually remove the hardware support for affected devices from LEDE's source repository. If you look deeper, you can still find full support for the Linksys WRT-54GL (4 MB flash, 16 MB RAM) in the repo, although support for devices with just 16 MB RAM had already been discontinued with Attitude Adjustment 12.09 and despite the fact that actually building a working up-to-date firmware for this device today is quite challenging[2].

This thread merely serves as a reminder for 'normal users', who expect to download and flash LEDE under the expectation to use it as a full featured replacement for the vendor firmware (including a webinterface, luci). Also keep in mind that luci is enabled for release builds, which means that it either fits into the firmware image (with the mandatory safety margin of at least 3 erase blocks) or no release images can be created for the affected devices[3], [4]. In my very personal opinion, this needs to be documented quite obviously, avoiding to raise false hope and expectations for (especially new) users.
Advanced users will obviously be able to delay the inevitable by quite some margin - depending on their use-cases and abilities to reduce LEDE's footprint below normal system requirements.

Despite the title, the RAM size is actually a much harder limit, affecting much more than just 4 MB flash devices. If you look through the commit log, you will notice quite some efforts to get opkg to use less RAM, but it's still a problem with just 32 MB RAM (even for normal operations, before touching opkg). Likewise you already are in trouble with sysupgrade and trying to flash a (larger) 6-8 MB firmware on a device with just 32 MB RAM, unless you really clean up services and loaded kernel modules manually beforehand, there is a high risk that you'll oom during the sysupgrade and brick your device for good (requiring bootloader/ tftp assistance to recover in the best case).

[1] switching from mach files to device tree (post 17.01) offers a potential to free up a little space in the kernel, but this isn't a whole lot and will probably be eaten more or less completely by upgrading to kernel 4.9+ (also keep in mind that the FDT file needs to be appended to the kernel image, which might or might not compress as well as the mach files before), so don't expect a significant positive effect from this switch.

[2] no webinterface, better no pppd, quite some custom configurations to get the kernel's runtime memory requirements as small as possible, disabling whatever is humanly possible (definately no IPv6, better no wireless either).

[3] with LEDE's pretty new feature of device specific rootfs images, it would technically be possible to decide between installing luci or omitting it on a per device basis, e.g. based on flash sizes, but support for something like this hasn't been implemented yet and would require quite some attention (both as in source patches and tagging of device classes) from interested parties. As implemented right now, the decision is binary - either the default (release) config (including luci) fits XOR building a firmware image for the affected device fails and no firmware will be available.

[4] I would expect that there already are a couple of 4 MB flash devices in the target list for which no release firmware can be built for 17.01, because of less ideal flash partitioning schemes chosen by the vendor (dropping free space below 3 erase blocks). Those are probably a minority, but given the close numbers, I'd be very suprised if there wouldn't be any affected.

More explanations on this subject by forum user slh.

As originally written in this forum post by jow.

Just providing my rather pragmatic opinion on the topic here:
I do not believe in arbitrarily dropping device support
We usually support devices as long as it is feasible
A device should be considered supported as long as

  • it is possible to build bootable images
  • small enough images can be produced to still allow configuration persistence
  • no patches or other modifications to the source and buildroot are required

Eventually we might need to think about support tiers like:

  • Full ⇒ allows for running gui, has working opkg and plenty of space to allow packages
  • Medium ⇒ allows for running gui, has working opkg and at least enough space for setting up extroot
  • Small ⇒ bootable images can be built when either sacrificing gui or opkg while still having configuration persistence
  • Micro ⇒ only choice are heavily tailored custom images that require special measures like pre-shipped configuration, NFS mounts, preconfigured extroot etc.
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2023/05/03 18:08
  • by tmomas