From f45d71162d702eda8ff5345ece29b2fc5b2a298e Mon Sep 17 00:00:00 2001 From: Bruce Cheung Date: Wed, 16 Sep 2026 10:02:17 +0800 Subject: [PATCH] mcumgr-cli: add package Add the MCU Manager command-line tool for communicating with and managing remote devices over serial, BLE, and UDP. Use the standard Go package build and install definitions. Override the generic runtime version check because the pinned upstream source hardcodes 0.0.0-dev in a struct initialized by main. Upstream: https://github.com/apache/mynewt-mcumgr-cli Signed-off-by: Bruce Cheung --- net/mcumgr-cli/Makefile | 46 ++++++++++++++++++++++++++++++++++ net/mcumgr-cli/test-version.sh | 15 +++++++++++ 2 files changed, 61 insertions(+) create mode 100644 net/mcumgr-cli/Makefile create mode 100644 net/mcumgr-cli/test-version.sh diff --git a/net/mcumgr-cli/Makefile b/net/mcumgr-cli/Makefile new file mode 100644 index 00000000000000..4cdea5ff573dab --- /dev/null +++ b/net/mcumgr-cli/Makefile @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2024 + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mcumgr-cli +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/apache/mynewt-mcumgr-cli.git +PKG_SOURCE_DATE:=2022-10-04 +PKG_SOURCE_VERSION:=5c56bd24066c780aad5836429bfa2ecc4f9a944c +PKG_MIRROR_HASH:=96bec5138e3eac2ba491349d9e6d0fbfcd6f735c273708e7ae286c908f78698f + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Bruce Cheung + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/apache/mynewt-mcumgr-cli +GO_PKG_BUILD_PKG:=github.com/apache/mynewt-mcumgr-cli/mcumgr + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/mcumgr-cli + SECTION:=net + CATEGORY:=Network + TITLE:=MCU Manager CLI + URL:=https://github.com/apache/mynewt-mcumgr-cli + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/mcumgr-cli/description + MCU Manager (mcumgr) is the application tool that enables a user + to communicate with and manage remote devices running an mcumgr server. + It supports firmware upgrades, file management, and device management + over various transports including serial, BLE, and UDP. +endef + +$(eval $(call GoBinPackage,mcumgr-cli)) +$(eval $(call BuildPackage,mcumgr-cli)) diff --git a/net/mcumgr-cli/test-version.sh b/net/mcumgr-cli/test-version.sh new file mode 100644 index 00000000000000..f801c9634e66ac --- /dev/null +++ b/net/mcumgr-cli/test-version.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# shellcheck shell=busybox + +case "$PKG_NAME" in +mcumgr-cli) + # Upstream hardcodes 0.0.0-dev in a struct initialized by main, so the + # package version cannot be injected with GO_PKG_LDFLAGS_X. + exit 0 + ;; +*) + echo "Untested package: $PKG_NAME" >&2 + exit 1 + ;; +esac