Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .config.ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ CONFIG_AUTOREMOVE=n
CONFIG_AUTOREBUILD=n
CONFIG_BUILD_LOG=y
CONFIG_MBEDTLS_CCM_C=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED=y
CONFIG_OPENTHREADBR_SHARED_MBEDTLS=y
CONFIG_PACKAGE_matter-netman-mbedtls=m
CONFIG_PACKAGE_matter-netman-openssl=m
CONFIG_PACKAGE_mdnsresponder=m
Expand Down
17 changes: 9 additions & 8 deletions third_party/openthread-br/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024-2025 Project CHIP Authors
# Copyright (c) 2024-2026 Project CHIP Authors
# Copyright (c) 2020, The OpenThread Authors.
#
# All rights reserved.
Expand Down Expand Up @@ -27,15 +27,16 @@
# POSSIBILITY OF SUCH DAMAGE.

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/version.mk

PKG_NAME:=openthread-br
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/openthread/ot-br-posix.git
PKG_SOURCE_PROTO:=git-with-metadata

PKG_SOURCE_DATE:=2025-10-29
PKG_SOURCE_VERSION:=07fc9adf2afd6f697a92c54db922f575c7bcd28f
PKG_MIRROR_HASH:=cc62bc395897122e5b45e7d956c8488758dba3be4ed5b728b7cbf5bfc8caaf07
PKG_SOURCE_DATE:=2026-05-22
PKG_SOURCE_VERSION:=9e56492ef19b6d43cc8be4a69ac7ae6376194f69
PKG_MIRROR_HASH:=2ba2e9aeeeb8c5ee7411f18d3303340bf35817f6c1f12fa35bebeae5974ac45a

PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
Expand Down Expand Up @@ -124,18 +125,18 @@ CMAKE_OPTIONS+= \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING=OFF \
-DOTBR_OPENWRT=ON \
-DOTBR_VENDOR_NAME=$(VERSION_MANUFACTURER) \
-DOTBR_BORDER_AGENT=ON \
-DOTBR_BORDER_ROUTING=ON \
-DOTBR_INFRA_IF_NAME=br-lan \
-DOTBR_SRP_ADVERTISING_PROXY=ON \
-DOTBR_NAT64=OFF \
-DOT_FIREWALL=OFF \
-DOTBR_SETTINGS_FILE_USE_INTERFACE_NAME=ON \
-DOT_POSIX_SETTINGS_PATH=\"/etc/openthread\" \
-DOT_FIREWALL=OFF \
-DOT_READLINE=OFF

TARGET_CFLAGS+= \
-DOPENTHREAD_POSIX_CONFIG_DAEMON_SOCKET_BASENAME=\\\"/var/run/openthread-%s\\\" \
-DOPENTHREAD_POSIX_CONFIG_SETTINGS_USE_INTERFACE_NAME=1 \
-DOPENTHREAD_POSIX_CONFIG_TMP_STORAGE_ENABLE=0 \
-DOPENTHREAD_CONFIG_LOG_PREPEND_UPTIME=0 \
-DOPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=0
Expand Down
80 changes: 41 additions & 39 deletions third_party/openthread-br/files/otbr-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,55 @@ RCP_PROG=/usr/sbin/otbr-rcp

validate_section_otbr()
{
uci_load_validate otbr-agent otbr-agent "$1" "$2" \
'thread_if_name:string' \
'infra_if_name:string' \
'uart_device:string:any' \
'uart_baudrate:uinteger:0' \
'uart_flow_control:bool:1' \
'rcp_hotplug:bool:1' \
'rcp_firmware_update:bool:1'
uci_load_validate otbr-agent otbr-agent "$1" "$2" \
'thread_if_name:string' \
'infra_if_name:string' \
'uart_device:string:any' \
'uart_baudrate:uinteger:0' \
'uart_flow_control:bool:1' \
'rcp_hotplug:bool:1' \
'rcp_firmware_update:bool:1'
}

