From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935438AbcI0Ucx (ORCPT ); Tue, 27 Sep 2016 16:32:53 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36479 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932747AbcI0Ucp (ORCPT ); Tue, 27 Sep 2016 16:32:45 -0400 From: klondike Subject: [PATCH v3 1/2] initramfs: Select builtin initram compression algorithm on KConfig instead of Makefile To: linux-kernel@vger.kernel.org References: <54239E69.4050803@klondike.es> <57EAC8CC.3070602@klondike.es> Cc: P J P , Paul Bolle , Andrew Morton Message-ID: <57EAD769.1090401@klondike.es> Date: Tue, 27 Sep 2016 22:32:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <57EAC8CC.3070602@klondike.es> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch moves the current builtin initram compression algorithm selection from the Makefile into the INITRAMFS_COMPRESSION variable. This makes deciding algorithm precedence easier and would allow for overrides if new algorithms want to be tested. Signed-off-by: Francisco Blas Izquierdo Riera (klondike) Cc: P J P Cc: Paul Bolle Cc: Andrew Morton --- I'm sorry for the noise. I'm resending this as a new version because Thunderbird likes to word wrap things it shouldn't be word wrapping. diff --git a/usr/Kconfig b/usr/Kconfig index 572dcf7..bf8e8f1 100644 --- a/usr/Kconfig +++ b/usr/Kconfig @@ -98,3 +98,13 @@ config RD_LZ4 help Support loading of a LZ4 encoded initial ramdisk or cpio buffer If unsure, say N. + +config INITRAMFS_COMPRESSION + string + default ".gz" if RD_GZIP + default ".lz4" if RD_LZ4 + default ".lzo" if RD_LZO + default ".xz" if RD_XZ + default ".lzma" if RD_LZMA + default ".bz2" if RD_BZIP2 + default "" diff --git a/usr/Makefile b/usr/Makefile index e767f01..17a5132 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -5,25 +5,7 @@ klibcdirs:; PHONY += klibcdirs - -# Bzip2 -suffix_$(CONFIG_RD_BZIP2) = .bz2 - -# Lzma -suffix_$(CONFIG_RD_LZMA) = .lzma - -# XZ -suffix_$(CONFIG_RD_XZ) = .xz - -# Lzo -suffix_$(CONFIG_RD_LZO) = .lzo - -# Lz4 -suffix_$(CONFIG_RD_LZ4) = .lz4 - -# Gzip -suffix_$(CONFIG_RD_GZIP) = .gz - +suffix_y = $(CONFIG_INITRAMFS_COMPRESSION) AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" # Generate builtin.o based on initramfs_data.o