summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Sapkin2026-01-05 02:03:00 +0000
committerRobert Marko2026-01-12 13:28:52 +0000
commit2d844a077089575ab67fcbd15e021a981387e668 (patch)
treeffcdf63324a27be2a89a593eaf3ae0f4fb4ff3d0
parent8cc2743c4865607b67f9b4b2ecacb62e242abb20 (diff)
downloadopenwrt-2d844a077089575ab67fcbd15e021a981387e668.tar.gz
build: fix implicit self-provides
Fix setting implicit self-provides for packages when they don't have any PROVIDES specified. Remove redundant self-provide for kmods, since kmods are packages and will have a self-provide added already. Fixes: 5ed650a ("build: add support for virtual provides") Fixes: 9b37b71 ("build: provide virtual self in kmods") Signed-off-by: George Sapkin <george@sapk.in> Link: https://github.com/openwrt/openwrt/pull/21369 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--include/kernel.mk9
-rw-r--r--include/package-pack.mk7
-rw-r--r--include/package.mk2
3 files changed, 4 insertions, 14 deletions
diff --git a/include/kernel.mk b/include/kernel.mk
index 4f75033b45..abf2651330 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -219,15 +219,6 @@ define KernelPackage
$(call KernelPackage/$(1))
$(call KernelPackage/$(1)/$(BOARD))
$(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))
-
- # Add an implicit self-provide. apk can't handle self provides, be it
- # versioned or virtual, so opt for a prefix and a suffix instead. Package
- # name without a prefix/suffix is too generic and might conflict with other
- # packages, e.g. wireguard. This allows several variants to provide the same
- # virtual package without adding extra provides to the default one, e.g.
- # r8169 implicitly provides kmod-r8169-any and is marked as default, so
- # r8125 can explicitly provide @kmod-r8169-any as well.
- PROVIDES+=@kmod-$(1)-any
endef
ifdef KernelPackage/$(1)/conffiles
diff --git a/include/package-pack.mk b/include/package-pack.mk
index ee71c0367e..6a80d3d970 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -195,10 +195,9 @@ endef
# self. Filter it out, but keep virtual self provides, in the form of
# @(kmod-)?${package_name}-any.
#
-# - Packages implicitly add a virtual @${package_name}-any provide in Package.
-#
-# - kmods implicitly add a virtual @kmod-${package_name}-any provide in
-# KernelPackage.
+# - Packages implicitly add a virtual @${package_name}-any provide in Package,
+# which implies that kmods, which are also packages, will have a virtual
+# @kmod-${package_name}-any provide.
#
# - Aside from the two aforementioned implicit provides, packages are expected
# to manage their provides themselves.
diff --git a/include/package.mk b/include/package.mk
index 087e374ea9..a8278d0672 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -337,7 +337,7 @@ define BuildPackage
# variants to provide the same virtual package without adding extra provides
# to the default one, e.g. wget implicitly provides wget-any and is marked as
# default, so wget-ssl can explicitly provide @wget-any as well.
- PROVIDES+=@$(1)-any
+ $(eval PROVIDES:=$(strip @$(1)-any $(PROVIDES)))
ifdef DESCRIPTION
$$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)