Skip to contentSkip to conversation

linux.mk: change linux tarball compression to xz

PATCH Superseded Jerzy Grzegorek 3 participants 4 messages May 10, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux.mk: change linux tarball compression to xz

After selecting BR2_LINUX_KERNEL or BR2_LINUX_KERNEL_CUSTOM_VERSION configuration item, if any of linux tarball linux-$(LINUX_VERSION).tar.xx in local download tarball directory $(BR2_DL_DIR) exists, it used should be, otherwise *we* set the compression of linux tarball to download to xz.

---
 linux/linux.mk |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
linux/linux.mk +9 -1
index 8a73767..fba9d44 100644
@@ -3,6 +3,7 @@
 # Linux kernel target
 #
 ###############################################################################
+
 LINUX_VERSION=$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
 LINUX_LICENSE = GPLv2
 LINUX_LICENSE_FILES = COPYING
@@ -15,8 +16,15 @@ LINUX_SOURCE = $(notdir $(LINUX_TARBALL))
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL))
 LINUX_SITE_METHOD = git
-else
+# If any of linux tarball locally exists it used should be
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.xz),)
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.bz2),)
 LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.gz),)
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.gz
+else
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
 # 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.
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 linux.mk: change linux tarball compression to xz

Dear Jerzy Grzegorek,

Review

Quoted 12 lines · Jerzy Grzegorek
(quoted diff) +8 -0
+# If any of linux tarball locally exists it used should be
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.xz),)
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.bz2),)
 LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
+else ifneq ($(wildcard $(call qstrip,$(BR2_DL_DIR))/linux-$(LINUX_VERSION).tar.gz),)
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.gz
+else
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
 # 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.

Unfortunately, this doesn't work. First $(BR2_DL_DIR) is not the good variable, as it doesn't take into account the fact that it can be overridden by the BUILDROOT_DL_DIR environment variable.

Also, I believe this is a kind of "layering" violation. Packages should not be directly poking into the Buildroot download directory. Managing the Buildroot directory is the business of package/pkg-download.mk.

So either we decide that we use .tar.xz tarballs (which I think we could do for all kernels >= 3.0), or we need to improve the package infrastructure to support a list of possible files to download in <pkg>_SOURCE, so that we can list the .xz and .bz2.

But for the case of Linux, I believe the easiest way is probably:

linux/linux.mk +2 -1
index d375cf0..3611a6d 100644
@@ -16,14 +16,15 @@ else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL))
 LINUX_SITE_METHOD = git
 else
-LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
 # 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.
 ifeq ($(findstring x2.6.,x$(LINUX_VERSION)),x2.6.)
 LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
 else
 LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v3.x/
+LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
 endif
 # release candidates are in testing/ subdir
 ifneq ($(findstring -rc,$(LINUX_VERSION)),)

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 linux.mk: change linux tarball compression to xz

In reply to Jerzy Grzegorek

Hi:

Quoted 4 lines · Jerzy Grzegorek

After selecting BR2_LINUX_KERNEL or BR2_LINUX_KERNEL_CUSTOM_VERSION configuration item, if any of linux tarball linux-$(LINUX_VERSION).tar.xx in local download tarball directory $(BR2_DL_DIR) exists, it used should be, otherwise *we* set the compression of linux tarball to download to xz.

What about the one I'm attaching?

Regards,

Signature · 8 lines
Ra?l S?nchez Siles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Choose-xz-compressed-tarball-for-linux-kernel.patch
Type: text/x-diff
Size: 1517 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130510/83639513/attachment.bin>
#3 lore raw

PATCH 1/1 linux.mk: change linux tarball compression to xz

Dear Ra?l S?nchez Siles,

Quoted 7 lines · Ra?l S?nchez Siles
Quoted 4 lines · Jerzy Grzegorek

After selecting BR2_LINUX_KERNEL or BR2_LINUX_KERNEL_CUSTOM_VERSION configuration item, if any of linux tarball linux-$(LINUX_VERSION).tar.xx in local download tarball directory $(BR2_DL_DIR) exists, it used should be, otherwise *we* set the compression of linux tarball to download to xz.

What about the one I'm attaching?

This one works if we're sure that all the 3.x and 2.6 versions of the Linux kernel, as hosted on kernel.org, are available as .xz.

Looking at https://www.kernel.org/pub/linux/kernel/v2.6/ and
https://www.kernel.org/pub/linux/kernel/v3.x/ it indeed seems to be the case, so looks like your patch should be go to go.

Could you resend your patch inline, with 'git send-email', so that it can be reviewed and Acked-by other developers, and hopefully applied?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com