kernel-version.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Use the default kernel version if the Makefile doesn't override it
  2. LINUX_RELEASE?=1
  3. ifdef CONFIG_TESTING_KERNEL
  4. KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
  5. endif
  6. LINUX_VERSION-4.14 = .334
  7. LIBRE_REV = 1
  8. LINUX_KERNEL_HASH-4.14.334 = 8665c68f0496165783d3c1e4176ad42838ba194de0ae25d548bcf9379b250177
  9. remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
  10. sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
  11. ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
  12. LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
  13. ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
  14. CONFIG_KERNEL_GIT_REF:=HEAD
  15. endif
  16. LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
  17. else
  18. ifdef KERNEL_PATCHVER
  19. LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
  20. endif
  21. ifdef KERNEL_TESTING_PATCHVER
  22. LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
  23. endif
  24. endif
  25. split_version=$(subst ., ,$(1))
  26. merge_version=$(subst $(space),.,$(1))
  27. KERNEL_BASE=$(firstword $(subst -, ,$(LINUX_VERSION)))
  28. KERNEL=$(call merge_version,$(wordlist 1,2,$(call split_version,$(KERNEL_BASE))))
  29. KERNEL_PATCHVER ?= $(KERNEL)
  30. # disable the md5sum check for unknown kernel versions
  31. LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))
  32. LINUX_KERNEL_HASH?=x