Building striped down image with extroot for older device

I'm trying to build a custom image for an older device (MR3020 v1) with only 4MB flash, I've succesfully build openwrt 21.02.7 but I'm trying a more recent version without success. I need no other function in the flash image other than bridging lan/wlan so no firewall, luci or anything, just ssh acces required. I'm trying to add EXTROOT but there is still some packages that are added automatically and I've haven't found what is causing this.

Could anyone help me ?

this is the make command:

make image PROFILE=tplink_tl-mr3020-v1 CONFIG_IPV6=n DISABLED_SERVICES="wpad" EXTRA_IMAGE_NAME="cma-v2" PACKAGES="-kmod-usb-chipidea -kmod-usb-chipidea2 -firewall4 -kmod-nf-ipt -kmod-ipt-core -kmod-ipt-conntrack -libxtables12 -libip4tc2 -libip6tc2 -firewall -iptables -kmod-ipt-offload -dnsmasq -nftables-json -nftables-nojson -odhcpd-ipv6only -odhcp6c -ip6tables -kmod-ipv6 -kmod-ip6tables -kmod-ipt-nat -kmod-nf-reject6 -ppp -ppp-mod-pppoe -kmod-ppp -kmod-pppox -kmod-pppoe -wpad-basic-mbedtls -uhttpd -uhttpd-mod-ubus -libiwinfo-lua -uci-base -luci -luci-ssl -luci-app-firewall -luci-mod-admin-full -luci-app-opkg -luci-theme-bootstrap -kmod-jool-netfilter -kmod-openvswitch -kmod-nft-dup-inet -kmod-nf-nat6 -kmod-nf-reject6 -kmod-nf-conntrack -kmod-nf-flow -kmod-nf-reject -kmod-nft-offload -kmod-nf-nat -kmod-usb-ehci -kmod-nf-conntrack6 -kmod-nf-log -kmod-nf-log6 -kmod-nft-fib -kmod-nft-nat -libnftnl11 -nftables-json -kmod-nft-core -kmod-usb-gadget -jansson4 -libuclient20201210 -uclient-fetch -ca-bundle -wpad-basic-wolfssl -usign -kmod-ath -kmod-ath9k-common -kmod-ath9k -kmod-mac80211 -kmod-cfg80211 -iw -hostapd-common -kmod-usb-phy-nop -wireless-regdb procd-ujail opkg kmod-usb-core kmod-usb2 block-mount kmod-fs-ext4 kmod-usb-storage"

this is part of the build log :

Configuring kmod-scsi-core.
Configuring kmod-nls-base.
Configuring kmod-usb-core.
Configuring kmod-usb-storage.
Configuring libubox20220515.
Configuring libuclient20201210.
Configuring uclient-fetch.
Configuring libpthread.
Configuring opkg.
Configuring libubus20220601.
Configuring libjson-c5.
Configuring libblobmsg-json20220515.
Configuring ubusd.
Configuring ubus.
Configuring libuci20130104.
Configuring busybox.
Configuring kmod-nfnetlink.
Configuring kmod-crypto-hash.
Configuring kmod-nf-reject6.
Configuring libnl-tiny1.
Configuring swconfig.
Configuring libwolfssl5.6.4.ee39414e.
Configuring libustream-wolfssl20201210.
Configuring getrandom.
Configuring kmod-nf-reject.
Configuring procd-ujail.
Configuring jshn.
Configuring netifd.
Configuring jsonfilter.
Configuring usign.
Configuring openwrt-keyring.
Configuring ubox.
Configuring fstools.
Configuring fwtool.
Configuring base-files.
Configuring kmod-lib-crc16.
Configuring kmod-nf-conntrack.
Configuring kmod-nf-nat.
Configuring kmod-crypto-crc32c.
Configuring uboot-envtools.
Configuring libjson-script20220515.
Configuring procd.
Configuring kmod-phy-ath79-usb.
Configuring kmod-lib-crc32c.
Configuring kmod-usb-ehci.
Configuring block-mount.
Configuring kmod-usb2.
Configuring libmnl0.
Configuring jansson4.
Configuring uci.
Configuring kmod-fs-ext4.
Configuring dropbear.
Configuring libnftnl11.
Configuring mtd.
Configuring procd-seccomp.
Configuring kmod-nf-log.
Configuring urandom-seed.
Configuring kmod-gpio-button-hotplug.
Configuring logd.
Configuring kmod-nf-log6.
Configuring kmod-nf-conntrack6.
Configuring kmod-nft-core.
Configuring nftables-json.
Configuring kmod-usb-ledtrig-usbport.
Configuring urngd.

I would like to remove packages related to nftables and others json stuff like : nftables-json, kmod-nft-core, kmod-nf-conntrack6, kmod-nf-log6, kmod-nf-log, jansson4, kmod-nf-nat, kmod-nf-conntrack, kmod-nf-reject, etc

ok found it, I missed

-nftables

So here we go, openwrt 23.05.2 on MR3020 v1...

Impressive that you figured out how to get it to fit the flash footprint. But I'd be curious if it can actually run reliably... that device only has 32MB RAM, so I would expect OOM issues if you're doing...well, pretty much anything with it.

my needs for this device are perhaps lower that one could expect (I don't need a firewall, nor luci or 4g dongle support etc...), but if you consider this is just an access point, it fit the purpose perfectly.

I've have another openwrt on x86 as my main router and a mikrotik switch inbetween acting as a radius server.

This little device serve wifi wpa2 - wpa3 enterprise flawlessly. The memory footprint is not really an issue because the memory load so far doesn't change much while running as a (dumb) access point.

The real problem was the flash size, but with extroot on usb, this is not anymore. It's so funny that 4MB is just enough to fit latest openwrt with all packages needed for extroot to work.

Cool.

I would recommend keeping an eye on things, though... some of the wireless drivers can take up a fair bit of memory, especially if there are many devices connected and/or high bandwidth conditions. Sounds like you'll be okay, but if you do experience any odd behaviors, check for OOM (you may need to log to an external syslog server to capture those).

For sure, will do, thanks for your interest !