Latest update (separate UG and UPr models):
OpenWrt branch rb5009upr+s+in
Packages branch mtpoe-ctrl-rb5009
This is a split from Add support for MikroTik RB5009UG - #1131 by v01t to focus on the PoE model.
The recent proposed OpenWrt tree changes provide a common build for base RB5009 and PoE-featured version RB5009Upr+S+IN (same bootloader, compatible sysupgrade, devices selectable separately in the menuconfig whilst producing the same image):
Those give access to the on-board PoE hardware but do not include the mtpoe-ctrl tool, which belongs to the packages/feeds. The tool can be included so it can be part of the image build result:
Note that those gather other people work with necessary changes to run on RB5009 and aligning all this together.
Build
https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem
Steps below refer to the direct git branches but obviously changes can be taken and applied as patches.
git clone --depth 1 https://github.com/prudy/openwrt.git -b rb5009-with-poe
cd openwrt
# this gets therepo with already added tool, but instead only the mtpoe-ctrl dir can be put into local packages
sed '/git packages /s/https.*$/https:\/\/github.com\/prudy\/openwrt-packages.git;mtpoe-ctrl-rb5009/' feeds.conf.default > feeds.conf
./scripts/feeds update -a
./scripts/feeds install -a
cp rb5009-with-poe.diffconfig .config
make defconfig
make menuconfig
# verify
make -j
Flashing
Since all matches base rb5009, simply follow the procedure from https://openwrt.org/toh/mikrotik/rb5009ug_s_in.
I don’t use usb so I load u-boot and initramfs with loader.sh script, run in bin/targets/mvebu/cortexa72/.
loader.sh script
#!/bin/bash
IFNAME=eth0
/sbin/ip addr replace 192.168.88.2/24 dev $IFNAME
/sbin/ip link set dev $IFNAME up
/usr/sbin/dnsmasq \
--no-daemon \
--listen-address 192.168.88.2 \
--bind-interfaces \
-p0 \
--dhcp-authoritative \
--dhcp-range=192.168.88.100,192.168.88.200 \
--bootp-dynamic \
--dhcp-boot=u-boot-rb5009/u-boot.elf \
--log-dhcp \
--enable-tftp \
--tftp-root=$(pwd)
example rb5009-with-poe.diffconfig
CONFIG_TARGET_mvebu=y
CONFIG_TARGET_mvebu_cortexa72=y
CONFIG_TARGET_mvebu_cortexa72_DEVICE_mikrotik_rb5009=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_kmod-spi-dev=y
CONFIG_PACKAGE_libiwinfo=y
CONFIG_PACKAGE_libiwinfo-data=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-ucode=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-light=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_mtpoe-ctrl=y
CONFIG_PACKAGE_px5g-mbedtls=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_rpcd-mod-ucode=y
CONFIG_PACKAGE_ucode-mod-html=y
CONFIG_PACKAGE_ucode-mod-math=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y