Skip to contentSkip to conversation

Add kernel compression selection.

PATCH New Sagaert Johan 2 participants 2 messages Apr 2, 2015 – Dec 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add kernel compression selection.

This selection will ensure that the correct host tools will be build used for the kernel compression method used.

---
V3->V4
Add selection menu in the kernel menu section. This ensures only things needed are build.
V2->V3
Unconditionally build lz4.
The building overhead is negligible.
V1->V2
Only add the host-lz4 dependency when ARM is selected. Don't touch host-lz4 package.

---
 linux/Config.in | 28 ++++++++++++++++++++++++++++
 linux/linux.mk  | 13 ++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
linux/Config.in +28 -0
index a1113dd..e5372cb 100644
@@ -247,6 +247,34 @@ config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
 
 endchoice
 
+#
+# Kernel compression format
+#
+
+choice
+	prompt "Kernel compression format"
+	help
+	  This selection will just ensure that the correct host tools are build.
+	  The actual compression for the kernel should be selected in the
+	  kernel configuration menu.
+
+config BR2_LINUX_KERNEL_GZIP
+	bool "gzip compression"
+	
+config BR2_LINUX_KERNEL_LZ4
+	bool "lz4 compression"
+	
+config BR2_LINUX_KERNEL_LZMA
+	bool "lzma compression"
+
+config BR2_LINUX_KERNEL_LZO
+	bool "lzo compression"
+	
+config BR2_LINUX_KERNEL_XZ
+	bool "xz compression"
+
+endchoice
+
 config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME
 	string "Kernel image target name"
 	depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
linux/linux.mk +12 -1
index 22fce35..67ea544 100644
@@ -49,7 +49,18 @@ LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))
 LINUX_PATCH = $(filter ftp://% http://% https://%,$(LINUX_PATCHES))
 
 LINUX_INSTALL_IMAGES = YES
-LINUX_DEPENDENCIES += host-kmod host-lzop
+LINUX_DEPENDENCIES += host-kmod
+
+# host tools needed for kernel compression
+ifeq ($(BR2_LINUX_KERNEL_LZ4),y)
+LINUX_DEPENDENCIES += host-lz4
+else ifeq ($(BR2_LINUX_KERNEL_LZMA),y)
+LINUX_DEPENDENCIES += host-lzma
+else ifeq ($(BR2_LINUX_KERNEL_LZO),y)
+LINUX_DEPENDENCIES += host-lzop
+else ifeq ($(BR2_LINUX_KERNEL_XZ),y)
+LINUX_DEPENDENCIES += host-xz
+endif
 
 ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y)
 LINUX_DEPENDENCIES += host-uboot-tools
Signature · 1 line
2.3.3
#1 lore raw

PATCH v4 1/1 Add kernel compression selection.

Johan, All,

Sorry for the slow response... :-/

On 2015-04-03 01:31 +0200, Sagaert Johan spake thusly:

Quoted 2 lines

This selection will ensure that the correct host tools will be build used for the kernel compression method used.

Yes, that is much better. Thanks! :-)

However, just a comment below...

Quoted 66 lines

---
V3->V4
Add selection menu in the kernel menu section. This ensures only things needed are build.
V2->V3
Unconditionally build lz4.
The building overhead is negligible.
V1->V2
Only add the host-lz4 dependency when ARM is selected. Don't touch host-lz4 package.

---
 linux/Config.in | 28 ++++++++++++++++++++++++++++
 linux/linux.mk  | 13 ++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
linux/Config.in +28 -0
index a1113dd..e5372cb 100644
@@ -247,6 +247,34 @@ config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
 
 endchoice
 
+#
+# Kernel compression format
+#
+
+choice
+	prompt "Kernel compression format"
+	help
+	  This selection will just ensure that the correct host tools are build.
+	  The actual compression for the kernel should be selected in the
+	  kernel configuration menu.
+
+config BR2_LINUX_KERNEL_GZIP
+	bool "gzip compression"
+	
+config BR2_LINUX_KERNEL_LZ4
+	bool "lz4 compression"
+	
+config BR2_LINUX_KERNEL_LZMA
+	bool "lzma compression"
+
+config BR2_LINUX_KERNEL_LZO
+	bool "lzo compression"
+	
+config BR2_LINUX_KERNEL_XZ
+	bool "xz compression"
+
+endchoice
+
 config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME
 	string "Kernel image target name"
 	depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
linux/linux.mk +2 -1
index 22fce35..67ea544 100644
@@ -49,7 +49,18 @@ LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))
 LINUX_PATCH = $(filter ftp://% http://% https://%,$(LINUX_PATCHES))
 
 LINUX_INSTALL_IMAGES = YES
-LINUX_DEPENDENCIES += host-kmod host-lzop
+LINUX_DEPENDENCIES += host-kmod
+

linux/linux.mk LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH)) · line 63

Quoted 10 lines
linux/linux.mk +10 -0
+# host tools needed for kernel compression
+ifeq ($(BR2_LINUX_KERNEL_LZ4),y)
+LINUX_DEPENDENCIES += host-lz4
+else ifeq ($(BR2_LINUX_KERNEL_LZMA),y)
+LINUX_DEPENDENCIES += host-lzma
+else ifeq ($(BR2_LINUX_KERNEL_LZO),y)
+LINUX_DEPENDENCIES += host-lzop
+else ifeq ($(BR2_LINUX_KERNEL_XZ),y)
+LINUX_DEPENDENCIES += host-xz
+endif

Shouldn't we also call something like:

    $(call KCONFIG_DISABLE_OPT,CONFIG_KERNEL_GZIP,$(@D)/.config))
    $(call KCONFIG_DISABLE_OPT,CONFIG_KERNEL_LZ4,$(@D)/.config))
    ... nad so on ...
    ifeq ($(BR2_LINUX_KERNEL_GZIP),y)
    LINUX_COMP_CONFIG = $(call KCONFIG_ENABLE_OPT,CONFIG_KERNEL_GZIP,$(@D)/.config))
    else ifeq ($(BR2_LINUX_KERNEL_LZ4),y)
    LINUX_DEPENDENCIES += host-lz4
    LINUX_COMP_CONFIG = $(call KCONFIG_ENABLE_OPT,CONFIG_KERNEL_LZ4,$(@D)/.config))
    else ifeq ($(BR2_LINUX_KERNEL_LZO),y)
    LINUX_DEPENDENCIES += host-lzop
    LINUX_COMP_CONFIG = $(call KCONFIG_ENABLE_OPT,CONFIG_KERNEL_LZO,$(@D)/.config))
    ... and so on ...

So that what the user jas selected in the Buildroot menuconfig gets actually applied to the Linux configuration, to avoid having to manually handle the coherence between the two?

But anmyway, your patch is an improvement against the current situation, so:

Regards,
Yann E. MORIN.

Quoted 9 lines
linux/linux.mk +0 -0
 ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y)
 LINUX_DEPENDENCIES += host-uboot-tools
Signature · 6 lines
2.3.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'