Skip to content

Commit d34cef8

Browse files
plappermaulrobimarko
authored andcommitted
build: avoid errors during release candidate kernel packaging
The build system allows to use Linux release candidate kernels (-rcX). For this a target/linux/generic/kernel-6.XY as follows is needed: LINUX_VERSION-6.XY = -rc1 LINUX_KERNEL_HASH-6.XY-rc1 = 18ba6ebd72f46b881e0d73e390b2888b7b43... Sadly the builds fail with a packaging error. fakeroot /home/openwrt/openwrt/openwrt/staging_dir/host/bin/apk mkpkg --info "name:kernel" --info "version:6.15-rc1~c4bf...1f6-r1" ERROR: info field 'version' has invalid value: package version is invalid The apk metadata specification reads: "... Currently the APK version specification is as follows: number{.number}...{letter}{_suffix{number}}...{~hash}{-r#} ... Optionally one or more _suffix{number} components can follow. The list of valid suffixes (and their sorting order) is: alpha, beta, pre, rc, <no suffix>, cvs, svn, git, hg, p." Given that the kernel uses "-rcX" naming scheme and apk requires "_rcX" instead, simply translate the dash to an underscore for these builds. Signed-off-by: Markus Stockhausen <[email protected]> Link: openwrt/openwrt#21214 Signed-off-by: Robert Marko <[email protected]>
1 parent caef0a8 commit d34cef8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/kernel.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ define KernelPackage
213213
SECTION:=kernel
214214
CATEGORY:=Kernel modules
215215
DESCRIPTION:=$(DESCRIPTION)
216-
EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
217-
VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
216+
EXTRA_DEPENDS:=kernel (=$(subst -rc,_rc,$(LINUX_VERSION))~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
217+
VERSION:=$(subst -rc,_rc,$(LINUX_VERSION))$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
218218
PKGFLAGS:=$(PKGFLAGS)
219219
$(call KernelPackage/$(1))
220220
$(call KernelPackage/$(1)/$(BOARD))

package/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ifneq ($(CONFIG_USE_APK),)
105105
$$(cat $(TMP_DIR)/apk_install_list) \
106106
"base-files=$(shell cat $(TMP_DIR)/base-files.version)" \
107107
"libc=$(shell cat $(TMP_DIR)/libc.version)" \
108-
"kernel=$(shell cat $(TMP_DIR)/kernel.version)"
108+
"kernel=$(subst -rc,_rc,$(shell cat $(TMP_DIR)/kernel.version))"
109109

110110
rm -rf $(TARGET_DIR)/run
111111
else

package/kernel/linux/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ define Package/kernel
5353
CATEGORY:=Kernel
5454
DEFAULT:=y
5555
TITLE:=Virtual kernel package
56-
VERSION:=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE)
56+
VERSION:=$(subst -rc,_rc,$(LINUX_VERSION))~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE)
5757
URL:=http://www.kernel.org/
5858
PKG_FLAGS:=nonshared
5959
endef

0 commit comments

Comments
 (0)