Skip to content

Commit

Permalink
Update matter-netman to build network manager app from 44afdd2d (#21)
Browse files Browse the repository at this point in the history
Switch CI to build against OpenWrt 23.05.4
  • Loading branch information
ksperling-apple authored Aug 5, 2024
1 parent 1b6974c commit 0428cfc
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .config.ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CONFIG_ALL=n
CONFIG_PACKAGE_wpad-basic-mbedtls=n
CONFIG_PACKAGE_wpad-basic-openssl=n
CONFIG_PACKAGE_wpad-basic-wolfssl=n
CONFIG_PACKAGE_wpad-openssl=y
CONFIG_PACKAGE_matter-netman=y
2 changes: 1 addition & 1 deletion .github/workflows/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Build
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/project-chip/matter-openwrt-build:22.03.5
image: ghcr.io/project-chip/matter-openwrt-build:23.05.4
options: --volume ${{ github.workspace }}:/workspace
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ $ ./scripts/feeds install -a -p matter
For a minimal configuration, overwrite the `.config` file with the following lines and then run `make defconfig`:

```
CONFIG_PACKAGE_wpad-basic-wolfssl=n
CONFIG_PACKAGE_wpad-openssl=y
CONFIG_PACKAGE_matter-netman=y
```

Expand Down
26 changes: 14 additions & 12 deletions service/matter-netman/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Project CHIP Authors
# Copyright (c) 2023-2024 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 @@ -26,9 +26,9 @@ PKG_SOURCE_SUBMODULES:=\
third_party/nlio/repo

# Hash can be regenerated with make package/matter-netman/check FIXUP=1
PKG_SOURCE_DATE:=2023-08-08
PKG_SOURCE_VERSION:=367a0c672c18e0137e0162c15b78adbcb039a33a
PKG_MIRROR_HASH:=5be101a07ffefe7e5bc25f2b3b497d2639e6b8bffb8ec41e173e0904ea814fa8
PKG_SOURCE_DATE:=2024-08-03
PKG_SOURCE_VERSION:=44afdd2d7206a3d4689fb2d73a67cc30ac2ac4bf
PKG_MIRROR_HASH:=5605a714f0fd7de8d3528d81c367a3a7f886ea49dec4eac0de0bb3d74376d51f

# Use local source dir for development
# USE_SOURCE_DIR:=$(HOME)/workspace/connectedhomeip
Expand All @@ -44,17 +44,19 @@ include $(INCLUDE_DIR)/package.mk
define Package/matter-netman
SECTION:=net
CATEGORY:=Network
TITLE:=Matter Network Manager Daemon
TITLE:=Matter Network Infrastructure Manager Daemon
URL:=https://github.com/project-chip/connectedhomeip
DEPENDS:=+libstdcpp +libopenssl +glib2
DEPENDS:=+libstdcpp +libatomic +libopenssl
USERID:=matter:matter
endef

define Package/matter-netman/description
Matter Network Manager Daemon
Matter Network Infrastructure Manager Daemon
Integrates a router / access point with the Matter IoT ecosystem.
endef

# https://github.com/project-chip/matter-openwrt/issues/2
# PKG_SOURCE_SUBMODULES support is in OpenWrt main but not 23.x releases.
ifeq ($(DUMP)$(filter SUBMODULES:=,$(Download/Defaults)),)
$(error PKG_SOURCE_SUBMODULES is not supported, ensure https://github.com/openwrt/openwrt/pull/13000 is included in your OpenWrt buildroot)
endif
Expand All @@ -66,12 +68,11 @@ TARGET_CXXFLAGS += -Wno-format-nonliteral
CHIP_BUILD_ENV_DIR:=$(STAGING_DIR_HOST)/share/chip-build-env
OUT_DIR:=$(PKG_BUILD_DIR)/out/openwrt

# lighting-app is a placeholder for now: https://github.com/project-chip/connectedhomeip/issues/28312
define Build/Configure
mkdir -p $(OUT_DIR) && cd $(OUT_DIR) && \
$(CONFIGURE_VARS) $(PKG_BUILD_DIR)/scripts/configure \
--build-env-dir="$(CHIP_BUILD_ENV_DIR)" \
--project=examples/lighting-app/linux \
--project=examples/network-manager-app/linux \
--target=$(GNU_TARGET_NAME) \
--enable-wifi=no \
--enable-openthread=no \
Expand All @@ -80,12 +81,13 @@ define Build/Configure
endef

define Build/Compile
$(NINJA) -C $(OUT_DIR) chip-lighting-app
$(NINJA) -C $(OUT_DIR) matter-network-manager-app
endef

define Package/matter-netman/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(OUT_DIR)/chip-lighting-app $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
$(INSTALL_BIN) $(OUT_DIR)/matter-network-manager-app $(1)/usr/sbin
$(INSTALL_BIN) ./files/matter.init $(1)/etc/init.d/matter
endef

$(eval $(call BuildPackage,matter-netman))
16 changes: 16 additions & 0 deletions service/matter-netman/files/matter.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh /etc/rc.common

START=80

USE_PROCD=1
PROG=/usr/sbin/matter-network-manager-app

start_service() {
procd_open_instance
procd_set_param command "$PROG"
procd_set_param user matter
procd_set_param group matter
procd_set_param stdout 1
procd_set_param respawn
procd_close_instance
}

0 comments on commit 0428cfc

Please sign in to comment.