From 0428cfc66f011b4d15b5d8a5342e451ea9d5e5fe Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:55:19 +1200 Subject: [PATCH] Update matter-netman to build network manager app from 44afdd2d (#21) Switch CI to build against OpenWrt 23.05.4 --- .config.ci | 2 ++ .github/workflows/build-packages.yaml | 2 +- README.md | 2 -- service/matter-netman/Makefile | 26 +++++++++++++------------ service/matter-netman/files/matter.init | 16 +++++++++++++++ 5 files changed, 33 insertions(+), 15 deletions(-) create mode 100755 service/matter-netman/files/matter.init diff --git a/.config.ci b/.config.ci index 56b008b..8dec0e4 100644 --- a/.config.ci +++ b/.config.ci @@ -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 diff --git a/.github/workflows/build-packages.yaml b/.github/workflows/build-packages.yaml index 3609b17..9e882aa 100644 --- a/.github/workflows/build-packages.yaml +++ b/.github/workflows/build-packages.yaml @@ -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: | diff --git a/README.md b/README.md index 352c3a3..5213274 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/service/matter-netman/Makefile b/service/matter-netman/Makefile index f25bd0f..a38e237 100644 --- a/service/matter-netman/Makefile +++ b/service/matter-netman/Makefile @@ -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. @@ -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 @@ -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 @@ -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 \ @@ -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)) diff --git a/service/matter-netman/files/matter.init b/service/matter-netman/files/matter.init new file mode 100755 index 0000000..15fc406 --- /dev/null +++ b/service/matter-netman/files/matter.init @@ -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 +}