1 # Use the default kernel version if the Makefile doesn't override it
5 ifdef CONFIG_TESTING_KERNEL
6 KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
9 LINUX_VERSION-4.14 = .134
11 LINUX_KERNEL_HASH-4.14.134 = 0b21e7b5effd92303a551b5be2380c9703d6fb87cfe5189fe0d795cc73903d2d
13 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
14 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
16 ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
17 LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
18 ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
19 CONFIG_KERNEL_GIT_REF:=HEAD
21 LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
24 LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
26 ifdef KERNEL_TESTING_PATCHVER
27 LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
31 split_version=$(subst ., ,$(1))
32 merge_version=$(subst $(space),.,$(1))
33 KERNEL_BASE=$(firstword $(subst -, ,$(LINUX_VERSION)))
34 KERNEL=$(call merge_version,$(wordlist 1,2,$(call split_version,$(KERNEL_BASE))))
35 KERNEL_PATCHVER ?= $(KERNEL)
37 # disable the md5sum check for unknown kernel versions
38 LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))