Skip to content

Commit 9b37b71

Browse files
GeorgeSapkinrobimarko
authored andcommitted
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 <[email protected]> Link: openwrt/openwrt#21288 Signed-off-by: Robert Marko <[email protected]>
1 parent 5ed650a commit 9b37b71

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

include/kernel.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,15 @@ define KernelPackage
219219
$(call KernelPackage/$(1))
220220
$(call KernelPackage/$(1)/$(BOARD))
221221
$(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))
222+
223+
# Add an implicit self-provide. apk can't handle self provides, be it
224+
# versioned or virtual, so opt for a prefix and a suffix instead. Package
225+
# name without a prefix/suffix is too generic and might conflict with other
226+
# packages, e.g. wireguard. This allows several variants to provide the same
227+
# virtual package without adding extra provides to the default one, e.g.
228+
# r8169 implicitly provides kmod-r8169-any and is marked as default, so
229+
# r8125 can explicitly provide @kmod-r8169-any as well.
230+
PROVIDES+=@kmod-$(1)-any
222231
endef
223232

224233
ifdef KernelPackage/$(1)/conffiles
@@ -306,4 +315,3 @@ kernel_patchver_ge=$(call kernel_version_cmp,-ge,$(KERNEL_PATCHVER),$(1))
306315
kernel_patchver_eq=$(call kernel_version_cmp,-eq,$(KERNEL_PATCHVER),$(1))
307316
kernel_patchver_le=$(call kernel_version_cmp,-le,$(KERNEL_PATCHVER),$(1))
308317
kernel_patchver_lt=$(call kernel_version_cmp,-lt,$(KERNEL_PATCHVER),$(1))
309-

include/package-pack.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,13 @@ endef
134134
#
135135
# - apk doesn't like it when packages specify a redundant provide pointing to
136136
# self. Filter it out, but keep virtual self provides, in the form of
137-
# @${package_name}-any.
137+
# @(kmod-)?${package_name}-any.
138138
#
139139
# - Packages implicitly add a virtual @${package_name}-any provide in Package.
140140
#
141+
# - kmods implicitly add a virtual @kmod-${package_name}-any provide in
142+
# KernelPackage.
143+
#
141144
# 1: package name
142145
# 2: package version
143146
# 3: list of provides

0 commit comments

Comments
 (0)