Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix Direct Firmware Load for Regulatory DB Failed

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If you see direct firmware load for regulatory.db failed with error -2 in your Linux system logs, it means the wireless regulatory database file is missing or not found by the kernel. This guide walks you through the steps to fix it, usually by installing the correct firmware package or updating the kernel.

What You'll Need

  • Root or sudo access to your Linux system
  • An internet connection (wired or another working wireless device)
  • Basic familiarity with the terminal

Step-by-Step

  1. Identify your distribution. The fix differs slightly between Debian/Ubuntu, Fedora, Arch, and others. Run cat /etc/os-release to see which one you have.
  2. Check if the regulatory database is already installed. Look for files named regulatory.db and regulatory.db.p7s in /lib/firmware/ or /usr/lib/firmware/. Use ls -l /lib/firmware/regulatory* or ls -l /usr/lib/firmware/regulatory*.
  3. Install the wireless-regdb package. This package provides the regulatory database.
    • Debian/Ubuntu: sudo apt install wireless-regdb
    • Fedora: sudo dnf install wireless-regdb
    • Arch: sudo pacman -S wireless-regdb
  4. Update the initramfs (if needed). On some systems, the firmware files need to be included in the initramfs. Run sudo update-initramfs -u (Debian/Ubuntu) or sudo dracut --force (Fedora) after installing the package.
  5. Reboot. A reboot ensures the kernel picks up the new firmware. After reboot, check the log again with dmesg | grep regulatory or journalctl -k | grep regulatory. The error should be gone.
  6. If the error persists, manually download the firmware. Some older kernels expect the files in a different location. Download regulatory.db and regulatory.db.p7s from the linux-firmware repository (e.g., from kernel.org) and copy them to /lib/firmware/ with sudo cp regulatory.db* /lib/firmware/.
  7. Set correct permissions. Ensure the files are readable by all: sudo chmod 644 /lib/firmware/regulatory.db*.
  8. Reboot again and verify the error is resolved.

Common Mistakes

  • Installing the wrong package. Some distributions split the regulatory database into a separate package like linux-firmware or crda. Make sure you install wireless-regdb specifically.
  • Forgetting to update initramfs. On systems with an initramfs, the kernel loads firmware from the initramfs at boot. If you don't update it, the new files won't be seen.
  • Copying files to the wrong directory. Some systems use /usr/lib/firmware instead of /lib/firmware. Check both with ls -ld /lib/firmware /usr/lib/firmware.
  • Ignoring file permissions. If the files are not readable, the kernel will still fail to load them. Always set 644 permissions.

Tips

  • Use your package manager first. It's the cleanest way to get the correct files for your kernel version.
  • Check kernel version. Very old kernels (before 4.15) might not support the newer regulatory.db format. In that case, you may need to update the kernel or use an older firmware version.
  • Keep your system updated. This error often appears after a kernel upgrade but before the firmware package is updated. Running a full system update usually fixes it.
  • Use the exact filenames. The error mentions regulatory.db; make sure you have both regulatory.db and regulatory.db.p7s – the signature file is required.

Troubleshooting

If the error persists after following all steps, try these:

  • Check the exact error code. -2 means ENOENT (file not found), but -13 means permission denied. If you see a different code, the problem may be different.
  • Look for the file in the kernel source. The regulatory.db is also generated by the kernel build. If you compile your own kernel, ensure CONFIG_CFG80211_INTERNAL_REGDB is set or the external db is enabled.
  • Try loading the module manually. Run sudo modprobe -r cfg80211 && sudo modprobe cfg80211 to reload the wireless module. This sometimes triggers the firmware load without a reboot.
  • Verify the file is not corrupted. Compare the checksum with the one from the package: sha256sum /lib/firmware/regulatory.db and compare with the package's checksum.
  • Check if the issue is with a specific wireless driver. Some drivers (like iwlwifi) have their own firmware requirements. Look for other firmware errors in dmesg around the same time.

Frequently Asked Questions

What does this error mean?

It means the kernel cannot find the regulatory database file that defines wireless frequency and power limits for your region. This can affect Wi-Fi performance or prevent certain channels from being used.

Is it dangerous to ignore this error?

Usually not dangerous, but your wireless card may not operate optimally. It might default to a conservative regulatory domain, limiting transmit power or available channels.

Why did this happen after a kernel update?

Kernel updates sometimes change the expected firmware path or version. If the wireless-regdb package wasn't updated at the same time, the kernel can't find the new file.

Can I just copy the file from another Linux machine?

Yes, but it must be the same version or newer. Copying an older version might still work, but it's safer to use your package manager.

Do I need to recompile the kernel?

No, in most cases not. Installing the firmware package is sufficient. Only if you're using a custom kernel with unusual options might you need to adjust configuration.

Will this affect my Wi-Fi speed?

It could, because the regulatory database sets allowed channels and power levels. If the database is missing, the driver may use conservative defaults, potentially reducing range or speed.