Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4136517ybl; Mon, 3 Feb 2020 13:17:55 -0800 (PST) X-Google-Smtp-Source: APXvYqw9R39uOfIFByei4OP60uhwIi1lvddOZXVI/hXIl2Qy63/xY1JXf5jgVJc+1dZDNH264cAU X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr19917162otc.186.1580764675830; Mon, 03 Feb 2020 13:17:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580764675; cv=none; d=google.com; s=arc-20160816; b=ZW9TtNuABNg5T9YaSyf0LK9FCDM6yh803dkPQhjUBjAMurwdBHRGJiGsJ8CHLbGpjV Oc5qPNmDj3EKUNceSDbt0Ps2lzfYLI5XZ3m93zqBjE/DKRV95NNJixrQPtYAph/WTzIK PHAAqoFpI23DcUiUjjOU1i/zSArTYAYkkJQrvoO8QDEuOxTPSEvDP26DZZyX37uvPnjJ FAf8cUVi+lGsI+FU0DL+AOihzOF3B9ondcOtOlsNXYIrOd0RuhlOwmZw2BtHx/ML93fy tBG19rx6kbGFzA6vIB/piIr4HrheM7KJiRRCFAJMIrLdL2bDGPiyhF32oDEeIAihR1T6 nCVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fwu1ofu8gmyJhMQgts5qdiTVhaWWRWOOtCO5HwATfdc=; b=cb4LjvNiXFAGdufn8t0GcnvI1jF6zxwkGH/ARpdwua42TcDPFNV3C6ivaKkMrnQJnV ijojT1sAtrRXL8/Kc/rNBfFU9Fs/dz6/2hIznFTYzSfXvudo19KXMx1mndKmNEC8gciv Tt/46j7WL0QSBaT20GiPWRO9QbFhXtUjtu9mvLNnRfbdWQoB8o2vyHGt5+XryyH9uwKp BGdenIyTT4inchpBi0+gjj7SAqPsKXYyL3hK1CijLLdo+dFLPT5LVglJIHDh8zBLvIrH 8RuJqso9wbm2hcz/IryTsLykHmrelCBvNn/KJeriJF8njM1MCAllfyBAJI8YTO+SL0IK Mo7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si11167893otg.66.2020.02.03.13.17.42; Mon, 03 Feb 2020 13:17:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbgBCVQr (ORCPT + 99 others); Mon, 3 Feb 2020 16:16:47 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:33219 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbgBCVQr (ORCPT ); Mon, 3 Feb 2020 16:16:47 -0500 Received: by mail-qk1-f193.google.com with SMTP id h4so4894797qkm.0; Mon, 03 Feb 2020 13:16:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwu1ofu8gmyJhMQgts5qdiTVhaWWRWOOtCO5HwATfdc=; b=lcGd6cnNgYNjwBkv5j7Yns8BJxSfEljKNF9aMNo0B8XzqfXlO7TNyTVBQPT/ZvAtcy NcJ9hnH/UTgUw+6h11z1xAwbQ4FcyVovOjF9O03AgJE/E5weduh/nIrYk+LQ9cVr7guJ uc3glioNA5QfadzytFDZHBKWnLU35XxKL8Tn6xAycufeTq/lkmvM9Yb1eZtn64sitkAH 1sx5exgXG6o1dGJAvgjpwU6dr4E/8gnUZMgF+0dW9U3vTBDjEQeW5QZLA9/8m49SfZ/R kQzPr9qQPEyxhGl2QydXtyJKPYnBjTAqH/HDgs0dV2JA+YQto6a9tRPGmkZUypnw0+jl aZdA== X-Gm-Message-State: APjAAAUqi3cjnOqVIc/VucRi4saLA87b88HSLQFc8ft5p1hz7cBcs6fJ Ev08iwrgSqNR1WJ/SK9EV+g= X-Received: by 2002:a37:ef0c:: with SMTP id j12mr25406259qkk.52.1580764605901; Mon, 03 Feb 2020 13:16:45 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id s26sm10283941qkj.24.2020.02.03.13.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 13:16:45 -0800 (PST) From: Arvind Sankar To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Linus Torvalds , Geert Uytterhoeven , linux-kernel@vger.kernel.org, Andrew Morton , Greg Thelen , Mauro Carvalho Chehab , Sam Ravnborg Subject: [PATCH] initramfs: don't double-compress built-in initramfs if the kernel is compressed Date: Mon, 3 Feb 2020 16:16:44 -0500 Message-Id: <20200203211644.39847-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200203200656.GA455151@rani.riverdale.lan> References: <20200203200656.GA455151@rani.riverdale.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the kernel is going to be compressed anyway, there is no point in double-compressing the built-in initramfs. Hide the built-in initramfs compression choice in this case. Signed-off-by: Arvind Sankar --- init/Kconfig | 9 +++++++++ usr/Kconfig | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index 24b23d843df1..88da0976bbfa 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -176,6 +176,9 @@ config HAVE_KERNEL_LZ4 config HAVE_KERNEL_UNCOMPRESSED bool +config KERNEL_COMPRESSED + bool + choice prompt "Kernel compression mode" default KERNEL_GZIP @@ -201,6 +204,7 @@ choice config KERNEL_GZIP bool "Gzip" depends on HAVE_KERNEL_GZIP + select KERNEL_COMPRESSED help The old and tried gzip compression. It provides a good balance between compression ratio and decompression speed. @@ -208,6 +212,7 @@ config KERNEL_GZIP config KERNEL_BZIP2 bool "Bzip2" depends on HAVE_KERNEL_BZIP2 + select KERNEL_COMPRESSED help Its compression ratio and speed is intermediate. Decompression speed is slowest among the choices. The kernel @@ -218,6 +223,7 @@ config KERNEL_BZIP2 config KERNEL_LZMA bool "LZMA" depends on HAVE_KERNEL_LZMA + select KERNEL_COMPRESSED help This compression algorithm's ratio is best. Decompression speed is between gzip and bzip2. Compression is slowest. @@ -226,6 +232,7 @@ config KERNEL_LZMA config KERNEL_XZ bool "XZ" depends on HAVE_KERNEL_XZ + select KERNEL_COMPRESSED help XZ uses the LZMA2 algorithm and instruction set specific BCJ filters which can improve compression ratio of executable @@ -241,6 +248,7 @@ config KERNEL_XZ config KERNEL_LZO bool "LZO" depends on HAVE_KERNEL_LZO + select KERNEL_COMPRESSED help Its compression ratio is the poorest among the choices. The kernel size is about 10% bigger than gzip; however its speed @@ -249,6 +257,7 @@ config KERNEL_LZO config KERNEL_LZ4 bool "LZ4" depends on HAVE_KERNEL_LZ4 + select KERNEL_COMPRESSED help LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding. A preliminary version of LZ4 de/compression tool is available at diff --git a/usr/Kconfig b/usr/Kconfig index bdf5bbd40727..f39eeb9ea2e3 100644 --- a/usr/Kconfig +++ b/usr/Kconfig @@ -102,7 +102,7 @@ config RD_LZ4 choice prompt "Built-in initramfs compression mode" - depends on INITRAMFS_SOURCE != "" + depends on INITRAMFS_SOURCE != "" && !KERNEL_COMPRESSED help This option allows you to decide by which algorithm the builtin initramfs will be compressed. Several compression algorithms are -- 2.24.1