Wanted to add that LLMs have become incredibly good at reverse engineering such devices, even when they don't have postmarketOS (now "Nura") or upstream kernel support yet. Been able to merge kernel changes and backport driver support to upstream kernels pretty easily by just giving them access to UART. They'll just go ahead and figure out all the partitioning and firmware quirks by themselves, and e.g. OpenWRT instructions seem to be well documented in the wiki so they'll understand the process on how to get there almost completely by themselves.
For my malware home lab, I decided to just reuse old phones and routers that nobody wanted anymore (quite literally got them from the trash bins). Now they're running an ARMv8 kernel as the host kernel and the rest is emulated or containerized, depending on the use case.
Works like a charm for most tasks I throw at it, and many old cheap Android phones have at least quad or octa cores in them, making them pretty awesome for podman/docker usage, too.
The only thing you have to look out for is to remove the battery, and that you use a separate power circuit with a step down converter to power it. But other than that, old smartphones have become amazing for selfhosting stuff now.
can you buy such circuit on ebay?