From patchwork Thu Sep 24 12:22:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1370654 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BxvM50rshz9sTN for ; Thu, 24 Sep 2020 22:22:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1E8332E115; Thu, 24 Sep 2020 12:22:37 +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 w22AnXMbrK7z; Thu, 24 Sep 2020 12:22:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7689327E4C; Thu, 24 Sep 2020 12:22:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9C6C21BF573 for ; Thu, 24 Sep 2020 12:22:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 83E4527E4C for ; Thu, 24 Sep 2020 12:22:29 +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 cG3niR8Lxsqz for ; Thu, 24 Sep 2020 12:22:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by silver.osuosl.org (Postfix) with ESMTPS id 097A220453 for ; Thu, 24 Sep 2020 12:22:26 +0000 (UTC) Received: from localhost (lfbn-tou-1-420-199.w86-206.abo.wanadoo.fr [86.206.245.199]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 735B224000D; Thu, 24 Sep 2020 12:22:23 +0000 (UTC) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Thu, 24 Sep 2020 14:22:20 +0200 Message-Id: <20200924122222.3449188-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] linux: show compression options only on some architectures X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Our Linux kernel compression options have the effect of enabling CONFIG_KERNEL_{GZIP,LZMA,LZ4,...}. However, those configuration options only exist on a subset of the CPU architectures, and it is confusing to have such a choice visible when it in fact has no effect. For example on ARM64, it has absolutely no effect, and the way to create a compressed image is different, and the image is not self-extractible. So, we introduce a BR2_LINUX_KERNEL_ARCH_HAS_COMPRESSION to know which architectures have compression support. Of course, it's never going to be perfect as the set of architectures supporting compression might change over time. But at least, it will allow us to hide this option on architectures that do not at this point support compression. Signed-off-by: Thomas Petazzoni --- linux/Config.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index 49da2b81b2..9f2af6da5b 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -299,6 +299,22 @@ endchoice # Kernel compression format # +# Indicates whether this architecture has support for built-in kernel +# compression, i.e architectures that select one of +# HAVE_KERNEL_{GZIP,LZMA,LZ4,LZO,XZ,UNCOMPRESSED} +config BR2_LINUX_KERNEL_ARCH_HAS_COMPRESSION + bool + default y if BR2_arcle || BR2_arceb + default y if BR2_arm || BR2_armeb + default y if BR2_csky + default y if BR2_i386 + default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el + default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le + default y if BR2_sh + default y if BR2_x86_64 + +if BR2_LINUX_KERNEL_ARCH_HAS_COMPRESSION + choice prompt "Kernel compression format" help @@ -326,6 +342,8 @@ config BR2_LINUX_KERNEL_ZSTD endchoice +endif + config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME string "Kernel image target name" depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM From patchwork Thu Sep 24 12:22:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1370655 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BxvM60hLzz9sTg for ; Thu, 24 Sep 2020 22:22:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4BD0D873F3; Thu, 24 Sep 2020 12:22:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k6Jf0KbqtkkP; Thu, 24 Sep 2020 12:22:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2DC05874EE; Thu, 24 Sep 2020 12:22:33 +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 EC8141BF573 for ; Thu, 24 Sep 2020 12:22:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E937986AA4 for ; Thu, 24 Sep 2020 12:22:29 +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 MISBb17-pNDf for ; Thu, 24 Sep 2020 12:22:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 74A8C86A97 for ; Thu, 24 Sep 2020 12:22:27 +0000 (UTC) X-Originating-IP: 86.206.245.199 Received: from localhost (lfbn-tou-1-420-199.w86-206.abo.wanadoo.fr [86.206.245.199]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6BC81240011; Thu, 24 Sep 2020 12:22:24 +0000 (UTC) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Thu, 24 Sep 2020 14:22:21 +0200 Message-Id: <20200924122222.3449188-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200924122222.3449188-1-thomas.petazzoni@bootlin.com> References: <20200924122222.3449188-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] linux: support Image.gz on arm64 and riscv X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Both arm64 and riscv allow generating a compressed Image.gz file, so let's support that as a first class citizen. Signed-off-by: Thomas Petazzoni Tested-by: Tian Yuanhao --- linux/Config.in | 4 ++++ linux/linux.mk | 2 ++ 2 files changed, 6 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index 9f2af6da5b..73b9c30b26 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -262,6 +262,10 @@ config BR2_LINUX_KERNEL_IMAGE bool "Image" depends on BR2_aarch64 || BR2_riscv +config BR2_LINUX_KERNEL_IMAGE_GZ + bool "Image.gz" + depends on BR2_aarch64 || BR2_riscv + config BR2_LINUX_KERNEL_LINUX_BIN bool "linux.bin" depends on BR2_microblaze diff --git a/linux/linux.mk b/linux/linux.mk index e07e014d1e..133023f78c 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -201,6 +201,8 @@ else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) LINUX_IMAGE_NAME = simpleImage.$(firstword $(LINUX_DTS_NAME)) else ifeq ($(BR2_LINUX_KERNEL_IMAGE),y) LINUX_IMAGE_NAME = Image +else ifeq ($(BR2_LINUX_KERNEL_IMAGE_GZ),y) +LINUX_IMAGE_NAME = Image.gz else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y) LINUX_IMAGE_NAME = linux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y)