[Buildroot] [git commit] package/cni-plugin: simplify installation

Romain Naour romain.naour at smile.fr
Wed Sep 10 11:08:56 UTC 2025


commit: https://git.buildroot.net/buildroot/commit/?id=cfdd4ed4e3e2776199897cb0080751956dc5ec4d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

In all theory, we could iterate over CNI_PLUGINS_INSTALL_BINS, which
already contains the basenames $(notdir) of the binaries to install,
but *_INSTALL_BINS is now an internal implementation detail, and
can't be guaranteed to be stable.

Hence, iterate over the list of targets, and somewhat duplicate the
install commands from the infra, using make's $(notdir) rather than
calling to the shell's to call basename.

Note: we need to stop setting _INSTALL_BINS, as a following commit will
check that it is not explicitly set, and fail otherwise.

Signed-off-by: Yann E. MORIN <yann.morin at orange.com>
Cc: Christian Stewart <christian at aperture.us>
Reviewed-by: Romain Naour <romain.naour at smile.fr>
Signed-off-by: Romain Naour <romain.naour at smile.fr>
---
 package/cni-plugins/cni-plugins.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/cni-plugins/cni-plugins.mk b/package/cni-plugins/cni-plugins.mk
index d682053e75..85783e433f 100644
--- a/package/cni-plugins/cni-plugins.mk
+++ b/package/cni-plugins/cni-plugins.mk
@@ -28,7 +28,6 @@ CNI_PLUGINS_BUILD_TARGETS = \
 	plugins/meta/sbr \
 	plugins/meta/tuning \
 	plugins/meta/vrf
-CNI_PLUGINS_INSTALL_BINS = $(CNI_PLUGINS_BUILD_TARGETS)
 
 ifeq ($(BR2_PACKAGE_LIBAPPARMOR),y)
 CNI_PLUGINS_DEPENDENCIES += libapparmor
@@ -47,9 +46,9 @@ endif
 
 define CNI_PLUGINS_INSTALL_TARGET_CMDS
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/opt/cni/bin
-	$(foreach d,$(CNI_PLUGINS_INSTALL_BINS),\
-		$(INSTALL) -D -m 0755 $(@D)/bin/$$(basename $(d)) \
-			$(TARGET_DIR)/opt/cni/bin
+	$(foreach d,$(CNI_PLUGINS_BUILD_TARGETS),\
+		$(INSTALL) -D -m 0755 $(@D)/bin/$(notdir $(d)) \
+			$(TARGET_DIR)/opt/cni/bin/$(notdir $(d))
 	)
 endef
 


More information about the buildroot mailing list