From 7291610ef2bfcbb386f29b9dd2da570aa905bc21 Mon Sep 17 00:00:00 2001
From: Andrei Ovcharenko
Date: Wed, 29 Jul 2026 23:32:44 +0300
Subject: [PATCH 1/4] prplmesh: enable log rolling on OpenWrt
---
net/prplmesh/Makefile | 2 +-
net/prplmesh/patches/161-openwrt-log-roll-helper.patch | 9 +++++++++
net/prplmesh/test-version.sh | 1 +
3 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 net/prplmesh/patches/161-openwrt-log-roll-helper.patch
diff --git a/net/prplmesh/Makefile b/net/prplmesh/Makefile
index 3ba4e3c9e48fa..a9cf4099d333e 100644
--- a/net/prplmesh/Makefile
+++ b/net/prplmesh/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=prplmesh
PKG_VERSION:=6.0.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=prplMesh-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/prplmesh/prplMesh/-/archive/$(PKG_VERSION)/
diff --git a/net/prplmesh/patches/161-openwrt-log-roll-helper.patch b/net/prplmesh/patches/161-openwrt-log-roll-helper.patch
new file mode 100644
index 0000000000000..3b7d99a880eee
--- /dev/null
+++ b/net/prplmesh/patches/161-openwrt-log-roll-helper.patch
@@ -0,0 +1,9 @@
+--- a/common/beerocks/scripts/prplmesh_utils.sh.in
++++ b/common/beerocks/scripts/prplmesh_utils.sh.in
+@@ -166,5 +166,5 @@
+ main() {
+ case "${TARGET_PLATFORM}" in
+- linux|rdkb)
++ linux|rdkb|openwrt)
+ ;;
+ *)
diff --git a/net/prplmesh/test-version.sh b/net/prplmesh/test-version.sh
index 94ece92888efb..78022543060b3 100644
--- a/net/prplmesh/test-version.sh
+++ b/net/prplmesh/test-version.sh
@@ -14,6 +14,7 @@ prplmesh)
grep -Fx 'log_global_syslog_levels=error,info,warning,fatal' "$config"
done
test -x /usr/libexec/prplmesh/scripts/prplmesh_utils.sh
+ /usr/libexec/prplmesh/scripts/prplmesh_utils.sh -h >/dev/null
;;
*)
echo "Untested package: $PKG_NAME" >&2
From 719ec12b6a251cf256a24e14612a91a81ba99109 Mon Sep 17 00:00:00 2001
From: Andrei Ovcharenko
Date: Wed, 29 Jul 2026 23:42:55 +0300
Subject: [PATCH 2/4] prplmesh: refresh OpenWrt log-roll patch
---
net/prplmesh/patches/161-openwrt-log-roll-helper.patch | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/prplmesh/patches/161-openwrt-log-roll-helper.patch b/net/prplmesh/patches/161-openwrt-log-roll-helper.patch
index 3b7d99a880eee..0bf4a7e4e0482 100644
--- a/net/prplmesh/patches/161-openwrt-log-roll-helper.patch
+++ b/net/prplmesh/patches/161-openwrt-log-roll-helper.patch
@@ -1,9 +1,11 @@
--- a/common/beerocks/scripts/prplmesh_utils.sh.in
+++ b/common/beerocks/scripts/prplmesh_utils.sh.in
-@@ -166,5 +166,5 @@
+@@ -165,7 +165,7 @@ stop_func() {
+
main() {
case "${TARGET_PLATFORM}" in
- linux|rdkb)
+ linux|rdkb|openwrt)
;;
*)
+ echo "Unsupported platform: ${TARGET_PLATFORM}" >&2
From 7d32c5b35bf4b4f14e4c0ed85a99b4fb340302c8 Mon Sep 17 00:00:00 2001
From: Andrei Ovcharenko
Date: Thu, 30 Jul 2026 00:05:04 +0300
Subject: [PATCH 3/4] prplmesh: depend on getopt for log helper
---
net/prplmesh/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/prplmesh/Makefile b/net/prplmesh/Makefile
index a9cf4099d333e..8d7f7e7196ab5 100644
--- a/net/prplmesh/Makefile
+++ b/net/prplmesh/Makefile
@@ -25,7 +25,7 @@ define Package/prplmesh
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
+ DEPENDS:=+libstdcpp +libpthread +librt +libjson-c +libopenssl +libnl-core +libnl-genl +libnl-route +libuci +libubus +libubox +getopt
endef
define Package/prplmesh/description
From c81ccec145be1aedbf2a831ef2d01687cbbf2215 Mon Sep 17 00:00:00 2001
From: "Andrei.Ovcharenko"
Date: Sat, 1 Aug 2026 12:00:14 +0300
Subject: [PATCH 4/4] prplmesh: schedule periodic log rolling
---
net/prplmesh/files/prplmesh.init | 24 ++++++++++++++++++++++++
net/prplmesh/test-version.sh | 3 +++
2 files changed, 27 insertions(+)
diff --git a/net/prplmesh/files/prplmesh.init b/net/prplmesh/files/prplmesh.init
index b6cf005f4a239..481ad35464a7f 100644
--- a/net/prplmesh/files/prplmesh.init
+++ b/net/prplmesh/files/prplmesh.init
@@ -7,6 +7,7 @@ STOP=10
USE_PROCD=1
PRPLMESH_DIR=/usr/libexec/prplmesh
+LOG_ROLL_INTERVAL_SECONDS=86400
enabled() {
[ "$(uci -q get prplmesh.config.enabled)" = "1" ]
@@ -23,6 +24,28 @@ register_process() {
procd_close_instance
}
+register_log_roller() {
+ local helper="$PRPLMESH_DIR/scripts/prplmesh_utils.sh"
+
+ [ -x "$helper" ] || {
+ logger -t prplmesh "log-roll helper is missing or not executable"
+ return 1
+ }
+
+ procd_open_instance log-roller
+ # shellcheck disable=SC2016
+ procd_set_param command /bin/sh -c '
+ helper=$1
+ interval=$2
+ while sleep "$interval"; do
+ "$helper" roll_logs || logger -t prplmesh "log roll failed"
+ done' sh "$helper" "$LOG_ROLL_INTERVAL_SECONDS"
+ 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
@@ -60,6 +83,7 @@ start_service() {
fi
register_process transport "$PRPLMESH_DIR/bin/ieee1905_transport"
+ register_log_roller || return 1
if [ "$need_controller" = 1 ]; then
register_process controller "$PRPLMESH_DIR/bin/beerocks_controller"
diff --git a/net/prplmesh/test-version.sh b/net/prplmesh/test-version.sh
index 78022543060b3..3d484d04c05e6 100644
--- a/net/prplmesh/test-version.sh
+++ b/net/prplmesh/test-version.sh
@@ -15,6 +15,9 @@ prplmesh)
done
test -x /usr/libexec/prplmesh/scripts/prplmesh_utils.sh
/usr/libexec/prplmesh/scripts/prplmesh_utils.sh -h >/dev/null
+ grep -F 'register_log_roller || return 1' /etc/init.d/prplmesh
+ # shellcheck disable=SC2016
+ grep -F '"$helper" roll_logs || logger -t prplmesh "log roll failed"' /etc/init.d/prplmesh
;;
*)
echo "Untested package: $PKG_NAME" >&2