Firmware files compressed with .zst are not loaded automatically, causing firmware loading failures

Hello,

I’ve noticed that on my system (Arch Linux / EndeavourOS), the Linux firmware package includes many firmware files compressed with .zst (Zstandard compression). However, during boot or device initialization, the kernel fails to load these firmware files because it tries to load them uncompressed, resulting in errors such as:

Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed with error -2
Direct firmware load for mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin failed with error -2

This seems to be because the kernel or the firmware loader does not decompress .zst firmware files automatically.

I had to manually add a pacman hook to decompress these .zst files to their original form so the firmware could be loaded properly.

Is this the expected behavior? Should the kernel or firmware loading mechanism support .zst compressed firmware directly, or should the packaging include uncompressed firmware files?

This situation causes hardware components (like Wi-Fi and Bluetooth) to not initialize properly until the firmware is decompressed manually.

Thank you for your attention.

No, that isn’t normal. All the firmware is zst compressed.

What kernel are you using?

Hi Dalto,

Thanks for your quick reply! I’m using kernel version 6.15.4-arch2-1 on EndeavourOS (Arch-based).

The problem is that the kernel or firmware loader isn’t decompressing the .zst firmware files automatically, which leads to errors like these in dmesg:

Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed with error -2
Direct firmware load for mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin failed with error -2

As a temporary fix, I created a pacman hook that decompresses these .zst files after installing the linux-firmware package, which allows the devices to load firmware correctly.

Do you know if this decompression step is supposed to happen automatically at some point? Or is this expected behavior for now?

Thanks!

The kernel should be capable of directly loading zst compressed firmware. There should be no need to decompress it.

Thanks for the clarification, Dalto.

Yes, I also thought the kernel should load .zst firmware files directly. However, on my system, it seems to fail loading these compressed firmware files (e.g., mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin) with error -2.

The workaround I found was to decompress these .zst files manually after installing the linux-firmware package, which then allows the firmware to load correctly.

Do you think this could be related to a kernel bug, a missing kernel module, or some configuration issue on my side? Any pointers on how to debug this further would be greatly appreciated!

Thanks again for your help.