Page MenuHomeVyOS Platform

Missing firmware for iwlwifi
Closed, ResolvedPublic

Description

This was reported by user PETURBG on IRC:

[   21.951985] iwlwifi 0000:03:00.0: no suitable firmware found!

Trying to install firmware-iwlwifi from the debian non-free repos shows it has the same files as vyos-linux-firmware so it errors:

Unpacking firmware-iwlwifi (20190114-2) ...
dpkg: error processing archive /var/cache/apt/archives/firmware-iwlwifi_20190114-2_all.deb (--unpack):
 trying to overwrite '/lib/firmware/iwlwifi-3945-2.ucode', which is also in package vyos-linux-firmware 20191022

(vyos-linux-firmware should probably yave a Conflicts entry in debian/control for all the debian firmware packages it replaces)

Unpacking the firmware-iwlwifi and manually copying its lib and usr contents makes the missing firmware work:

[   22.043622] iwlwifi 0000:03:00.0: loaded firmware version 9.221.4.1 build 25532 op_mode iwldvm

I'm not sure whether we should include this by default as it's in the non-free repo and I personally try to not use it if possible.

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202006140117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Improvement (missing useful functionality)

Event Timeline

jjakob triaged this task as Normal priority.Jun 14 2020, 9:01 AM
jjakob created this task.
jjakob created this object in space S1 VyOS Public.

Non-free firmware was added by default in crux: T15

It is not recommended to install Debian firmware- packages over vyos-linux-firmware. The question is why the firmware file in question is not pulled in automatically.

Although this is not an orthodox solution, it is the fault of artificially installing drivers when there is a lack of drivers. Vyos is based on debian for secondary development, although unorthodox solutions should be allowed to use debian underlying commands to install appropriate firmware packages. Judging from the error message, it appears that the unpacking failed because there are other packages in conflict.

There are two main disadvantages to the third-party files and packages installed outside the packaged files of the installed vyos system. You need to determine by yourself that if:
a) does not match the basic debian system of vyos, ABI conflicts may occur.

b) after upgrading vyos, you need to reinstall related packages.

An additional solution is in the packaging process, consider packaging the required firmware packages into iso,. Instead of hanging a packages in the installed system (if vyos supports this compilation)

I suggested to install the firmware-iwlwifi package from the debian repos as part of the debugging process. Of course this isn't a supported way for end users, this is known for a long time, and you must take care to not run apt-get upgrade, dist-upgrade or install a package that conflicts or overrides a vyos package. It is safe to install packages that don't conflict.

As for the question of firmware: personally I'd include only free firmware with the stock vyos image, and have a way for the user to install additional nonfree firmware if his hardware requires it. This isn't possible right now as the vyos-linux-firmware package conflicts with the addidional firmware packages, will break the interfaces across image upgrades, and the interfaces requiring nonfree firmware wouldn't work on a fresh install.

It would be possible to include non-installed deb firmware packages in the installed image and have a command that just installs them, and have the install system image script detect the installed packages and install them in the new image too. But it would require implementing this.

The other alternative is to just include all non-free firmware by default as it was in crux (1.2).

Adding custom install firmware command may be a good way. I tried to manually compile and upload firmware to vyos before.

@jjakob installing all firmware files will again bload the image. As said - root cause must be determined why that particular file did not end up in the image. The repo holds the firmware in question (https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/iwlwifi-3945-2.ucode) so I'm currently debugging why it's not shipped.

For driver firmware, it's just a ko file, which can then be used by setting the boot in the configuration directory to automatically load the kernel file, or by using the following command:

depmod
modprobe myko

Considering the general Linux, the path of this driver and kernel component is usually:

/lib/modules/`uname -r`/kernel/driver/mymod/

Okay, the file is correctly installed, the question is, why the firmware is not accepted by the card. So there is no bug in general of the build system.

  • It would be nice to know the users VyOS version
  • Did upgrade to latest rolling work?
  • Is there probably an intra firmware dependency on another file?

For driver firmware, it's just a ko file, which can then be used by setting the boot in the configuration directory to automatically load the kernel file, or by using the following command:

depmod
modprobe myko

Considering the general Linux, the path of this driver and kernel component is usually:

/lib/modules/`uname -r`/kernel/driver/mymod/

