Respect fw_path_para and compressed firmware in add_firmware()
/sys/module/firmware_class/parameters/path
, if any, is added before
anything else in the module loading path: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/firmware_loader/main.c?h=v5.17#n406
When configured with FW_LOADER_COMPRESS
, Linux additionally searches firmware with an .xz
suffix and decompresses it in-kernel: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/firmware_loader/main.c?h=v5.17#n754
In 5.19, when configured with FW_LOADER_COMPRESS_ZSTD
, Linux will additionally support ZSTD-compression with a .zst
suffix: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=23cfbc6ec44e5e80d5522976ff45ffcdcddfb230
The end-goal of this is that I'd like the firmware for which this is a gain to be installed compressed in Debian (firmware-amd-graphics firmware-iwlwifi firmware-linux-free, a common setup, is 19M of .deb, 159M on-disk, but just 51M when find fw.xz/ -type f -exec xz {} \;
ed (61M zstd default, 55M zstd -19); on one machine with that + 283M of xilinx firmware the gain is 464M -> 87M (116M, 94M)).