Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/multi-arch-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ permissions:
checks: read

jobs:
wait-for-formalities:
name: Wait for FormalityCheck
runs-on: ubuntu-slim
steps:
- name: Wait for Check Run
uses: lewagon/wait-on-check-action@v1.8.1
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'FormalityCheck / Git & Commits'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 5

build:
name: Feeds Package Test Build
needs: wait-for-formalities
uses: openwrt/actions-shared-workflows/.github/workflows/multi-arch-test-build.yml@main
76 changes: 76 additions & 0 deletions net/prplmesh-stock/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=prplmesh-stock
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>

PKG_BUILD_DEPENDS:=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

EXTRA_CXXFLAGS += -Wno-error=deprecated-declarations

define Package/prplmesh-stock
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
endef

define Package/prplmesh-stock/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-stock/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-stock/install
$(INSTALL_DIR) $(1)/usr/libexec/prplmesh $(1)/usr/share/prplmesh $(1)/usr/lib $(1)/etc/init.d $(1)/etc/config
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/bin $(1)/usr/libexec/prplmesh/
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/scripts $(1)/usr/libexec/prplmesh/
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/share $(1)/usr/share/prplmesh/
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/prplmesh/config $(1)/usr/share/prplmesh/
$(LN) ../../share/prplmesh/share $(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-stock))
68 changes: 68 additions & 0 deletions net/prplmesh-stock/files/prplmesh.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# beerocks derives radio and VAP identifiers from wlan<N> interface names,
# so the fronthaul BSS netdevs must be named wlan<N> (wireless section
# 'option ifname'). Adjust the interface lists below to the actual names.

config prplmesh 'config'
option enabled '0'
option management_mode 'Multi-AP-Controller-and-Agent'
option enable '1'
option onboarding '0'
option master '1'
option gateway '1'
option passive_mode '0'
option wired_backhaul '1'
option operational '0'
option ssid 'REPLACE_WITH_SSID'
option mode_enabled 'WPA2-Personal'
option key_passphrase 'REPLACE_WITH_A_STRONG_PASSWORD'
option mem_only_psk '0'
option certification_mode '0'
option stop_on_failure_attempts '0'
option backhaul_wire_iface 'br-lan'
option backhaul_band 'auto'
option mandatory_interfaces 'wlan0,wlan1'
option band_steering '1'
option client_11k_roaming '1'
option client_roaming '1'
option load_balancing '0'
option dfs_reentry '1'
option roaming_hysteresis_percent_bonus '10'
option steering_disassoc_timer_msec '200'
option link_metrics_request_interval_sec '60'
option clients_measurement_mode '1'
option radio_stats_enable '1'
option unsuccessful_assoc_report_policy '1'
option unsuccessful_assoc_max_reporting_rate '30'
option ire_roaming '1'
option exclude_hostap_iface '0'
option use_explicit_bss_profiles '1'

config wifi-device 'radio0'
option hostap_iface 'wlan0'
option wireless_section 'default_radio0'
option wireless_device 'radio0'
option hostap_iface_steer_vaps 'wlan0'
option dcs_enable '0'

config wifi-device 'radio1'
option hostap_iface 'wlan1'
option wireless_section 'default_radio1'
option wireless_device 'radio1'
option hostap_iface_steer_vaps 'wlan1'
option dcs_enable '0'

config bss_profile 'main_24_5'
option ssid 'REPLACE_WITH_SSID'
option key 'REPLACE_WITH_A_STRONG_PASSWORD'
option encryption 'sae-mixed'
option bands '2g 5g'
option fronthaul '1'
option backhaul '0'

config bss_profile 'main_6'
option ssid 'REPLACE_WITH_SSID'
option key 'REPLACE_WITH_A_STRONG_PASSWORD'
option encryption 'sae'
option bands '6g'
option fronthaul '1'
option backhaul '0'
77 changes: 77 additions & 0 deletions net/prplmesh-stock/files/prplmesh.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/sh /etc/rc.common
# shellcheck disable=SC2034
# shellcheck disable=SC3043 # ash supports local

START=99
STOP=10
USE_PROCD=1

PRPLMESH_DIR=/usr/libexec/prplmesh

enabled() {
[ "$(uci -q get prplmesh.config.enabled)" = "1" ]
}

register_process() {
local name="$1"; shift
procd_open_instance "$name"
procd_set_param command "$@"
procd_set_param env PRPLMESH_DIR="$PRPLMESH_DIR"
procd_set_param respawn 3600 5 5
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}

start_service() {
local mode need_agent=1 need_controller=1

enabled || return 0

[ -x "$PRPLMESH_DIR/bin/ieee1905_transport" ] || return 1

# A standalone controller runs without local radios, a plain agent
# without the controller; everything else keeps both.
mode="$(uci -q get prplmesh.config.management_mode)"
case "$mode" in
Multi-AP-Controller) need_agent=0 ;;
Multi-AP-Agent) need_controller=0 ;;
esac

register_process transport "$PRPLMESH_DIR/bin/ieee1905_transport"

if [ "$need_controller" = 1 ]; then
[ -x "$PRPLMESH_DIR/bin/beerocks_controller" ] || return 1
register_process controller "$PRPLMESH_DIR/bin/beerocks_controller"
fi

if [ "$need_agent" = 1 ]; then
[ -x "$PRPLMESH_DIR/bin/beerocks_agent" ] || return 1
[ -n "$(uci -q get prplmesh.config.mandatory_interfaces)" ] || {
logger -t prplmesh "mandatory_interfaces not set; agent left stopped"
return 1
}
# hostapd recreates its control sockets on boot and on wireless
# reloads, so wait for them under procd supervision instead of
# failing the whole start on a transient race.
# shellcheck disable=SC2016
register_process agent /bin/sh -c '
while :; do
ok=1
IFS=","
for interface in $(uci -q get prplmesh.config.mandatory_interfaces); do
unset IFS
[ -n "$interface" ] || continue
[ -S "/var/run/hostapd/$interface" ] || { ok=0; break; }
done
unset IFS
[ "$ok" = 1 ] && break
sleep 5
done
exec "$PRPLMESH_DIR/bin/beerocks_agent"'
fi
}

service_triggers() {
procd_add_reload_trigger prplmesh wireless network
}
Loading