otbr_instance()
{
local cfg="$1"
if [ "$2" != 0 ]; then
echo "validation failed"
return 1
fi
if [ -z "$infra_if_name" ]; then
echo "missing infra_if_name"
return 1
fi
local cfg="$1"
if [ "$2" != 0 ]; then
echo "validation failed"
return 1
fi
if [ -z "$infra_if_name" ]; then
echo "missing infra_if_name"
return 1
fi

local radio_url
if [ "${uart_device#/dev/}" != "${uart_device}" ]; then
# Directly run otbr-agent with the specified /dev/* device
set -- "$AGENT_PROG"
radio_url="spinel+hdlc+uart://${uart_device}"
else
# Use the otbr-rcp wrapper to locate the device
set -- "$RCP_PROG"
[ "$rcp_hotplug" -eq 0 ] || set -- "$@" --wait
[ "$rcp_firmware_update" -eq 0 ] || set -- "$@" --update
set -- "$@" "$uart_device" --
radio_url="%rcpurl%"
fi
radio_url="${radio_url}?uart-exclusive"
[ "$uart_baudrate" -eq 0 ] || radio_url="${radio_url}&uart-baudrate=${uart_baudrate}"
[ "$uart_flow_control" -eq 0 ] || radio_url="${radio_url}&uart-flow-control"
local radio_url
if [ "${uart_device#/dev/}" != "${uart_device}" ]; then
# Directly run otbr-agent with the specified /dev/* device
set -- "$AGENT_PROG"
radio_url="spinel+hdlc+uart://${uart_device}"
else
# Use the otbr-rcp wrapper to locate the device
set -- "$RCP_PROG"
[ "$rcp_hotplug" -eq 0 ] || set -- "$@" --wait
[ "$rcp_firmware_update" -eq 0 ] || set -- "$@" --update
set -- "$@" "$uart_device" --
radio_url="%rcpurl%"
fi
radio_url="${radio_url}?uart-exclusive"
[ "$uart_baudrate" -eq 0 ] || radio_url="${radio_url}&uart-baudrate=${uart_baudrate}"
[ "$uart_flow_control" -eq 0 ] || radio_url="${radio_url}&uart-flow-control"

procd_open_instance
procd_set_param command "$@" -I "${thread_if_name:-$cfg}" -B "$infra_if_name" "${radio_url}" "trel://${infra_if_name}"
procd_set_param respawn
procd_close_instance
local model="$(jsonfilter -q -i /etc/board.json -e @.model.name)"

procd_open_instance
procd_set_param command "$@" -I "${thread_if_name:-$cfg}" -B "$infra_if_name" --model-name "${model:-BorderRouter}" "${radio_url}" "trel://${infra_if_name}"
procd_set_param respawn
procd_close_instance
}

start_service()
{
config_load otbr-agent
config_foreach validate_section_otbr otbr-agent otbr_instance
config_load otbr-agent
config_foreach validate_section_otbr otbr-agent otbr_instance
}
2 changes: 1 addition & 1 deletion third_party/openthread-br/files/otbr-rcp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ update_rcp() { # rcpdev rcptty rcpurl

# Use uart-exclusive to ensure we don't interfere with a running otbr-agent
log debug "Determining current firmware for USB device $rcpdev ($rcptty)"
local currentfw="$("$AGENT_PROG" --radio-version "${rcpurl}?uart-exclusive" 2>/dev/null)"
local currentfw="$("$AGENT_PROG" -s -d3 --radio-version "${rcpurl}?uart-exclusive" 2>/dev/null)"
Comment thread
ksperling-apple marked this conversation as resolved.
if [ -z "$currentfw" ]; then
log notice "Not updating USB device $rcpdev, unable to determine current firmware version"
return 0
Expand Down
40 changes: 25 additions & 15 deletions third_party/openthread-br/patches/020-external-mbedtls.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
commit 865059d9875bac8e22fd64d5e506c0dd5c3ba886
Author: Karsten Sperling <ksperling@apple.com>
Date: Fri Oct 10 22:29:18 2025 +1300
From 875543a791f91c2ada64977ce5fc75502c8daf1e Mon Sep 17 00:00:00 2001
From: Karsten Sperling <ksperling@apple.com>
Date: Fri, 10 Oct 2025 22:29:18 +1300
Subject: [PATCH] Add OTBR_EXTERNAL_MBEDTLS build setting

Add OTBR_EXTERNAL_MBEDTLS build setting

This works the same as (and propagates to OT_EXTERNAL_MBEDTLS).
This works the same as (and propagates to OT_EXTERNAL_MBEDTLS).
---
etc/cmake/options.cmake | 7 +++++++
src/utils/CMakeLists.txt | 2 +-
src/web/CMakeLists.txt | 2 +-
tests/gtest/CMakeLists.txt | 4 ++--
third_party/openthread/CMakeLists.txt | 1 +
tools/CMakeLists.txt | 4 ++--
6 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake
index 13874415d1..29af2827a7 100644
index 1339b3b2..8183bb19 100644
--- a/etc/cmake/options.cmake
+++ b/etc/cmake/options.cmake
@@ -39,6 +39,13 @@ elseif (OTBR_MDNS STREQUAL "openthread")
@@ -40,6 +40,13 @@ elseif (OTBR_MDNS STREQUAL "openthread")
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_MDNS_OPENTHREAD=1)
endif()

