[openwrt/openwrt] build: provide virtual self in kmods
LEDE Commits
lede-commits at lists.infradead.org
Fri Jan 2 09:11:10 PST 2026
robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d1b08c2d82a86f1958137b22fc6ec0991ee9df9c
commit d1b08c2d82a86f1958137b22fc6ec0991ee9df9c
Author: George Sapkin <george at sapk.in>
AuthorDate: Sun Dec 28 17:22:41 2025 +0200
build: provide virtual self in kmods
Add an implicit self-provide to kmods. 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.
Signed-off-by: George Sapkin <george at sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
(cherry picked from commit 9b37b7185c18855f4e017ac573701cdcd92fbcd1)
Link: https://github.com/openwrt/openwrt/pull/21355
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
include/kernel.mk | 10 +++++++++-
include/package-pack.mk | 5 ++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/kernel.mk b/include/kernel.mk
index 6ef766388a..dc9bedd9ad 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -219,6 +219,15 @@ 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
@@ -306,4 +315,3 @@ kernel_patchver_ge=$(call kernel_version_cmp,-ge,$(KERNEL_PATCHVER),$(1))
kernel_patchver_eq=$(call kernel_version_cmp,-eq,$(KERNEL_PATCHVER),$(1))
kernel_patchver_le=$(call kernel_version_cmp,-le,$(KERNEL_PATCHVER),$(1))
kernel_patchver_lt=$(call kernel_version_cmp,-lt,$(KERNEL_PATCHVER),$(1))
-
diff --git a/include/package-pack.mk b/include/package-pack.mk
index 853832d90f..15c06fab0b 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -134,10 +134,13 @@ endef
#
# - apk doesn't like it when packages specify a redundant provide pointing to
# self. Filter it out, but keep virtual self provides, in the form of
-# @${package_name}-any.
+# @(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.
+#
# 1: package name
# 2: package version
# 3: list of provides
More information about the lede-commits
mailing list