How to replace a large file from squashfs after pkg upgrade?

I'm running latest 22.03.0 release on an old TP-Link TL-WDR3500 v1 router with squashfs. The problem is that the HW has 4MB flash and immediately after installing the release I've upgraded all the packages.

The problem is that one of the upgraded packages, libwolfssl, has a very large footprint of 1.1 MB that, since squashfs is readonly, I can't remove from the base layer and it basically means I'm stripped out of a very important part of the usable space.

Can you help me understand what options do I have to remove this very large old file from the base layer or something like that?

Upgrading packages (via the CLI opkg upgrade command or the LuCI Upgrade... button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.

Reset the router to defaults (firstboot -y && reboot). Take a backup beforehand if you have configuration data that you want to be able to restore. Don't upgrade packages unless there is a very specific reason you need to do it (and then only do this with targeted packages).

1 Like

It can't be removed. The compressed squashfs filesystem is one monolithic entity.

With so limited flash space, you really can't upgrade large packages.

You best option is to reflash the router with a new firmware that has the new package version included.

1 Like

Can we rmove "upgrade" option from opkg? So that people wouldn't do it anymore.

It is useful in some cases.
But you have to understand the limitations from your hardware (and the risks related to mixed version packages).

Note that 4 MB flash is an extreme case, and official support for so small flash has already been dropped from the current OpenWrt versions.

1 Like