The PicoStation M2 are supported by OpenWrt.
Picostation M2 device uses Bullet M2 firmware image
To avoid problems (eg. lost config after reboot) with the new bootloader:
The OpenWrt buildroot generates images that can be directly flashed to the Picostation M2 trough the Ubiquiti web, usually with a name like
openwrt-ar71xx-generic-ubnt-bullet-m-squashfs-factory.bin (image for Ubiquiti Bullet M2).
Firmware download links: