Skip to content

Commit

Permalink
openthread_border_router: bump to latest and smaller improvements (ho…
Browse files Browse the repository at this point in the history
…me-assistant#3772)

* openthread_border_router: bump to latest and smaller improvements

Bump to OTBR POSIX version 09574a202c2 (2024-09-23 08:54:32 -0700)
and fix some smaller issues, specifically make sure that the log output
is not buffered and avoid ipset errors.

* openthread_border_router: bump to latest again

Bump to OTBR POSIX version ff7227ea9a2 (2024-09-25 14:54:08 -0700).
Gets rid of a local patch.
  • Loading branch information
agners authored Sep 27, 2024
1 parent ed0f4e9 commit a16142a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 72 deletions.
10 changes: 5 additions & 5 deletions openthread_border_router/0001-support-deleting-the-dataset.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e67d11327f3ee5f67107d866c2df575a2695727c Mon Sep 17 00:00:00 2001
From 2efa60f83b71402ce0c1ef176be8f88a9bfdefac Mon Sep 17 00:00:00 2001
From: Stefan Agner <[email protected]>
Date: Mon, 5 Jun 2023 23:41:50 +0200
Subject: [PATCH] support deleting the dataset
Expand All @@ -16,7 +16,7 @@ otDatasetCreateNewNetwork).
3 files changed, 57 insertions(+)

diff --git a/src/rest/openapi.yaml b/src/rest/openapi.yaml
index 2ba2a4dd56..2edc4af29a 100644
index 2ba2a4dd56f..2edc4af29ad 100644
--- a/src/rest/openapi.yaml
+++ b/src/rest/openapi.yaml
@@ -248,6 +248,18 @@ paths:
Expand Down Expand Up @@ -55,7 +55,7 @@ index 2ba2a4dd56..2edc4af29a 100644
schemas:
LeaderData:
diff --git a/src/rest/resource.cpp b/src/rest/resource.cpp
index ce154c2e5b..1708faf6ab 100644
index ce154c2e5b3..1708faf6abc 100644
--- a/src/rest/resource.cpp
+++ b/src/rest/resource.cpp
@@ -767,12 +767,47 @@ exit:
Expand Down Expand Up @@ -107,7 +107,7 @@ index ce154c2e5b..1708faf6ab 100644
GetDataset(aDatasetType, aRequest, aResponse);
break;
diff --git a/src/rest/resource.hpp b/src/rest/resource.hpp
index 0929dbcc50..cbe1702f2f 100644
index 0929dbcc50c..cbe1702f2fb 100644
--- a/src/rest/resource.hpp
+++ b/src/rest/resource.hpp
@@ -150,6 +150,7 @@ private:
Expand All @@ -119,5 +119,5 @@ index 0929dbcc50..cbe1702f2f 100644
void DeleteOutDatedDiagnostic(void);
void UpdateDiag(std::string aKey, std::vector<otNetworkDiagTlv> &aDiag);
--
2.46.0
2.46.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7662acaaffb9cf730a8ba1d4f6014832dad23d0f Mon Sep 17 00:00:00 2001
From afb29a91024247f46e9e75954b930f4518444360 Mon Sep 17 00:00:00 2001
From: Stefan Agner <[email protected]>
Date: Sat, 20 Jan 2024 16:31:28 +0100
Subject: [PATCH] set netif route metric lower
Expand All @@ -11,17 +11,17 @@ OpenThread network interface's own route is lower than that.
1 file changed, 1 insertion(+)

diff --git a/third_party/openthread/CMakeLists.txt b/third_party/openthread/CMakeLists.txt
index 8ea4516e4e..97007a58cd 100644
index eab6e7c6007..9e01d66aefd 100644
--- a/third_party/openthread/CMakeLists.txt
+++ b/third_party/openthread/CMakeLists.txt
@@ -106,6 +106,7 @@ target_compile_definitions(ot-config INTERFACE
"-DOPENTHREAD_CONFIG_LOG_CLI=1"
"-DOPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS=3"
"-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1"
"-DOPENTHREAD_CONFIG_TCP_ENABLE=0"
+ "-DOPENTHREAD_POSIX_CONFIG_NETIF_PREFIX_ROUTE_METRIC=64"
"-DOPENTHREAD_POSIX_CONFIG_FILE=\"${PROJECT_BINARY_DIR}/src/agent/openthread-otbr-posix-config.h\""
)

--
2.46.0
2.46.1

This file was deleted.

6 changes: 6 additions & 0 deletions openthread_border_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.11.0

- Bump to OTBR POSIX version ff7227ea9a2 (2024-09-25 14:54:08 -0700)
- Make log output unbuffered
- Avoid ipset errors when firewall is disabled

## 2.10.0

- Bump to OTBR POSIX version b66cabfaa0 (2024-08-14 08:01:56 -0700)
Expand Down
4 changes: 2 additions & 2 deletions openthread_border_router/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ENV DOCKER 1

COPY 0001-support-deleting-the-dataset.patch /usr/src
COPY 0002-set-netif-route-metric-lower.patch /usr/src
COPY 0003-logging-support-disable-syslog-for-otbr-web-as-well.patch /usr/src
COPY 0001-channel-monitor-disable-by-default.patch /usr/src
# Required and installed (script/bootstrap) can be removed after build
ENV OTBR_BUILD_DEPS build-essential ninja-build cmake wget ca-certificates \
Expand Down Expand Up @@ -56,7 +55,6 @@ RUN \
&& ./script/bootstrap \
&& patch -p1 < /usr/src/0001-support-deleting-the-dataset.patch \
&& patch -p1 < /usr/src/0002-set-netif-route-metric-lower.patch \
&& patch -p1 < /usr/src/0003-logging-support-disable-syslog-for-otbr-web-as-well.patch \
&& ( \
cd third_party/openthread/repo \
&& patch -p1 < /usr/src/0001-channel-monitor-disable-by-default.patch \
Expand Down Expand Up @@ -89,6 +87,8 @@ RUN \
-DOT_CHANNEL_MONITOR=ON \
-DOT_COAP=OFF \
-DOT_COAPS=OFF \
-DOT_DNS_CLIENT_OVER_TCP=OFF \
-DOT_THREAD_VERSION=1.3 \
&& cd build/otbr/ \
&& ninja \
&& ninja install) \
Expand Down
2 changes: 1 addition & 1 deletion openthread_border_router/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-debian:bookworm
amd64: ghcr.io/home-assistant/amd64-base-debian:bookworm
args:
OTBR_VERSION: b66cabfaa0b6829314e8c326c4f92bfbaa55ad9b
OTBR_VERSION: ff7227ea9a2dc0e50f92ab93bd5c9a29e82fe793
UNIVERSAL_SILABS_FLASHER: 0.0.22
2 changes: 1 addition & 1 deletion openthread_border_router/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 2.10.0
version: 2.11.0
slug: openthread_border_router
name: OpenThread Border Router
description: OpenThread Border Router add-on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ fi

mkdir -p /data/thread && ln -sft /var/lib /data/thread || bashio::exit.nok "Could not create directory /var/lib/thread to store Thread data."

# We compile the OTBR with firewall support, so otbr-agent tries to update the
# ipsets. Therefor, create ipsets always to avoid errors from otbr-agent. Just
# the ipsets won't have an effect in practice when the firewall is disabled.
ipset create -exist otbr-ingress-deny-src hash:net family inet6
ipset create -exist otbr-ingress-deny-src-swap hash:net family inet6
ipset create -exist otbr-ingress-allow-dst hash:net family inet6
ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6

if bashio::config.true 'firewall'; then
bashio::log.info "Setup OTBR firewall..."
ipset create -exist otbr-ingress-deny-src hash:net family inet6
ipset create -exist otbr-ingress-deny-src-swap hash:net family inet6
ipset create -exist otbr-ingress-allow-dst hash:net family inet6
ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6

ip6tables -N $otbr_forward_ingress_chain
ip6tables -I FORWARD 1 -o $thread_if -j $otbr_forward_ingress_chain

Expand Down Expand Up @@ -116,7 +119,7 @@ echo "${otbr_rest_listen}" > /tmp/otbr-agent-rest-api
echo "${otbr_rest_listen_port}" >> /tmp/otbr-agent-rest-api

bashio::log.info "Starting otbr-agent..."
exec s6-notifyoncheck -d -s 300 -w 300 -n 0 \
exec s6-notifyoncheck -d -s 300 -w 300 -n 0 stdbuf -oL \
"/usr/sbin/otbr-agent" -I ${thread_if} -B "${backbone_if}" \
--rest-listen-address "${otbr_rest_listen}" \
-d${otbr_log_level_int} -v -s \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ declare otbr_web_port

otbr_web_port="$(bashio::addon.port 8080)"

exec /usr/sbin/otbr-web -I wpan0 -d6 -s -p "${otbr_web_port}"
exec stdbuf -oL /usr/sbin/otbr-web -I wpan0 -d6 -s -p "${otbr_web_port}"

0 comments on commit a16142a

Please sign in to comment.