diff options
| author | Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es> | 2016-12-14 18:06:01 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 19:04:08 -0500 |
| commit | 35e669e1a254e8b60d4a8983205b383666cc01ca (patch) | |
| tree | e08553ab2cf9e0f19e44eff03f8cae1e77604bb9 /usr | |
| parent | 34aaff40b42148b23dcde40152480e25c7d2d759 (diff) | |
initramfs: select builtin initram compression algorithm on KConfig instead 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/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>
Diffstat (limited to 'usr')
| -rw-r--r-- | usr/Kconfig | 10 | ||||
| -rw-r--r-- | usr/Makefile | 20 |
2 files changed, 11 insertions, 19 deletions
diff --git a/usr/Kconfig b/usr/Kconfig index 572dcf7b6a44..bf8e8f15358f 100644 --- a/usr/Kconfig +++ b/usr/Kconfig | |||
| @@ -98,3 +98,13 @@ config RD_LZ4 | |||
| 98 | help | 98 | help |
| 99 | Support loading of a LZ4 encoded initial ramdisk or cpio buffer | 99 | Support loading of a LZ4 encoded initial ramdisk or cpio buffer |
| 100 | If unsure, say N. | 100 | If unsure, say N. |
| 101 | |||
| 102 | config INITRAMFS_COMPRESSION | ||
| 103 | string | ||
| 104 | default ".gz" if RD_GZIP | ||
| 105 | default ".lz4" if RD_LZ4 | ||
| 106 | default ".lzo" if RD_LZO | ||
| 107 | default ".xz" if RD_XZ | ||
| 108 | default ".lzma" if RD_LZMA | ||
| 109 | default ".bz2" if RD_BZIP2 | ||
| 110 | default "" | ||
diff --git a/usr/Makefile b/usr/Makefile index e767f019accf..17a513268325 100644 --- a/usr/Makefile +++ b/usr/Makefile | |||
| @@ -5,25 +5,7 @@ | |||
| 5 | klibcdirs:; | 5 | klibcdirs:; |
| 6 | PHONY += klibcdirs | 6 | PHONY += klibcdirs |
| 7 | 7 | ||
| 8 | 8 | suffix_y = $(CONFIG_INITRAMFS_COMPRESSION) | |
| 9 | # Bzip2 | ||
| 10 | suffix_$(CONFIG_RD_BZIP2) = .bz2 | ||
| 11 | |||
| 12 | # Lzma | ||
| 13 | suffix_$(CONFIG_RD_LZMA) = .lzma | ||
| 14 | |||
| 15 | # XZ | ||
| 16 | suffix_$(CONFIG_RD_XZ) = .xz | ||
| 17 | |||
| 18 | # Lzo | ||
| 19 | suffix_$(CONFIG_RD_LZO) = .lzo | ||
| 20 | |||
| 21 | # Lz4 | ||
| 22 | suffix_$(CONFIG_RD_LZ4) = .lz4 | ||
| 23 | |||
| 24 | # Gzip | ||
| 25 | suffix_$(CONFIG_RD_GZIP) = .gz | ||
| 26 | |||
| 27 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" | 9 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" |
| 28 | 10 | ||
| 29 | # Generate builtin.o based on initramfs_data.o | 11 | # Generate builtin.o based on initramfs_data.o |
