ucentral: update to latest development state

* add support for more commands
* add firstcontact support
* add pstore based crashlog support
* fix github workflow
* improve captive portal/guest support

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-03-31 10:45:25 +02:00
parent bc13ab4544
commit 0b95ce5d02
10 changed files with 106 additions and 13 deletions

View File

@@ -34,4 +34,4 @@ jobs:
TAR_NAME="$LOWERCASE_TARGET-$BRANCH.tar.gz"
ls openwrt/bin/targets/
tar cfz "$TAR_NAME" -C openwrt/bin/targets/ .
curl -u $GH_BUILD_USERNAME:$GH_BUILD_USERNAME -T "$TAR_NAME" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/$LOWERCASE_TARGET/uCentral/dev/"$TAR_NAME""
curl -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "$TAR_NAME" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/$LOWERCASE_TARGET/uCentral/dev/"$TAR_NAME""

View File

@@ -6,8 +6,12 @@ USE_PROCD=1
PROG=/usr/bin/ucode
start_service() {
[ -f /etc/ucentral/capabilities.json ] || {
ucode -m ubus -E board=/etc/board.json /usr/share/ucentral/capabilities.uc > /etc/ucentral/capabilities.json
}
procd_open_instance
procd_set_param command "$PROG" -m uci -m fs -i /usr/share/ucentral/firstcontact.uc
procd_set_param respawn 1 60 0
procd_set_param respawn 1 10 0
procd_close_instance
}

View File

@@ -41,17 +41,23 @@ if (!config.Redirector) {
exit(1);
}
let cursor = uci.cursor("/etc/config-shadow/");
cursor.load("ucentral");
cursor.set("ucentral", "config", "server", config.Redirector);
cursor.set("ucentral", "config", "serial", devid);
cursor.commit();
function store_config(path) {
let cursor = uci.cursor(path);
cursor.load("ucentral");
cursor.set("ucentral", "config", "server", config.Redirector);
cursor.set("ucentral", "config", "serial", devid);
cursor.commit();
}
store_config();
store_config("/etc/config-shadow/");
warn("firstcontact: managed to look up redirector\n");
system("/etc/init.d/ucentral enable");
system("/etc/init.d/ucentral restart");
system("/etc/init.d/firstcontact disable");
system("reload_config");
system("/etc/init.d/ucentral start");
system("/etc/init.d/firstcontact stop");
%}

View File

@@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/blogic/ucentral-client.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-02-15
PKG_SOURCE_VERSION:=6194debc0995550c5169972e150506617a2df970
PKG_SOURCE_VERSION:=6c2c4bc1e176414568e73c96976461b3a1daf2eb
PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=John Crispin <john@phrozen.org>

View File

@@ -21,6 +21,7 @@ start_service() {
config_get server 'config' 'server'
config_get port 'config' 'port'
config_get debug 'config' 'debug' 0
config_get insecure 'config' 'insecure' 0
procd_open_instance
procd_set_param command "$PROG"
@@ -29,6 +30,12 @@ start_service() {
[ -n "$port" ] && procd_append_param command -P $port
[ -n "$reporting" ] && procd_append_param command -r $reporting
[ "$debug" -eq 0 ] || procd_append_param command -d
[ "$insecure" -eq 0 ] || procd_append_param command -i
procd_set_param respawn 3600 5 0
procd_close_instance
}
boot() {
ucode -m fs -i /usr/share/ucentral/crashlog.uc
start
}

View File

@@ -0,0 +1,13 @@
{%
if (!fs.stat("/sys/fs/pstore/dmesg-ramoops-0"))
return 0;
let fd = fs.open("/sys/fs/pstore/dmesg-ramoops-0", "r");
let line, lines = [];
while (line = fd.read("line"))
push(lines, trim(line));
fd.close();
let fd = fs.open("/tmp/crashlog", "w");
fd.write({crashlog: lines});
fd.close();
print(lines);
%}

View File

@@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-02-15
PKG_SOURCE_VERSION:=7fb6336b47ebc06a9d990226a028cdf58b7110bd
PKG_SOURCE_VERSION:=8396515cdd6f2c782aa0b1e2f21662d5846457b8
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=git@github.com:stephb9959/ucentralgw.git
PKG_SOURCE_DATE:=2021-03-28
PKG_SOURCE_VERSION:=f45dac773971b7ad6f1e0687f0e60b0d9c61c02d
PKG_SOURCE_VERSION:=35abd7820581d844b694f2d3dd56ee741f40671b
#PKG_MIRROR_HASH:=3f6569a5e63fdfd032976ac0f79d736d3935101ac1b97fb370514b013c5e6bb6
CMAKE_INSTALL:=1

View File

@@ -13,7 +13,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
PKG_SOURCE_DATE:=2021-03-15
PKG_SOURCE_VERSION:=091ae1b198e019430f342ae1444c68d6517e077e
PKG_SOURCE_VERSION:=aa9621db401e881ffcdea03be272c94149484ccf
PKG_MIRROR_HASH:=
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC

View File

@@ -0,0 +1,63 @@
From 7f2bd477546246bb6fab92873b6a2d27ba2b978a Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Tue, 30 Mar 2021 19:03:43 +0200
Subject: [PATCH] target: add pstore support
Signed-off-by: John Crispin <john@phrozen.org>
---
target/linux/generic/config-5.4 | 14 +++++++++++++-
.../linux/ipq40xx/patches-5.4/903-pstore.patch | 17 +++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 target/linux/ipq40xx/patches-5.4/903-pstore.patch
diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4
index a0193ca718..da2cc8db65 100644
--- a/target/linux/generic/config-5.4
+++ b/target/linux/generic/config-5.4
@@ -4136,7 +4136,19 @@ CONFIG_PROC_SYSCTL=y
# CONFIG_PSAMPLE is not set
# CONFIG_PSB6970_PHY is not set
# CONFIG_PSI is not set
-# CONFIG_PSTORE is not set
+CONFIG_PSTORE=y
+# CONFIG_PSTORE_842_COMPRESS is not set
+CONFIG_PSTORE_COMPRESS=y
+CONFIG_PSTORE_COMPRESS_DEFAULT="deflate"
+# CONFIG_PSTORE_CONSOLE is not set
+CONFIG_PSTORE_DEFLATE_COMPRESS=y
+CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y
+# CONFIG_PSTORE_LZ4HC_COMPRESS is not set
+# CONFIG_PSTORE_LZ4_COMPRESS is not set
+# CONFIG_PSTORE_LZO_COMPRESS is not set
+# CONFIG_PSTORE_PMSG is not set
+CONFIG_PSTORE_RAM=y
+# CONFIG_PSTORE_ZSTD_COMPRESS is not set
# CONFIG_PTP_1588_CLOCK is not set
# CONFIG_PTP_1588_CLOCK_IXP46X is not set
# CONFIG_PTP_1588_CLOCK_KVM is not set
diff --git a/target/linux/ipq40xx/patches-5.4/903-pstore.patch b/target/linux/ipq40xx/patches-5.4/903-pstore.patch
new file mode 100644
index 0000000000..89ea4a438e
--- /dev/null
+++ b/target/linux/ipq40xx/patches-5.4/903-pstore.patch
@@ -0,0 +1,17 @@
+Index: linux-5.4.105/arch/arm/boot/dts/qcom-ipq4019.dtsi
+===================================================================
+--- linux-5.4.105.orig/arch/arm/boot/dts/qcom-ipq4019.dtsi
++++ linux-5.4.105/arch/arm/boot/dts/qcom-ipq4019.dtsi
+@@ -32,6 +32,12 @@
+ reg = <0x87e80000 0x180000>;
+ no-map;
+ };
++
++ ramoops@87f00000 {
++ compatible = "ramoops";
++ reg = <0x87df0000 0x10000>;
++ record-size = <0x1000>;
++ };
+ };
+
+ aliases {
--
2.25.1