Tag: linux-firmware

Firmware files for drivers in Linux

What is Linux Firmware for?

Firmware can be confusing because not all users remember them, and firmware are not always pre-installed on Linux distributions. At the same time, firmware is just as important for the normal operation of devices as are drivers (kernel modules), which usually already exist in the system, since they are part of the Linux kernel.

Due to the lack of firmware, the device may not work completely or partially.

The name of the firmware packages differs in distributions (and sometimes it differs in an unobvious way, for example, by rearranging words). Firmware packages can contain both firmware for devices from different manufacturers, and for devices from the same manufacturer.

Sometimes firmware from one manufacturer is divided in different packages, for example, the firmware-intel-sound package contains firmware for Intel sound devices, and the firmware-iwlwifi package contains firmware for Intel wireless cards.

There are cases when the firmware of devices of the same type and the same manufacturer is divided into different packages, for example, the firmware-ath9k-htc and firmware-atheros packages contain firmware for Atheros wireless adapters.

Examples of problems that missing firmware can cause:

Firmware in Kali Linux

Kali Linux has several firmware packages, for example:

  • firmware-linux-free
  • firmware-linux-nonfree
  • firmware-misc-nonfree

The first two packages contain firmware that was previously included in the Linux kernel. The first package contains firmware that complies with the Debian Free Software Guidelines, the second contains the rest that do not comply with the Free Software Guidelines. Most of the firmware got into the non-free package. And the third package contains… more firmware.

In addition to these packages, there are packages containing firmware for certain devices from certain manufacturers, for example, firmware-realtek, firmware-atheros, firmware-iwlwifi.

The Kali Linux repository also has two metapackages:

  • firmware-linux – includes firmware-linux-free and firmware-linux-nonfree
  • kali-linux-firmware – includes bluez-firmware, firmware-amd-graphics, firmware-atheros, firmware-brcm80211, firmware-intel-sound, firmware-iwlwifi, firmware-libertas, firmware-linux, firmware-misc-nonfree, firmware-realtek, firmware-sof-signed, firmware-ti-connectivity, firmware-zd1211

In order not to experience problems with Wi-Fi and other devices in the future, it is recommended to install the kali-linux-firmware package, which will install most of the necessary firmware.

In Kali Linux, it is convenient to search for firmware packages with a command like

apt search SEARCH_STRING

As SEARCH_STRING, you can specify the name of the device, manufacturer, chipset of the device, the name of the firmware file, if you know it.

Firmware in Debian

In Debian, in addition to the firmware-linux-free, firmware-linux-nonfree, and firmware-misc-nonfree packages already familiar from Kali Linux, there is also the already familiar firmware-linux metapackage that combines the first two.

In addition to those discussed, there are firmware for devices from individual manufacturers, for example, firmware-iwlwifi, firmware-ath9k-htc, firmware-atheros, firmware-amd-graphics and others.

Firmware in Ubuntu, Linux Mint

In these distributions, the firmware is not divided into free and nonfree and is placed in one package called linux-firmware.

In addition to this package, there are also firmware for certain manufacturers, such as firmware-ath9k-htc, nouveau-firmware and others.

In general, in Ubuntu and Linux Mint, most of the firmware is collected in a single linux-firmware package, it is convenient!

But the search for firmware packages with a command like

apt search SEARCH_STRING

practically useless if you are trying to search by device model, chipset or firmware file. If you searched and did not find a separate package for your device, then most likely the firmware you need is contained in the linux-firmware package.

Firmware in Arch Linux, Manjaro, BlackArch

Until recently, all firmware were collected in one linux-firmware package. But some large and rare firmware have been divied into separate packages, details in the article “Changes in the linux-firmware package: kernel requirements, separating large files into separate packages”.

How to install all firmware for various drivers in the Linux kernel

In order to avoid possible problems due to missing firmware in the future, it is recommended to install them, since they take up relatively little disk space. Previously, many firmware were part of the kernel (which is understandable, given their importance), but were removed from the kernel, apparently to save space.

Installation of the main firmware packages is performed by the following commands.

On Kali Linux:

sudo apt install kali-linux-firmware

On Debian:

sudo apt install firmware-linux firmware-misc-nonfree firmware-iwlwifi firmware-ath9k-htc

On Ubuntu, Linux Mint:

sudo apt install linux-firmware firmware-iwlwifi firmware-ath9k-htc

On Arch Linux, Manjaro, BlackArch:

sudo pacman -S linux-firmware

Linux does not see Wi-Fi on Intel chipset. “firmware: failed to load iwlwifi” error (SOLVED)

Built-in Wi-Fi adapter manufactured by Intel is not detected by the system. Linux does not see the Wi-Fi device as if it is not connected.

To view system events since the last boot, run the following command.

journalctl -b

You can scroll through the output or search for “iwlwifi”.

An example output related to a non-working Wi-Fi adapter on an Intel chipset:

Jan 27 11:57:00 HackWare-Kali kernel: Intel(R) Wireless WiFi driver for Linux
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-46.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-46.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-45.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-45.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-44.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-44.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-43.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-43.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-42.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-42.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-41.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-41.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-40.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-40.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-39.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-39.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-38.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-38.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-37.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-37.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-36.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-36.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-35.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-35.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-34.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-34.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-33.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-33.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-32.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-32.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-31.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-31.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-30.ucode (-2)
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-9000-pu-b0-jf-b0-30.ucode failed with error -2
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: minimum version required: iwlwifi-9000-pu-b0-jf-b0-30
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: maximum version supported: iwlwifi-9000-pu-b0-jf-b0-46
Jan 27 11:57:00 HackWare-Kali kernel: iwlwifi 0000:00:14.3: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

To search the system log, you can use the following command:

journalctl -b | grep iwlwifi

In the output, the key line is “firmware: failed to load iwlwifi-9000-*.ucode (-2)”, that is, it was not possible to load the iwlwifi firmware.

Searching the package repository

apt search iwlwifi

showed that in Kali Linux, the iwlwifi firmware is placed in the firmware-iwlwifi package, install it:

sudo apt install firmware-iwlwifi

On Ubuntu, Linux Mint and Debian, run the following command to install the firmware:

sudo apt install firmware-iwlwifi

On Arch Linux, Manjaro, BlackArch and their derivatives, run the command:

sudo pacman -S linux-firmware

After installing the firmware and restarting the computer, the problem will disappear and the Wi-Fi adapter will work.

Linux does not see Wi-Fi on Realtek chipset. “firmware: failed to load rt2870.bin” error (SOLVED)

When connecting a Wi-Fi adapter with a Realtek chipset, nothing happens, or the device does not work properly.

Command

iw dev

outputs the following information:

phy#0
        Interface wlan0
                ifindex 3
                wdev 0x1
                addr 52:e7:b0:49:a2:84
                type managed
                txpower 0.00 dBm

The txpower value is zero, the system does not see the Wi-Fi device.

Run command

journalctl -f

and connect the Wi-Fi adapter to your computer

