Skip to content

Commit

Permalink
initramfs: select builtin initram compression algorithm on KConfig in…
Browse files Browse the repository at this point in the history
…stead of Makefile

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/[email protected]
Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <[email protected]>
Cc: P J P <[email protected]>
Cc: Paul Bolle <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
klondi authored and torvalds committed Dec 15, 2016
1 parent 34aaff4 commit 35e669e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
10 changes: 10 additions & 0 deletions usr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
20 changes: 1 addition & 19 deletions usr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35e669e

Please sign in to comment.