2 # Use the default kernel version if the Makefile doesn't override it
5 ifdef CONFIG_TESTING_KERNEL
6 KERNEL_PATCHVER
:=$(KERNEL_TESTING_PATCHVER
)
9 KERNEL_DETAILS_FILE
=$(INCLUDE_DIR
)/kernel-
$(KERNEL_PATCHVER
)
10 ifeq ($(wildcard $(KERNEL_DETAILS_FILE
)),)
11 $(error Missing kernel version
/hash file for
$(KERNEL_PATCHVER
). Please create
$(KERNEL_DETAILS_FILE
))
14 include $(KERNEL_DETAILS_FILE
)
16 remove_uri_prefix
=$(subst git
://,,$(subst http
://,,$(subst https
://,,$(1))))
17 sanitize_uri
=$(call qstrip
,$(subst @
,_
,$(subst :,_
,$(subst .
,_
,$(subst -,_
,$(subst /,_
,$(1)))))))
19 ifneq ($(call qstrip
,$(CONFIG_KERNEL_GIT_CLONE_URI
)),)
20 LINUX_VERSION
:=$(call sanitize_uri
,$(call remove_uri_prefix
,$(CONFIG_KERNEL_GIT_CLONE_URI
)))
21 ifeq ($(call qstrip
,$(CONFIG_KERNEL_GIT_REF
)),)
22 CONFIG_KERNEL_GIT_REF
:=HEAD
24 LINUX_VERSION
:=$(LINUX_VERSION
)-$(call sanitize_uri
,$(CONFIG_KERNEL_GIT_REF
))
27 LINUX_VERSION
:=$(KERNEL_PATCHVER
)$(strip $(LINUX_VERSION-
$(KERNEL_PATCHVER
)))
29 ifdef KERNEL_TESTING_PATCHVER
30 LINUX_TESTING_VERSION
:=$(KERNEL_TESTING_PATCHVER
)$(strip $(LINUX_VERSION-
$(KERNEL_TESTING_PATCHVER
)))
34 split_version
=$(subst .
, ,$(1))
35 merge_version
=$(subst $(space
),.
,$(1))
36 KERNEL_BASE
=$(firstword $(subst -, ,$(LINUX_VERSION
)))
37 KERNEL
=$(call merge_version
,$(wordlist
1,2,$(call split_version
,$(KERNEL_BASE
))))
38 KERNEL_PATCHVER ?
= $(KERNEL
)
40 # disable the md5sum check for unknown kernel versions
41 LINUX_KERNEL_HASH
:=$(LINUX_KERNEL_HASH-
$(strip $(LINUX_VERSION
)))