kernel: bump to 4.14.216
[librecmc/librecmc.git] / include / kernel-version.mk
1 # Use the default kernel version if the Makefile doesn't override it
2
3 LINUX_RELEASE?=1
4
5 ifdef CONFIG_TESTING_KERNEL
6   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
7 endif
8
9 LINUX_VERSION-4.14 = .216
10
11
12 LINUX_KERNEL_HASH-4.14.216 = 1a049dc70962adea4a74f618f464b9aceb80127309a251b56dad39563682aa07
13
14 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
15 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
16
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
21   endif
22   LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
23 else
24 ifdef KERNEL_PATCHVER
25   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
26 endif
27 ifdef KERNEL_TESTING_PATCHVER
28   LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
29 endif
30 endif
31
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)
37
38 # disable the md5sum check for unknown kernel versions
39 LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))
40 LINUX_KERNEL_HASH?=x