aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel-version.mk
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2018-01-15 16:50:38 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-01-27 16:46:45 +0100
commit953bf6b43d50492a96a9bac692f4d99dd804b31f (patch)
tree37eadd117ec5b86ebaec7c25e0f0aa3eb5b1b33b /include/kernel-version.mk
parentab6a96f3f52320f834e7e4a12ec411d77bab7686 (diff)
downloadupstream-953bf6b43d50492a96a9bac692f4d99dd804b31f.tar.gz
upstream-953bf6b43d50492a96a9bac692f4d99dd804b31f.tar.bz2
upstream-953bf6b43d50492a96a9bac692f4d99dd804b31f.zip
kernel.mk: update LINUX_VERSION filename for cloned repo
In case there is an external git repo specified, it could overwrite the kernel tarball that was downloaded from kernel.org. The only identifier for such a file is the KERNEL_GIT_CLONE_URI & KERNEL_GIT_REF symbols, so if we have to download it we'll use that information [after some sanitization] to create a different filename for the kernel tarball. If KERNEL_GIT_REF symbol is empty, HEAD will be used as mentioned in the description of KERNEL_GIT_REF. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'include/kernel-version.mk')
-rw-r--r--include/kernel-version.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 6103cee63a..05b7a0d9c6 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -12,9 +12,20 @@ LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9
LINUX_KERNEL_HASH-4.9.77 = 7c29bc3fb96f1e23d98f664e786dddd53a1599f56431b9b7fdfba402a4b3705c
LINUX_KERNEL_HASH-4.14.14 = 8b96362eb55ae152555980e7193fe2585b487176fb936cc69b8947d7dd32044a
+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
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
endif
+endif
split_version=$(subst ., ,$(1))
merge_version=$(subst $(space),.,$(1))