What packages can I remove to fit a 4MB flash

Have a look at this thread: TP-Link TL-WR841N(D), WA701N(D), WR740N(D), WR741N(D), WR743N(D), WR940N, WR941N(D) - LADUS / JULIA / Ultra Lite / VPN builds

The config.seed files are included as far as I remember. This should give you a good start what to include in your own “tiny” build. All the 32/4 warnings still apply but you should be able to make a working firmware like in the thread I mentioned.

Compile from source using the full tools other wise you will never be able to fit everything in 4MB, if you are able to fit it at all.