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
1 change: 1 addition & 0 deletions .config.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ CONFIG_PACKAGE_matter-netman-mbedtls=m
CONFIG_PACKAGE_matter-netman-openssl=m
CONFIG_PACKAGE_mdnsresponder=m
CONFIG_PACKAGE_openthread-br=m
CONFIG_PACKAGE_openthread-rcp-nrf52840-mdk=m
75 changes: 75 additions & 0 deletions devel/arm-gnu-rm-toolchain/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (c) 2026 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include $(TOPDIR)/rules.mk

PKG_NAME:=arm-gnu-rm-toolchain
UPSTREAM_VERSION:=10.3-2021.10
PKG_VERSION:=$(subst -,.,$(UPSTREAM_VERSION))

PrebuiltTarball=gcc-arm-none-eabi-$(UPSTREAM_VERSION)-$(1).tar.bz2
define Download/prebuilt
URL:=https://developer.arm.com/-/media/files/downloads/gnu-rm/$(UPSTREAM_VERSION)/
FILE:=$(call PrebuiltTarball,$(1))
endef
define Download/x86_64-linux
$(call Download/prebuilt,x86_64-linux)
MD5SUM:=2383e4eb4ea23f248d33adc70dc3227e
endef
define Download/aarch64-linux
$(call Download/prebuilt,aarch64-linux)
MD5SUM:=3fe3d8bb693bd0a6e4615b6569443d0d
endef
define Download/mac
$(call Download/prebuilt,mac)
MD5SUM:=7f2a7b7b23797302a9d6182c6e482449
endef

PKG_LICENSE:=GPL-3.0-or-later LGPL-3.0-or-later MIT Zlib
PKG_LICENSE_FILES:=license.txt

PKG_HOST_ONLY:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk

define Package/arm-gnu-rm-toolchain
SECTION:=devel
CATEGORY:=Development
TITLE:=arm-gnu-rm-toolchain
URL:=https://developer.arm.com/downloads/-/gnu-rm
BUILDONLY:=1
endef

define Package/arm-gnu-rm-toolchain/description
The GNU Arm Embedded Toolchain for 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families.
endef

PREBUILT_FLAVOR:=$(if $(filter Darwin,$(HOST_OS)),mac,$(HOST_ARCH)-$(call tolower,$(HOST_OS)))
PREBUILT_TARBALL:=$(DL_DIR)/$(call PrebuiltTarball,$(PREBUILT_FLAVOR))
$(if $(strip $(Download/$(PREBUILT_FLAVOR))),$(eval $(call Download,$(PREBUILT_FLAVOR))))

Host/Prepare:=$(empty)
Host/Configure:=$(empty)

define Host/Compile
test -f $(PREBUILT_TARBALL) || { echo "ERROR: Unsupported host platform '$(PREBUILT_FLAVOR)'"; false; }
endef

define Host/Install
bzcat $(PREBUILT_TARBALL) | $(HOST_TAR) -C $(1) --strip-components 1 -xf -
endef

$(eval $(call BuildPackage,arm-gnu-rm-toolchain))
$(eval $(call HostBuild))
3 changes: 2 additions & 1 deletion devel/gn/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Project CHIP Authors
# Copyright (c) 2023-2026 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,6 +44,7 @@ define Package/gn
CATEGORY:=Development
TITLE:=gn
URL:=https://gn.googlesource.com/gn
BUILDONLY:=1
endef

define Package/gn/description
Expand Down
3 changes: 2 additions & 1 deletion devel/python3-host-ssl/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025 Project CHIP Authors
# Copyright (c) 2025-2026 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,7 @@ define Package/python3-host-ssl
SECTION:=lang
CATEGORY:=Languages
TITLE:=Python3 host package SSL configuration
BUILDONLY:=1
endef

define Package/python3-host-ssl/description
Expand Down
21 changes: 11 additions & 10 deletions third_party/openthread-br/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=openthread-br
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_URL:=https://github.com/openthread/ot-br-posix.git
PKG_SOURCE_PROTO:=git-with-metadata
PKG_SOURCE_MIRROR:=0 # don't try OpenWrt mirror
Expand Down Expand Up @@ -119,7 +119,7 @@ endef

