Finally succeeded!
I was using only the Image builder (instructions here).
However, to succeed, one needs to follow these instructions.

Important note: if you are getting a compilation error when building the tools/tar target, please add this parameter to all make commands:
FORCE_UNSAFE_CONFIGURE=1

The new partition layout:

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00020000 "u-boot"
mtd1: 00100000 00020000 "u-boot-env"
mtd2: 00100000 00020000 "factory"
mtd3: 00100000 00020000 "factory2"
mtd4: 00400000 00020000 "kernel"
mtd5: 07820000 00020000 "ubi"
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                   122.2M     88.0K    122.2M   0% /tmp
/dev/ubi0_1              99.6M     48.0K     94.8M   0% /overlay
overlayfs:/overlay       99.6M     48.0K     94.8M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev

In order to trigger the partition resizing process, I had to add the -p switch to the sysupgrade command (otherwise the overlay partition size remained at 33 MB):

sysupgrade -p openwrt-ramips-mt7621-asus_rt-ax53u-squashfs-sysupgrade.bin

    -p           do not attempt to restore the partition table after flash.

@drut: the settings were preserved (or at least /etc/config/wireless). Not sure if the packages were also preserved, as I started the upgrade from a clean system (I had changed only the wireless settings).

4 Likes