瀏覽代碼

linux: add support for 3.x and -rc versions

The assumption that all kernels are in
http://www.kernel.org/pub/linux/kernel/v2.6/ is no longer true:
versions 3.x are in separate directories.

We now compute the directory name from the major and minor versions of
the version provided by the user. This assumes that the 3.1 version
will be in a /v3.1/ directory, which we don't know yet because the 3.1
cycle hasn't started yet.

At the same time, we add support for the official -rcX versions.

Patch tested by compiling 3.0-rc6, which Buildroot has successfully
downloaded and built.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Thomas Petazzoni 14 年之前
父節點
當前提交
f45f775b4f
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      linux/linux.mk

+ 10 - 1
linux/linux.mk

@@ -15,7 +15,16 @@ LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL))
 LINUX_SITE_METHOD = git
 else
 LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
-LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
+# In X.Y.Z, get X and Y. We replace dots and dashes by spaces in order
+# to use the $(word) function. We support versions such as 3.1,
+# 2.6.32, 2.6.32-rc1, 3.0-rc6, etc.
+LINUX_VERSION_MAJOR = $(word 1,$(subst ., ,$(subst -, ,$(LINUX_VERSION))))
+LINUX_VERSION_MINOR = $(word 2,$(subst ., ,$(subst -, ,$(LINUX_VERSION))))
+LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v$(LINUX_VERSION_MAJOR).$(LINUX_VERSION_MINOR)/
+# release candidates are in testing/ subdir
+ifneq ($(findstring -rc,$(LINUX_VERSION)),)
+LINUX_SITE = $(LINUX_SITE)testing/
+endif # -rc
 endif
 
 LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))