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 = .216
12 LINUX_KERNEL_HASH-4.14.216 = 1a049dc70962adea4a74f618f464b9aceb80127309a251b56dad39563682aa07
14 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
15 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
17 ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
18 LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
19 ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
20 CONFIG_KERNEL_GIT_REF:=HEAD
22 LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
25 LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
27 ifdef KERNEL_TESTING_PATCHVER
28 LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
32 split_version=$(subst ., ,$(1))
33 merge_version=$(subst $(space),.,$(1))
34 KERNEL_BASE=$(firstword $(subst -, ,$(LINUX_VERSION)))
35 KERNEL=$(call merge_version,$(wordlist 1,2,$(call split_version,$(KERNEL_BASE))))
36 KERNEL_PATCHVER ?= $(KERNEL)
38 # disable the md5sum check for unknown kernel versions
39 LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))