Jan 27 06:09:24 HackWare-Kali kernel: usb 1-1: reset high-speed USB device number 2 using ehci-pci
Jan 27 06:09:25 HackWare-Kali kernel: ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3572, rev 0223 detected
Jan 27 06:09:25 HackWare-Kali kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0009 detected
Jan 27 06:09:25 HackWare-Kali kernel: ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Jan 27 06:09:25 HackWare-Kali NetworkManager[612]:   [1643281765.9900] device (wlan0): driver supports Access Point (AP) mode
Jan 27 06:09:25 HackWare-Kali systemd[1]: Starting Load/Save RF Kill Switch Status...
Jan 27 06:09:25 HackWare-Kali NetworkManager[612]:   [1643281765.9949] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Jan 27 06:09:25 HackWare-Kali kernel: usbcore: registered new interface driver rt2800usb
Jan 27 06:09:26 HackWare-Kali systemd-udevd[1328]: Using default interface naming scheme 'v250'.
Jan 27 06:09:26 HackWare-Kali NetworkManager[612]:   [1643281766.0124] rfkill0: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1/1-1:1.0/ieee80211/phy0/rfkill0) (driver rt2800usb)
Jan 27 06:09:26 HackWare-Kali systemd[1]: Started Load/Save RF Kill Switch Status.
Jan 27 06:09:26 HackWare-Kali NetworkManager[612]:   [1643281766.0298] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Jan 27 06:09:26 HackWare-Kali kernel: ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
Jan 27 06:09:26 HackWare-Kali kernel: rt2800usb 1-1:1.0: firmware: failed to load rt2870.bin (-2)
Jan 27 06:09:26 HackWare-Kali kernel: firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
Jan 27 06:09:26 HackWare-Kali kernel: rt2800usb 1-1:1.0: Direct firmware load for rt2870.bin failed with error -2
Jan 27 06:09:26 HackWare-Kali kernel: ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
Jan 27 06:09:26 HackWare-Kali kernel: rt2800usb 1-1:1.0: firmware: failed to load rt2870.bin (-2)
Jan 27 06:09:26 HackWare-Kali kernel: rt2800usb 1-1:1.0: Direct firmware load for rt2870.bin failed with error -2
Jan 27 06:09:26 HackWare-Kali NetworkManager[612]:   [1643281766.0307] device (wlan0): firmware may be missing.
Jan 27 06:09:26 HackWare-Kali NetworkManager[612]:   [1643281766.0310] device (wlan0): set-hw-addr: set MAC address to 52:E7:B0:49:A2:84 (scanning)
Jan 27 06:09:26 HackWare-Kali dbus-daemon[611]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':1.72' (uid=119 pid=1345 comm="/usr/libexec/colord-sane ")
Jan 27 06:09:26 HackWare-Kali dbus-daemon[611]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Jan 27 06:09:28 HackWare-Kali ModemManager[639]:   [base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1': not supported by any plugin
Jan 27 06:09:31 HackWare-Kali systemd[1]: systemd-rfkill.service: Deactivated successfully.
Jan 27 06:09:33 HackWare-Kali systemd[1]: blueman-mechanism.service: Deactivated successfully.

In the output, the key line is “firmware: failed to load rt2870.bin”, that is, it was not possible to load the firmware rt2870.bin.

In Kali Linux, the rt2870.bin firmware is placed in the firmware-misc-nonfree package, install it:

sudo apt install firmware-misc-nonfree

On Ubuntu, Linux Mint and their derivatives, run the following command:

sudo apt install linux-firmware

On Debian, run:

sudo apt install firmware-misc-nonfree

On Arch Linux, Manjaro, BlackArch and their derivatives, run the command:

sudo pacman -S linux-firmware

After installing the firmware and restarting the computer, the problem will disappear and the Wi-Fi adapter will work.

Note that Debian and derivatives have a firmware-realtek package which also contains Realtek firmware. In addition to these two packages, various distributions contain Realtek drivers and firmware in separate packages – to determine exactly which package you need, search your distribution's package repository for the name of the Wi-Fi adapter, as well as the name of the driver and firmware file that may appear in the error message.

See also the section “Drivers and firmware”.

Linux does not see Alfa AWUS036NHA. “firmware: failed to load ath9k_htc” error (SOLVED)

When connecting a Wi-Fi adapter based on the Atheros chipset, such as Alfa AWUS036NHA, a Linux computer does not see the Wi-Fi device. Command

iw dev

does not output anything, as if the device is not connected.

In the Linux Wi-Fi Cheat Sheet: Tips and Troubleshooting, we'll use the advice from the “How to ask a question about a problem with a Wi-Fi adapter” section, namely, open several terminal windows and run the following commands in them:

iw event
ip monitor
journalctl -f

Then plug the Wi-Fi adapter to the computer.

journalctl gave the following messages:

Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: firmware: failed to load ath9k_htc/htc_9271-1.4.0.fw (-2)
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: firmware: failed to load htc_9271.fw (-2)
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: no suitable firmware found!
Jan 27 00:55:28 HackWare-Kali kernel: usb 1-1: ath9k_htc: USB layer deinitialized

The key to solving the problem in these messages is the information that the ath9k_htc firmware is not loaded. For devices to work, in addition to the driver (which can be part of the kernel or installed separately), firmware is required.

Let's search for the firmware:

apt search ath9k_htc

In Kali Linux, the ath9k_htc firmware is placed in a separate firmware-atheros package, install it:

sudo apt install firmware-atheros

On Debian, Ubuntu and Linux Mint, run the following command to install:

sudo apt firmware-ath9k-htc

On Arch Linux, Manjaro, BlackArch and their derivatives, run the command:

sudo pacman -S linux-firmware

After installing the firmware and restarting the computer, the problem will disappear and the Wi-Fi adapter will work.

Changes in the linux-firmware package: kernel requirements, separating large files into separate packages

In Arch Linux, the linux-firmware package, which contains the firmware files, got important changes. In addition to the usual file updates and adding support for new devices, this package has a requirement for a minimum kernel version, and the package itself is divided into several packages.

Recall that device firmware are files that are necessary for the normal operation of the hardware in addition to kernel modules (drivers).

The linux-firmware package now implements kernel firmware compression and also requires Linux kernel version 5.3 or later with support for booting from compressed xz firmware. The CONFIG_FW_LOADER_COMPRESS kernel option must be enabled. All official Arch Linux kernels have supported this for a long time.

The linux-firmware package has been split into smaller packages to further reduce disk space requirements. Some large firmware files for rarely used hardware have been split into separate packages. This affects firmware for Mellanox Spectrum switches, Marvell devices, Qualcomm SoCs, Cavium LiquidIO server adapters, QLogic devices, Broadcom NetXtreme II 10Gb Ethernet adapters. Be sure to install additional firmware packages if needed.

The following packages are now in the official Arch Linux repository:

  • linux-firmware and linux-firmware-whence – the main firmware packages for a wide variety of hardware
  • linux-firmware-bnx2x – firmware for NetXtreme II 10Gb Ethernet adapters
  • linux-firmware-liquidio – Cavium LiquidIO server adapters
  • linux-firmware-marvell – firmware for Marvell devices
  • linux-firmware-mellanox – firmware for Mellanox Spectrum switches
  • linux-firmware-nfp – firmware for Netronome Flow Processors (nfp)
  • linux-firmware-qcom – firmware for Qualcomm SoCs (qcom)
  • linux-firmware-qlogic – firmware for Qlogic devices (qlogic)
Loading...
X