Skip to content

mcumgr-cli: add package - #30550

Open
brucerry wants to merge 1 commit into
openwrt:masterfrom
brucerry:mcumgr-cli
Open

brucerry wants to merge 1 commit into
openwrt:masterfrom
brucerry:mcumgr-cli

Conversation

@brucerry

@brucerry brucerry commented Sep 17, 2026

Copy link
Copy Markdown

Maintainer:

@apache

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.


🧪 Run Testing Details

  • OpenWrt Version: 23.05, 24.10
  • OpenWrt Target/Subtarget: Qualcomm platform
  • OpenWrt Device: Not supported as open source

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

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.

Signed-off-by: Bruce Cheung <bruce.cheung@emplustech.com>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread net/mcumgr-cli/Makefile

PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new package must name a real maintainer as Name <email>; this is empty, and the @apache in the PR body is the upstream org, not someone who maintains the package in this feed.

Suggested change
PKG_MAINTAINER:=
PKG_MAINTAINER:=Bruce Cheung <bruce.cheung@emplustech.com>

Generated by Claude Code

Comment thread net/mcumgr-cli/Makefile
Comment on lines +8 to +13
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/apache/mynewt-mcumgr-cli.git
PKG_SOURCE_VERSION:=5c56bd24066c780aad5836429bfa2ecc4f9a944c

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0.0 matches nothing upstream — apache/mynewt-mcumgr-cli has no tags and no releases (git ls-remote --tags is empty), and 5c56bd2 is simply current master, committed 2022-10-04. For an untagged git source, set PKG_SOURCE_DATE and let download.mk derive PKG_VERSION (here: 2022.10.04~5c56bd24). PKG_MIRROR_HASH has to be regenerated afterwards, since the mirror tarball name contains the version.

Suggested change
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/apache/mynewt-mcumgr-cli.git
PKG_SOURCE_VERSION:=5c56bd24066c780aad5836429bfa2ecc4f9a944c
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

Generated by Claude Code

Comment thread net/mcumgr-cli/Makefile
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=

PKG_BUILD_DIR:=$(BUILD_DIR)/mcumgr-cli-$(PKG_VERSION)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical to the default in include/package.mk:11, so it can go. It is also :=-expanded here, before package.mk is included, so it would expand to .../mcumgr-cli- and break the build once PKG_VERSION is derived from PKG_SOURCE_DATE.

Suggested change
PKG_BUILD_DIR:=$(BUILD_DIR)/mcumgr-cli-$(PKG_VERSION)

Generated by Claude Code

Comment thread net/mcumgr-cli/Makefile
Comment on lines +46 to +52
define Package/mcumgr-cli/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))

$(INSTALL_DIR) $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mcumgr $(1)/usr/bin/
endef

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GoPackage/Package/Install/Bin takes the package install root, so passing $(PKG_INSTALL_DIR) drops the binary in the build dir and forces the $(CP) to fetch it back out. Defining this block also makes the GoBinPackage call below a no-op (it is ifndef-guarded); drop the block and let GoBinPackage provide the recipe, as e.g. net/dnslookup does.

Suggested change
define Package/mcumgr-cli/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mcumgr $(1)/usr/bin/
endef

Generated by Claude Code

Comment thread net/mcumgr-cli/Makefile
endef

$(eval $(call GoBinPackage,mcumgr-cli))
$(eval $(call BuildPackage,mcumgr-cli))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic CI runtime check runs the installed binary and expects PKG_VERSION in its output, but mcumgr reports the hardcoded VersionString: "0.0.0-dev", and GO_PKG_LDFLAGS_X cannot patch it since it is a struct field assigned in main, not a package-level string var. Add a test-version.sh in net/mcumgr-cli/ to override that check.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants