summaryrefslogtreecommitdiffstats
path: root/fs/pstore/Kconfig
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-03-06 15:57:38 -0800
committerKees Cook <keescook@chromium.org>2018-03-07 12:43:35 -0800
commitfe1d475888eecf1319458ee916e642e3e5e41c28 (patch)
treed975fba8225eec25ad2b3fd9ba5fd8e7ccfeb3dd /fs/pstore/Kconfig
parent555974068ee533e8e0c6093ec7ca1682057aa4c1 (diff)
downloadlinux-fe1d475888eecf1319458ee916e642e3e5e41c28.tar.bz2
pstore: Select compression at runtime
To allow for easier build test coverage and run-time testing, this allows multiple compression algorithms to be built into pstore. Still only one is supported to operate at a time (which can be selected at build time or at boot time, similar to how LSMs are selected). Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore/Kconfig')
-rw-r--r--fs/pstore/Kconfig96
1 files changed, 67 insertions, 29 deletions
diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig
index 898abafea7a5..e4e22026c7a1 100644
--- a/fs/pstore/Kconfig
+++ b/fs/pstore/Kconfig
@@ -12,55 +12,93 @@ config PSTORE
If you don't have a platform persistent store driver,
say N.
-choice
- prompt "Choose compression algorithm"
- depends on PSTORE
- default PSTORE_ZLIB_COMPRESS
- help
- This option chooses compression algorithm.
-
- Currently, pstore has support for 5 compression algorithms:
- zlib, lzo, lz4, lz4hc and 842.
-
- The default compression algorithm is zlib.
-
config PSTORE_ZLIB_COMPRESS
- bool "ZLIB"
- select ZLIB_DEFLATE
- select ZLIB_INFLATE
- help
- This option enables ZLIB compression algorithm support.
+ bool "ZLIB compression"
+ default y
+ depends on PSTORE
+ select ZLIB_DEFLATE
+ select ZLIB_INFLATE
+ help
+ This option enables ZLIB compression algorithm support.
config PSTORE_LZO_COMPRESS
- bool "LZO"
- select LZO_COMPRESS
- select LZO_DECOMPRESS
- help
- This option enables LZO compression algorithm support.
+ bool "LZO compression"
+ depends on PSTORE
+ select LZO_COMPRESS
+ select LZO_DECOMPRESS
+ help
+ This option enables LZO compression algorithm support.
config PSTORE_LZ4_COMPRESS
- bool "LZ4"
- select LZ4_COMPRESS
- select LZ4_DECOMPRESS
- help
- This option enables LZ4 compression algorithm support.
+ bool "LZ4 compression"
+ depends on PSTORE
+ select LZ4_COMPRESS
+ select LZ4_DECOMPRESS
+ help
+ This option enables LZ4 compression algorithm support.
config PSTORE_LZ4HC_COMPRESS
- bool "LZ4HC"
+ bool "LZ4HC compression"
+ depends on PSTORE
select LZ4HC_COMPRESS
select LZ4_DECOMPRESS
help
This option enables LZ4HC (high compression) mode algorithm.
config PSTORE_842_COMPRESS
- bool "842"
+ bool "842 compression"
+ depends on PSTORE
select 842_COMPRESS
select 842_DECOMPRESS
help
This option enables 842 compression algorithm support.
+config PSTORE_COMPRESS
+ def_bool y
+ depends on PSTORE
+ depends on PSTORE_ZLIB_COMPRESS || PSTORE_LZO_COMPRESS || \
+ PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \
+ PSTORE_842_COMPRESS
+
+choice
+ prompt "Default pstore compression algorithm"
+ depends on PSTORE_COMPRESS
+ help
+ This option chooses the default active compression algorithm.
+ This change be changed at boot with "pstore.compress=..." on
+ the kernel command line.
+
+ Currently, pstore has support for 5 compression algorithms:
+ zlib, lzo, lz4, lz4hc and 842.
+
+ The default compression algorithm is zlib.
+
+ config PSTORE_ZLIB_COMPRESS_DEFAULT
+ bool "zlib" if PSTORE_ZLIB_COMPRESS=y
+
+ config PSTORE_LZO_COMPRESS_DEFAULT
+ bool "lzo" if PSTORE_LZO_COMPRESS=y
+
+ config PSTORE_LZ4_COMPRESS_DEFAULT
+ bool "lz4" if PSTORE_LZ4_COMPRESS=y
+
+ config PSTORE_LZ4HC_COMPRESS_DEFAULT
+ bool "lz4hc" if PSTORE_LZ4HC_COMPRESS=y
+
+ config PSTORE_842_COMPRESS_DEFAULT
+ bool "842" if PSTORE_842_COMPRESS=y
+
endchoice
+config PSTORE_COMPRESS_DEFAULT
+ string
+ depends on PSTORE_COMPRESS
+ default "zlib" if PSTORE_ZLIB_COMPRESS_DEFAULT
+ default "lzo" if PSTORE_LZO_COMPRESS_DEFAULT
+ default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT
+ default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT
+ default "842" if PSTORE_842_COMPRESS_DEFAULT
+
config PSTORE_CONSOLE
bool "Log kernel console messages"
depends on PSTORE