Files
packages/net/prplmesh/Makefile
T
Andrei Ovcharenko 1bb94b900f prplmesh: add package
Add the prplMesh 6.0.1 EasyMesh controller and agent for stock OpenWrt.
The package keeps the installed hostapd/wpad stack and drives it over
the existing UCI, ubus, nl80211 and hostapd control sockets.

The hostapd control interface client is a small self-contained
implementation added by patch 120, so no hostapd source tree is
downloaded, bundled or duplicated at build time and the system hostapd
stays the only hostapd. Binaries install under /usr/libexec/prplmesh,
read-only data under /usr/share/prplmesh, shared libraries under
/usr/lib, configuration under /etc/config/prplmesh. Of the prplOS
helper scripts only prplmesh_utils.sh is installed: patch 161 teaches
its platform guard stock OpenWrt and the init's daily log roller
invokes it; the other helpers stay uninstalled. Its option parsing
needs util-linux getopt (the busybox applet is off by default), hence
the getopt dependency.
At build time prplMesh generates its IEEE 1905 / EasyMesh TLV classes
from YAML definitions with its own Python generator, hence the host
Python and PyYAML build dependencies.

Stock builds run without NBAPI, so the controller skips the
CurrentOperatingClassProfile data-model cleanup for radios without a
data model path, and legacy vendor diagnostic measurements default to
off while standard EasyMesh metrics stay enabled. The controller also
registers radios that appear only in Topology Responses: some stock
agents never run WSC onboarding for a band (Wi-Fi 7 units and their
6 GHz radio), and such radios, their BSSes and their clients stayed
invisible otherwise. Agents in turn import clients that are already
associated when the agent starts: patch 150 walks hostapd's
STA-FIRST/STA-NEXT list on the nl80211 AP and monitor HALs and
reconciles the result every 60 seconds, so stations that associated
while the agent was down appear without waiting for a reassociation,
and stale entries are disconnected only after a cleanly enumerated
sweep. The init preflights every binary the selected management mode
needs before registering any procd instance, and the example
credentials ship empty so an enabled but unconfigured service fails
validation loudly instead of deploying a published passphrase.
A test-version.sh verifies the installed version from the shipped
version file instead of probing daemons, and a test.sh checks the
shipped log levels and the roll-helper install.

Production log levels default to error, info, warning and fatal for
file and syslog output of both daemons. Log retention is enforced by
the upstream roll helper (its platform guard now accepts openwrt):
the init prunes previous-boot logs once per boot before the daemons
come up (a /var/run stamp keeps procd reload triggers, which re-enter
start_service with the daemons live, from re-rolling their logs) and
a procd-supervised roller repeats the roll daily; an image stripped
of the helper runs without rotation instead of refusing to start.
Link-metrics reporting no longer warns about wireless-capable radios
deliberately not used for backhaul.

An earlier revision of this integration, differing only in the wpa_ctrl
client origin and the install prefix, runs on OpenWrt 25.12.5
mediatek/mt7622 with two Ethernet-connected EasyMesh agents.

Ref: https://gitlab.com/prpl-foundation/prplmesh/prplMesh
Ref: https://gitlab.com/kreout/prpl-mesh-mercusys/-/merge_requests/1
Signed-off-by: Andrei Ovcharenko <a@krot.name>
2026-09-14 11:45:49 +03:00

77 lines
3.0 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=prplmesh
PKG_VERSION:=6.0.1
PKG_RELEASE:=1
PKG_SOURCE:=prplMesh-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/prplmesh/prplMesh/-/archive/$(PKG_VERSION)/
PKG_HASH:=68602c7bdf521de1797c0e58e66bb45cf105726dfd5a75d8429038012e19a702
PKG_BUILD_DIR:=$(BUILD_DIR)/prplMesh-$(PKG_VERSION)
PKG_LICENSE:=BSD-2-Clause-Patent BSD-3-Clause ISC MIT
PKG_LICENSE_FILES:=LICENSE LICENSES/BSD-3-Clause.txt LICENSES/ISC.txt LICENSES/MIT.txt
PKG_MAINTAINER:=Andrei Ovcharenko <a@krot.name>
# The tlvf code generator (framework/tlvf/tlvf.py) runs at build time and
# needs a host Python with PyYAML
PKG_BUILD_DEPENDS:=python3/host python-yaml/host
CMAKE_BINARY_SUBDIR:=build-openwrt-stock
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include ../../lang/python/python3-host.mk
define Package/prplmesh
SECTION:=net
CATEGORY:=Network
TITLE:=prplMesh controller and agent for stock OpenWrt
URL:=https://gitlab.com/prpl-foundation/prplmesh/prplMesh
DEPENDS:=+libstdcpp +libpthread +librt +libjson-c +libopenssl +libnl-core +libnl-genl +libnl-route +libuci +libubus +libubox +getopt
endef
define Package/prplmesh/description
prplMesh EasyMesh controller and agent built for stock OpenWrt. It talks
to the hostapd instances of the installed wpad over their UNIX control
sockets through a small bundled control-interface client; it does not
bundle, build or replace hostapd.
endef
define Package/prplmesh/conffiles
/etc/config/prplmesh
endef
CMAKE_OPTIONS += \
-DTARGET_PLATFORM=openwrt \
-DTARGET_PLATFORM_TYPE=stock \
-DBWL_TYPE=NL80211 \
-DBWL_BUNDLED_WPA_CTRL=ON \
-DENABLE_NBAPI=OFF \
-DUSE_PRPLMESH_WHM=OFF \
-DPRPLMESH_STOCK_OPENWRT_UCI=ON \
-DBUILD_AGENT=ON \
-DBUILD_CONTROLLER=ON \
-DBUILD_TESTS=OFF \
-DPRPLMESH_VERSION=$(PKG_VERSION) \
-DPRPLMESH_REVISION=openwrt-r$(PKG_RELEASE) \
-DBUILD_DATE=$(SOURCE_DATE_EPOCH) \
-DCMAKE_INSTALL_PREFIX=/usr/libexec/prplmesh \
-DPLATFORM_STAGING_DIR=$(STAGING_DIR) \
-DPLATFORM_INCLUDE_DIR=$(STAGING_DIR)/usr/include \
-DPython3_EXECUTABLE=$(HOST_PYTHON3_BIN)
define Package/prplmesh/install
$(INSTALL_DIR) $(1)/usr/libexec/prplmesh/bin $(1)/usr/libexec/prplmesh/scripts $(1)/usr/share/prplmesh/config $(1)/usr/lib $(1)/etc/init.d $(1)/etc/config
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/bin/* $(1)/usr/libexec/prplmesh/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/scripts/prplmesh_utils.sh $(1)/usr/libexec/prplmesh/scripts/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/share/* $(1)/usr/share/prplmesh/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/config/* $(1)/usr/share/prplmesh/config/
$(LN) ../../share/prplmesh $(1)/usr/libexec/prplmesh/share
$(LN) ../../share/prplmesh/config $(1)/usr/libexec/prplmesh/config
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/lib/*.so* $(1)/usr/lib/
$(INSTALL_BIN) ./files/prplmesh.init $(1)/etc/init.d/prplmesh
$(INSTALL_CONF) ./files/prplmesh.config $(1)/etc/config/prplmesh
endef
$(eval $(call BuildPackage,prplmesh))