]> git.karo-electronics.de Git - linux-beck.git/commitdiff
initramfs: select builtin initram compression algorithm on KConfig instead of Makefile
authorFrancisco Blas Izquierdo Riera (klondike) <klondike@klondike.es>
Wed, 14 Dec 2016 23:06:01 +0000 (15:06 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 Dec 2016 00:04:08 +0000 (16:04 -0800)
Move 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.

Link: http://lkml.kernel.org/r/57EAD769.1090401@klondike.es
Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es>
Cc: P J P <ppandit@redhat.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
usr/Kconfig
usr/Makefile

index 572dcf7b6a444893829474e6160930fcc73fe6f8..bf8e8f15358f856356ffad460a4b775cdca1d0fb 100644 (file)
@@ -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 ""
index e767f019accfa6a90374a270056739d09e93b920..17a513268325d197b76aa36d7c26c337a70b9a4d 100644 (file)
@@ -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