# Disable firewall integration due to https://github.com/openthread/ot-br-posix/issues/1675
CMAKE_OPTIONS+= \
-DOTBR_GIT_VERSION=$(call GitWithMetadata/resolve,OTBR_GIT_VERSION) \
-DOTBR_GIT_VERSION=$(call GitWithMetadata/resolve,OTBR_GIT_VERSION)$(if $(PKG_RELEASE),-r$(PKG_RELEASE)) \
-DOT_PACKAGE_VERSION=$(call GitWithMetadata/resolve,OT_GIT_VERSION) \
-DCMAKE_BUILD_TYPE=$(if $(CONFIG_DEBUG),Debug,Release) \
-DCMAKE_INSTALL_PREFIX=/usr \
Expand All @@ -134,9 +134,10 @@ CMAKE_OPTIONS+= \
-DOT_POSIX_SETTINGS_PATH=\"/etc/openthread\" \
-DOT_READLINE=OFF

# OpenWrt uses /var/run instead of /run
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 All @@ -151,18 +152,18 @@ CMAKE_OPTIONS+= -DOTBR_MDNS=mDNSResponder
endif

define Package/openthread-br/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/hotplug.d/usb
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/otbr-agent $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ot-ctl $(1)/usr/sbin

$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/init.d/* $(1)/etc/init.d

$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/config/* $(1)/etc/config
$(INSTALL_BIN) ./files/otbr-rcp $(1)/usr/sbin
$(INSTALL_BIN) ./files/otbr-agent.init $(1)/etc/init.d/otbr-agent
$(INSTALL_CONF) ./files/otbr-agent.config $(1)/etc/config/otbr-agent
$(INSTALL_DATA) ./files/otbr-agent.defaults $(1)/etc/uci-defaults/95-otbr-agent
$(INSTALL_DATA) ./files/otbr-rcp.hotplug $(1)/etc/hotplug.d/usb/50-otbr-rcp
endef

define Package/openthread-br/conffiles
/etc/config/otbr-agent
/etc/openthread/
endef

Expand Down
2 changes: 2 additions & 0 deletions third_party/openthread-br/files/otbr-agent.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config otbr-agent 'wpan0'
option infra_if_name 'br-lan'
38 changes: 38 additions & 0 deletions third_party/openthread-br/files/otbr-agent.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2026 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# If the firewall is configured and the default otbr-agent instance
# exists, create a thread zone with forwarding to and from lan.
uci -q get firewall >/dev/null \
&& [ "$(uci -q get otbr-agent.wpan0)" = "otbr-agent" ] \
&& ! uci -q get otbr-agent.wpan0.thread_if_name >/dev/null \
&& ! uci -q show firewall | grep -q "^firewall\.@zone\[[0-9]*\]\.name='thread'" \
&& uci batch <<EOF >/dev/null
add firewall zone
set firewall.@zone[-1].name='thread'
set firewall.@zone[-1].input='ACCEPT'
set firewall.@zone[-1].output='ACCEPT'
set firewall.@zone[-1].forward='ACCEPT'
set firewall.@zone[-1].family='ipv6'
set firewall.@zone[-1].device='wpan0'
add firewall forwarding
set firewall.@forwarding[-1].src='thread'
set firewall.@forwarding[-1].dest='lan'
add firewall forwarding
set firewall.@forwarding[-1].src='lan'
set firewall.@forwarding[-1].dest='thread'
commit firewall
EOF

exit 0
74 changes: 74 additions & 0 deletions third_party/openthread-br/files/otbr-agent.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/sh /etc/rc.common

# Copyright (c) 2026 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

START=90

USE_PROCD=1
AGENT_PROG=/usr/sbin/otbr-agent
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'
}

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 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
}

start_service()
{
config_load otbr-agent
config_foreach validate_section_otbr otbr-agent otbr_instance
}
Loading