ucentral-state: fix periodic interval on v4.4 kernel

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2023-11-22 06:55:43 +01:00
parent 5d43925874
commit ecfaf9a263
6 changed files with 56 additions and 40 deletions

View File

@@ -1,19 +0,0 @@
Index: a/arch/arm64/boot/dts/qcom/ipq5018-memory.dtsi
===================================================================
--- a/arch/arm64/boot/dts/qcom/ipq5018-memory.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018-memory.dtsi
@@ -199,6 +199,14 @@
no-map;
reg = <0x0 0x07000000 0x0 0x58000>;
};
+
+ ramoops@4fd00000 {
+ compatible = "ramoops";
+ reg = <0x0 0x4fd00000 0x0 0x100000>;
+ record-size = <0x1000>;
+ console-size = <0x1000>;
+ pmsg-size = <0x1000>;
+ };
};
#endif
};

View File

@@ -4,10 +4,10 @@ PKG_NAME:=ucentral-schema
PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/Telecominfraproject/wlan-ucentral-schema.git
PKG_MIRROR_HASH:=ec28cdcf335165bffbe5ceb01ae208c8bca6597acd7fb1848153171edc8576b1
PKG_MIRROR_HASH:=794b6e73dbf4d1f0135b45b1498c1147a412496aee172ece9e9b9b17180b9f5e
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-05-29
PKG_SOURCE_VERSION:=29d6715225fa1520e70773a04bd41499c31e8895
PKG_SOURCE_VERSION:=ef7e9e6d0a9811b37f2891019456eb62225554ca
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -5,8 +5,14 @@
"band": "2G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 20,
"channel": 1
}, {
"band": "5G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80,
"channel": 32
"channel": 36
}
],
@@ -29,7 +35,7 @@
{
"name": "OpenWifi",
"wifi-bands": [
"2G"
"2G", "5G"
],
"bss-mode": "ap",
"encryption": {
@@ -64,7 +70,7 @@
{
"name": "OpenWifi",
"wifi-bands": [
"2G"
"2G", "5G"
],
"bss-mode": "ap",
"encryption": {

View File

@@ -29,8 +29,10 @@ healthcheck = {
if (healthcheck.pid)
healthcheck.pid.delete();
ulog(LOG_INFO, 'start healthcheck in ' + delay / 1000 + ' seconds\n');
healthcheck.interval ??= uloop.interval(delay, healthcheck.spawn);
healthcheck.interval.set(delay);
if (healthcheck.interval)
healthcheck.interval.set(delay);
else
healthcheck.interval = uloop.interval(delay, healthcheck.spawn);
},
complete: function() {
@@ -49,8 +51,10 @@ state = {
if (state.pid)
state.pid.delete();
ulog(LOG_INFO, 'start state in ' + delay / 1000 + ' seconds\n');
state.interval ??= uloop.interval(delay, state.spawn);
state.interval.set(delay);
if (state.interval)
state.interval.set(delay);
else
state.interval = uloop.interval(delay, state.spawn);
},
complete: function() {
@@ -79,15 +83,15 @@ function config_load() {
uci.load('state');
config = uci.get_all('state');
if (healthcheck?.interval)
healthcheck.interval.cancel();
if (config?.health?.interval)
healthcheck.run(config?.health?.interval * 1000);
else
healthcheck.interval?.cancel();
if (state?.interval)
state.interval.cancel();
if (config?.stats?.interval)
state.run(config?.stats?.interval * 1000);
else
state.interval?.cancel();
let status = ubus.call('ucentral', 'status');
if (status?.connected)

View File

@@ -5,14 +5,6 @@ START=80
USE_PROCD=1
PROG=/usr/sbin/ucentral-state
service_triggers() {
procd_add_reload_trigger state
}
reload_service() {
ubus call state reload
}
start_service() {
procd_open_instance
procd_set_param command "$PROG"

View File

@@ -0,0 +1,33 @@
From a38aed3f16c366b51f3350b4fb5008f6b5840b4e Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Wed, 22 Nov 2023 06:51:59 +0100
Subject: [PATCH] libubox: use CLOCK_BOOTTIME
Signed-off-by: John Crispin <john@phrozen.org>
---
.../libs/libubox/patches/001-CLOCK_BOOTTIME.patch | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 package/libs/libubox/patches/001-CLOCK_BOOTTIME.patch
diff --git a/package/libs/libubox/patches/001-CLOCK_BOOTTIME.patch b/package/libs/libubox/patches/001-CLOCK_BOOTTIME.patch
new file mode 100644
index 0000000000..5e78d5ade9
--- /dev/null
+++ b/package/libs/libubox/patches/001-CLOCK_BOOTTIME.patch
@@ -0,0 +1,13 @@
+Index: libubox-2023-05-23-82fa6480/uloop.c
+===================================================================
+--- libubox-2023-05-23-82fa6480.orig/uloop.c
++++ libubox-2023-05-23-82fa6480/uloop.c
+@@ -293,7 +293,7 @@ static void uloop_gettime(struct timeval
+ {
+ struct timespec ts;
+
+- clock_gettime(CLOCK_MONOTONIC, &ts);
++ clock_gettime(CLOCK_BOOTTIME, &ts);
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 1000;
+ }
--
2.34.1