kernel-version.mk 1.62 KB
Newer Older
1
2
# Use the default kernel version if the Makefile doesn't override it

3
4
LINUX_RELEASE?=1

5
6
7
8
ifdef CONFIG_TESTING_KERNEL
  KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif

9
LINUX_VERSION-4.14 = .176
10
LINUX_VERSION-4.19 = .115
Petr Štetiar's avatar
Petr Štetiar committed
11
LINUX_VERSION-5.4 = .34
12

13
LINUX_KERNEL_HASH-4.14.176 = bcae0956baaeb55dab5bad0401873fbc5baaa7fbe957ea6d27a5ab241cec5ca2
14
LINUX_KERNEL_HASH-4.19.115 = 11b2d97c8ea5ceb40c5e1d0bb87ad5b2b8c84560181bc60c0d28ec3a3e3801c2
Petr Štetiar's avatar
Petr Štetiar committed
15
LINUX_KERNEL_HASH-5.4.34 = 903ec1334daba6a626688f799cc947b420cf6fc8ce83055313dc4e9978d64cd2
16

17
18
19
20
21
22
23
24
25
26
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
  LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
  ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
    CONFIG_KERNEL_GIT_REF:=HEAD
  endif
  LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
else
27
28
29
ifdef KERNEL_PATCHVER
  LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
endif
30
31
32
ifdef KERNEL_TESTING_PATCHVER
  LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
endif
33
endif
34

35
36
split_version=$(subst ., ,$(1))
merge_version=$(subst $(space),.,$(1))
37
38
KERNEL_BASE=$(firstword $(subst -, ,$(LINUX_VERSION)))
KERNEL=$(call merge_version,$(wordlist 1,2,$(call split_version,$(KERNEL_BASE))))
39
KERNEL_PATCHVER ?= $(KERNEL)
40

41
# disable the md5sum check for unknown kernel versions
42
43
LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))
LINUX_KERNEL_HASH?=x