From patchwork Sun Jul 12 11:34:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Hadjinlian X-Patchwork-Id: 494101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id A154C1402D8 for ; Sun, 12 Jul 2015 21:34:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=y7Hg1pYB; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C24C133202; Sun, 12 Jul 2015 11:34:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fcEdBBXwTJiJ; Sun, 12 Jul 2015 11:34:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7BCB03317B; Sun, 12 Jul 2015 11:34:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B36131C2209 for ; Sun, 12 Jul 2015 11:34:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id ADFAE86A1A for ; Sun, 12 Jul 2015 11:34:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DwMc6gpICUoW for ; Sun, 12 Jul 2015 11:34:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 7DAEE86961 for ; Sun, 12 Jul 2015 11:34:19 +0000 (UTC) Received: by widjy10 with SMTP id jy10so46839493wid.1 for ; Sun, 12 Jul 2015 04:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=bXAPY7To7fmsZpMnuxVVRk+1Weu5WO2RKQgXWZXRq2M=; b=y7Hg1pYBKXOb9VelumnEzXsNKqA4Fs3M1HLBFsjXL1tpHxvgAFzV/h76rS28Cc7HaB UjFWZBt8rMQ6uspPqNoanalwVMeKbtl8BlAXGeEo9xsLBaf/Y+zfP68aDJK68MDtVltZ sPB6QI7Sb5KC9ImfVkvUARt0HKQ4mFAg9nC33L3NcTMiqfjVA8TkQ3MVkgWN09JrsxUa gB8wbf496CUTfHkzy5NTcTsfZLlhGdl4IIJjSDlQB+h+ok4bzsfnZiB51dvyq8oqNSCr wkaXwhUVd/yK+XKb4Z1EtVAPi3Jb0wN8IUyK0Fd5cnVB5z6CqEyQfJsNrfuxCzyMoLMY wfDQ== X-Received: by 10.194.52.37 with SMTP id q5mr61590771wjo.122.1436700858243; Sun, 12 Jul 2015 04:34:18 -0700 (PDT) Received: from cerise.home (AToulouse-657-1-1031-128.w92-134.abo.wanadoo.fr. [92.134.9.128]) by smtp.gmail.com with ESMTPSA id uc16sm8330035wib.8.2015.07.12.04.34.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Jul 2015 04:34:17 -0700 (PDT) From: Maxime Hadjinlian To: buildroot@buildroot.org Date: Sun, 12 Jul 2015 13:34:13 +0200 Message-Id: <1436700853-25163-1-git-send-email-maxime.hadjinlian@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: Johan Sagaert Subject: [Buildroot] [PATCH] Add kernel compression selection. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Johan Sagaert This selection will ensure that the correct host tools will be build used for the kernel compression method used. [Maxime: Select the compression opts in the kernel config too ] Signed-off-by: Sagaert Johan Signed-off-by: Maxime Hadjinlian Reviewed-by: "Yann E. MORIN" --- 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 | 27 ++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/linux/Config.in b/linux/Config.in index 8c86a1a..73ae0b9 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -254,6 +254,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 diff --git a/linux/linux.mk b/linux/linux.mk index eca1450..c710355 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -56,7 +56,27 @@ 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 +LINUX_COMPRESSION_OPTS = CONFIG_KERNEL_LZ4 +else ifeq ($(BR2_LINUX_KERNEL_LZMA),y) +LINUX_DEPENDENCIES += host-lzma +LINUX_COMPRESSION_OPTS = CONFIG_KERNEL_LZMA +else ifeq ($(BR2_LINUX_KERNEL_LZO),y) +LINUX_DEPENDENCIES += host-lzop +LINUX_COMPRESSION_OPTS = CONFIG_KERNEL_LZO +else ifeq ($(BR2_LINUX_KERNEL_XZ),y) +LINUX_DEPENDENCIES += host-xz +LINUX_COMPRESSION_OPTS = CONFIG_KERNEL_XZ +endif +LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_GZIP) = CONFIG_KERNEL_GZIP +LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZ4) = CONFIG_KERNEL_LZ4 +LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZMA) = CONFIG_KERNEL_LZMA +LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZO) = CONFIG_KERNEL_LZO +LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_XZ) = CONFIG_KERNEL_XZ ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y) LINUX_DEPENDENCIES += host-uboot-tools @@ -187,6 +207,11 @@ LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS) define LINUX_KCONFIG_FIXUP_CMDS + $(call KCONFIG_ENABLE_OPT,$(LINUX_COMPRESSION_OPT_y),$(@D)/.config) + $(foreach opt, $(LINUX_COMPRESSION_OPT_), + $(call KCONFIG_DISABLE_OPT,$(opt),$(@D)/.config) + ) + $(if $(BR2_arm)$(BR2_armeb), $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config)) $(if $(BR2_TARGET_ROOTFS_CPIO),