Where Linux Looks for Device Firmware: /lib/firmware, initramfs and Built-In Blobs
Where the Linux 6.12 firmware loader searches for blobs, in what order, how initramfs and built-in firmware fit in, and how to read the failure messages.

Many devices cannot work until the host gives them a program to run. A Wi-Fi chip, a GPU, a Bluetooth controller or an NVMe drive with a microcontroller inside needs a binary blob uploaded at probe time, and the driver asks the kernel's firmware loader for it by file name. When the file is missing, the device does not work, and the only trace is a line in dmesg. This post explains where Linux 6.12 looks for those files, in what order, how initramfs and built-in firmware change the picture, and how to read the failure messages. It is the starting point for the driver-side call, request_firmware(), covered in the post on loading firmware from a driver.
The behavior is described in the kernel's firmware loader documentation and request_firmware guide.
The search path
A driver asks for a file by a relative name, such as iwlwifi-cc-a0-77.ucode or rtl_nic/rtl8168h-2.fw. The loader tries a fixed list of directories in order and stops at the first file it can read:
| Order | Directory | Purpose |
|---|---|---|
| 1 | The path in firmware_class.path | A custom directory set on the kernel command line or at run time |
| 2 | /lib/firmware/updates/<kernel release>/ | Updates for one exact kernel build |
| 3 | /lib/firmware/updates/ | Updates for any kernel |
| 4 | /lib/firmware/<kernel release>/ | Files for one exact kernel build |
| 5 | /lib/firmware/ | The default location |
The "updates" directories exist so a package can override a file from the main package without replacing it: put a newer file in /lib/firmware/updates/ and it wins. The kernel release is the string uname -r prints, such as 6.12.8. Distributions that merge /lib into /usr/lib make /lib/firmware and /usr/lib/firmware the same directory through a symbolic link.
The first directory is special. Set it at boot with firmware_class.path=/opt/fw on the command line, or change it at run time:
cat /sys/module/firmware_class/parameters/path
echo -n /opt/fw | sudo tee /sys/module/firmware_class/parameters/path
/opt/fwThe first command prints an empty line, because no custom path is set by default. The write sets it, and the loader consults that directory first from then on. This is useful on a read-only root filesystem, where you cannot add files to /lib/firmware, and in testing.
Compressed files
Firmware files are often stored compressed to save space. If the kernel was built with CONFIG_FW_LOADER_COMPRESS, with the XZ or ZSTD options, the loader tries the requested name with a .xz or .zst suffix when the plain file is missing:
ls /lib/firmware/rtl_nic | head -n 3rtl8105e-1.fw.zst
rtl8106e-1.fw.zst
rtl8106e-2.fw.zstThe driver still asks for rtl_nic/rtl8105e-1.fw. The loader finds the .zst file and decompresses it in memory. If you copy a file by hand and the kernel does not have the decompressor built in, the request fails even though a file with the right base name is present. That mismatch is a common source of confusion after a kernel change.
Failure messages
When no directory has the file, the driver gets an error and the kernel prints a message:
rtw89_8852ae 0000:03:00.0: Direct firmware load for rtw89_fw/rtw8852a_fw.bin failed with error -2
rtw89_8852ae 0000:03:00.0: failed to load firmwareerror -2 is -ENOENT, no such file. The name after "for" is the path the loader looked for under each search directory. Check each one with ls, and if the file is missing, install the package that ships it (often linux-firmware, split in some distributions into per-vendor packages).
Other errors tell other stories. error -12 is -ENOMEM, the file could not be loaded into memory. A different message, firmware: failed to load ... (-110), shows up with the old user-helper fallback, which is disabled in most kernels. A driver can also reject a file that the loader found, with a message of its own such as firmware file is corrupt or unsupported firmware version, because it checks size, checksum or a version field. That is a mismatch between driver and firmware versions, solved by installing the matching pair.
initramfs: firmware before the root filesystem
A driver that probes before the root filesystem is mounted asks for firmware when /lib/firmware on the real root does not exist yet. A disk controller, a network interface used to mount the root over the network, and a GPU that must show the boot splash all hit this. The solution is to include the firmware in the initramfs, which is unpacked into memory early and holds /lib/firmware of its own.
Tools such as dracut and mkinitcpio copy firmware into the image based on the modules they include, and you can list what is inside an image:
lsinitrd /boot/initramfs-6.12.8.img | grep firmware | head -n 3-rw-r--r-- 1 root root 28672 Jan 3 10:12 usr/lib/firmware/amdgpu/vega10_asd.bin.zst
-rw-r--r-- 1 root root 35840 Jan 3 10:12 usr/lib/firmware/amdgpu/vega10_ce.bin.zst
-rw-r--r-- 1 root root 41984 Jan 3 10:12 usr/lib/firmware/amdgpu/vega10_me.bin.zstlsinitrd is the dracut command, and Debian-based systems use lsinitramfs for the same purpose. A device whose driver loads from the initramfs and fails there, but works after boot when you load the module again by hand, is the signature of firmware missing from the image. Rebuild the image after installing the firmware package.
Built-in firmware
The third option is to compile the blob into the kernel image itself. The configuration option CONFIG_EXTRA_FIRMWARE takes a space-separated list of file names, and CONFIG_EXTRA_FIRMWARE_DIR names the directory to read them from. The files are embedded in the kernel and the loader checks the built-in list before any directory:
CONFIG_EXTRA_FIRMWARE="rtl_nic/rtl8168h-2.fw"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"This removes the dependency on the filesystem entirely, which suits embedded systems with a single kernel image and no initramfs, and it guarantees the file is there at the earliest probe. The cost is a larger kernel image and a rebuild for each firmware update, and it is rarely what a distribution does. It also moves a blob with its own license into a kernel binary you might distribute, which is worth checking against the firmware's terms.
Seeing what was loaded
The kernel logs requests only on failure by default. To see successes, enable the dynamic debug messages for the loader, or look at what the driver prints after loading, since most print the firmware version:
sudo dmesg | grep -i firmware | head -n 3iwlwifi 0000:00:14.3: loaded firmware version 89.fd4a2d7e.0 cc-a0-89.ucode op_mode iwlmvm
i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/adlp_dmc_ver2_16.bin (v2.16)Each of these names the file and its version, which is how you confirm that your update was picked up and not shadowed by an older copy in an "updates" directory.