Expand All @@ -25,18 +32,18 @@ index 13874415d1..29af2827a7 100644
if (OTBR_BORDER_AGENT)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_BORDER_AGENT=1)
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
index 26d51e4866..07a4cdbb41 100644
index acfb8a76..657a58e4 100644
--- a/src/utils/CMakeLists.txt
+++ b/src/utils/CMakeLists.txt
@@ -42,5 +42,5 @@ add_library(otbr-utils

@@ -43,5 +43,5 @@ add_library(otbr-utils
target_link_libraries(otbr-utils PUBLIC
otbr-common
otbr-posix
- mbedtls
+ ${OTBR_MBEDTLS}
)
diff --git a/src/web/CMakeLists.txt b/src/web/CMakeLists.txt
index 217341ba23..270e28a15f 100644
index 217341ba..270e28a1 100644
--- a/src/web/CMakeLists.txt
+++ b/src/web/CMakeLists.txt
@@ -50,7 +50,7 @@ target_link_libraries(otbr-web PRIVATE
Expand All @@ -49,7 +56,7 @@ index 217341ba23..270e28a15f 100644
)
install(
diff --git a/tests/gtest/CMakeLists.txt b/tests/gtest/CMakeLists.txt
index 2974cf52d9..79e559d363 100644
index 2974cf52..79e559d3 100644
--- a/tests/gtest/CMakeLists.txt
+++ b/tests/gtest/CMakeLists.txt
@@ -47,7 +47,7 @@ add_executable(otbr-gtest-unit
Expand All @@ -71,7 +78,7 @@ index 2974cf52d9..79e559d363 100644
otbr-utils
otbr-posix
diff --git a/third_party/openthread/CMakeLists.txt b/third_party/openthread/CMakeLists.txt
index 50dc5728c3..c95b7ab438 100644
index eddf5ce1..3b7dbf1e 100644
--- a/third_party/openthread/CMakeLists.txt
+++ b/third_party/openthread/CMakeLists.txt
@@ -51,6 +51,7 @@ set(OT_DNS_CLIENT_OVER_TCP OFF CACHE STRING "disable DNS query over TCP")
Expand All @@ -83,7 +90,7 @@ index 50dc5728c3..c95b7ab438 100644
set(OT_HISTORY_TRACKER ON CACHE STRING "enable history tracker" FORCE)
set(OT_JOINER ON CACHE STRING "enable joiner" FORCE)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 5e8451afdb..7df5c6905d 100644
index 5e8451af..7df5c690 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -33,7 +33,7 @@ target_link_libraries(pskc PRIVATE
Expand All @@ -104,3 +111,6 @@ index 5e8451afdb..7df5c6905d 100644
)

if ($ENV{REFERENCE_DEVICE})
--
2.50.1 (Apple Git-155)

23 changes: 14 additions & 9 deletions third_party/openthread-br/patches/030-git-version.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
commit 0257ed3ce1bf32639134e3a485e3c1e74a4f4606
Author: Karsten Sperling <ksperling@apple.com>
Date: Fri Oct 10 22:49:53 2025 +1300
From a59a7638103167696ba2b8773d6c26221ff13901 Mon Sep 17 00:00:00 2001
From: Karsten Sperling <ksperling@apple.com>
Date: Fri, 10 Oct 2025 22:49:53 +1300
Subject: [PATCH] Allow OTBR_GIT_VERSION to be supplied externally

Allow OTBR_GIT_VERSION to be supplied externally

This is useful when building from an archive instead of directly out of a git
working copy, but where the git commit metadata is available externally.
This is useful when building from an archive instead of directly out of a git
working copy, but where the git commit metadata is available externally.
---
CMakeLists.txt | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4acff5da2..6cebd976b7 100644
index 78c86ae0..5d9f3f2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,11 +68,13 @@ endif()
@@ -70,11 +70,13 @@ endif()
message(STATUS "OTBR package name: ${OTBR_NAME}")

if(NOT OTBR_VERSION)
Expand All @@ -30,3 +32,6 @@ index f4acff5da2..6cebd976b7 100644

if(OTBR_GIT_VERSION)
set(OTBR_VERSION "${PROJECT_VERSION}-${OTBR_GIT_VERSION}")
--
2.50.1 (Apple Git-155)

46 changes: 46 additions & 0 deletions third_party/openthread-br/patches/040-settings-ifname.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 30d0ddf4ffd021207b9ca9428f8031e2f8ee7df6 Mon Sep 17 00:00:00 2001
From: Karsten Sperling <ksperling@apple.com>
Date: Wed, 27 May 2026 13:02:17 +1200
Subject: [PATCH] Add OTBR_SETTINGS_FILE_USE_INTERFACE_NAME build setting

When enabled, this names the posix settings file based on the Thread interface
name (e.g. wpan0) instead of the default <port offset>_<eui> naming. This
allows the settings file to remain stable when replacing the RCP dongle.
---
etc/cmake/options.cmake | 5 +++++
src/host/rcp_host.cpp | 3 +++
2 files changed, 8 insertions(+)

diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake
index 8183bb19..ce8b7961 100644
--- a/etc/cmake/options.cmake
+++ b/etc/cmake/options.cmake
@@ -253,6 +253,11 @@ else()
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_LINK_METRICS_TELEMETRY=0)
endif()

+option(OTBR_SETTINGS_FILE_USE_INTERFACE_NAME "Name the settings file after the Thread interface instead of the RCP EUI64" OFF)
+if(OTBR_SETTINGS_FILE_USE_INTERFACE_NAME)
+ target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_SETTINGS_FILE_USE_INTERFACE_NAME=1)
+endif()
+
option(OTBR_POWER_CALIBRATION "Enable Power Calibration" ON)
if (OTBR_POWER_CALIBRATION)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_POWER_CALIBRATION=1)
diff --git a/src/host/rcp_host.cpp b/src/host/rcp_host.cpp
index b99de3cf..9eb78c59 100644
--- a/src/host/rcp_host.cpp
+++ b/src/host/rcp_host.cpp
@@ -153,6 +153,9 @@ RcpHost::RcpHost(const char *aInterfaceName,
mConfig.mCoprocessorUrls.mUrls[mConfig.mCoprocessorUrls.mNum++] = url;
}
mConfig.mSpeedUpFactor = 1;
+#if OTBR_ENABLE_SETTINGS_FILE_USE_INTERFACE_NAME
+ mConfig.mSettingsFile = aInterfaceName;
+#endif
}

RcpHost::~RcpHost(void)
--
2.50.1 (Apple Git-155)

58 changes: 0 additions & 58 deletions third_party/openthread-br/patches/040-uart-exclusive.patch

This file was deleted.

Loading