That has nothing to do with the mentioned issue. Please stop just writing random stuff which does not lead to the resolution of a problem. We clearly have all files in place (at least based on the Kernel source because this is where we extract our information from.

@jjakob comparing SHA1 sums from both firmware files there is no difference, so it looks like somewhat of a dependency issue here. Another idea would be to add firmware files one by one and see which one solved the issue.

firmware-iwlwifi_20190114-2_all.deb
0de61f8003c5e71336719ec1653ebe2990e05095 iwlwifi-3945-2.ucode

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git tag 20191022
0de61f8003c5e71336719ec1653ebe2990e05095 iwlwifi-3945-2.ucode

This is the users dmesg with failed firmware load

[   21.951100] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[   21.951932] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000-6.ucode failed with error -2
[   21.951961] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000-5.ucode failed with error -2
[   21.951982] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000-4.ucode failed with error -2
[   21.951985] iwlwifi 0000:03:00.0: no suitable firmware found!
[   21.958303] iwlwifi 0000:03:00.0: minimum version required: iwlwifi-6000-4
[   21.967817] iwlwifi 0000:03:00.0: maximum version supported: iwlwifi-6000-6
[   21.975992] iwlwifi 0000:03:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

this is after manually extracting firmware-iwlwifi

[   22.020346] Intel(R) Wireless WiFi driver for Linux
[   22.021468] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[   22.023015] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000-6.ucode failed with error -2
[   22.023265] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000-5.ucode failed with error -2
[   22.043622] iwlwifi 0000:03:00.0: loaded firmware version 9.221.4.1 build 25532 op_mode iwldvm
[   22.337007] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG disabled
[   22.337010] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled
[   22.337011] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[   22.337012] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Advanced-N 6200 AGN, REV=0x74
[   33.205072] iwlwifi 0000:03:00.0: Radio type=0x1-0x3-0x1
[   33.446446] iwlwifi 0000:03:00.0: Radio type=0x1-0x3-0x1

Unfortunately I can't debug this further as the user isn't on irc any more.

You may use dpkg to unpack and install according to the following information:

dpkg: error processing archive /var/cache/apt/archives/firmware-iwlwifi_20190114-2_all.deb (--unpack):
trying to overwrite '/lib/firmware/iwlwifi-3945-2.ucode', which is also in package vyos-linux-firmware 20191022

It can be seen that the file /lib/firmware/iwlwifi-3945-2.ucode is stored in package vyos-linux-firmware, which will lead to dpkg unpacking conflict.

Although I am not sure my judgment and preconditions are correct, if not, please forgive me. I judge according to the error information output by him and the basic method of manual installation of Linux device driver. At least I have installed USB wireless device driver (although the wireless network card cannot enter the normal AP launching state and perform user login verification due to the compatibility problem of hostapd, the operation fails), but I can confirm that the device driver installed manually is connected It can work normally (without dpkg unpacking).

edit: Unless there is a firmware error or ABI compatibility issue.

@jjakob by a weird coincidence I yesterday received a Thinkpad T420s which shows the exact same error.

c-po lowered the priority of this task from Normal to Low.
c-po changed Version from - to 1.3-rolling-202006140117.

Okay, root cause is the extraction script which parses the Kernel source for included source/object files.

(11:55) vyos_bld 5326bdecec66:/vyos/vyos-build-kernel [master] # ./list-required-firmware.py -k linux -c x86_64_vyos_defconfig -s drivers/net/wireless/intel
drivers/net/wireless/intel/ipw2x00/ipw2200.c
drivers/net/wireless/intel/ipw2x00/ipw2100.c
drivers/net/wireless/intel/iwlegacy/4965.c
drivers/net/wireless/intel/iwlegacy/3945-mac.c

https://github.com/vyos/vyos-build-kernel/blob/master/list-required-firmware.py

It currently can not handle subdirectories as used by Intel drivers:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/wireless/intel/iwlwifi/Makefile?h=v4.19.128#n12

Here a dirver from a subdir is pulled in and not detected by @dmbaturin s script.

c-po removed c-po as the assignee of this task.Jun 14 2020, 2:51 PM
c-po claimed this task.
erkin set Issue type to Improvement (missing useful functionality).Aug 30 2021, 5:31 AM
erkin removed a subscriber: Active contributors.