zstd compressed firmware loading
Subsystems (3)
PATCH v3 1/1 zstd compressed firmware loading
Now with zstd compressed kernel & initrd upstream, we would rather compress everything with one type of compressor, so I added support for zstd compressed firmware loading, too. Renamed FW_LOADER_COMPRESS to FW_LOADER_COMPRESS_XZ to indicate algorithm used.
Tested on x86_64, sparc64 and mips64.
Signed-off-by René Rebe <[email protected]>
drivers/base/firmware_loader/Kconfig +12 -2
@@ -155,8 +155,8 @@ config FW_LOADER_USER_HELPER_FALLBACK If you are unsure about this, say N here. -config FW_LOADER_COMPRESS - bool "Enable compressed firmware support" +config FW_LOADER_COMPRESS_XZ + bool "Enable XZ compressed firmware support" select FW_LOADER_PAGED_BUF select XZ_DEC help
@@ -169,6 +169,16 @@ config FW_LOADER_COMPRESS be compressed with either none or crc32 integrity check type (pass "-C crc32" option to xz command). +config FW_LOADER_COMPRESS_ZSTD + bool "Enable Zstd compressed firmware support" + select FW_LOADER_PAGED_BUF + select ZSTD_DECOMPRESS + help + This option enables the support for loading Zstd compressed firmware + files. The caller of firmware API receives the decompressed file + content. The compressed file is loaded as a fallback, only after + loading the raw file failed at first. + config FW_CACHE bool "Enable firmware caching during suspend" depends on PM_SLEEP
drivers/base/firmware_loader/main.c +189 -3
220 lines not on this page · raw message
tools/testing/selftests/firmware/fw_lib.sh +3 -3
@@ -62,7 +62,7 @@ check_setup() { HAS_FW_LOADER_USER_HELPER="$(kconfig_has CONFIG_FW_LOADER_USER_HELPER=y)" HAS_FW_LOADER_USER_HELPER_FALLBACK="$(kconfig_has CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y)" - HAS_FW_LOADER_COMPRESS="$(kconfig_has CONFIG_FW_LOADER_COMPRESS=y)" + HAS_FW_LOADER_COMPRESS_XZ="$(kconfig_has CONFIG_FW_LOADER_COMPRESS_XZ=y)" PROC_FW_IGNORE_SYSFS_FALLBACK="0" PROC_FW_FORCE_SYSFS_FALLBACK="0"
@@ -98,9 +98,9 @@ check_setup() OLD_FWPATH="$(cat /sys/module/firmware_class/parameters/path)" - if [ "$HAS_FW_LOADER_COMPRESS" = "yes" ]; then + if [ "$HAS_FW_LOADER_COMPRESS_XZ" = "yes" ]; then if ! which xz 2> /dev/null > /dev/null; then - HAS_FW_LOADER_COMPRESS="" + HAS_FW_LOADER_COMPRESS_XZ="" fi fi }
Signature · 2 lines
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin https://exactcode.com | https://t2sde.org | https://rene.rebe.de