Page MenuHomeFreeBSD

net/wifi-firmware-kmod: stop building kmods on main
ClosedPublic

Authored by bz on Oct 11 2024, 8:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 7:29 PM
Unknown Object (File)
Fri, Nov 1, 9:43 PM
Unknown Object (File)
Fri, Nov 1, 7:49 AM
Unknown Object (File)
Fri, Nov 1, 7:04 AM
Unknown Object (File)
Fri, Oct 25, 5:25 PM
Unknown Object (File)
Sat, Oct 19, 8:07 PM
Subscribers

Details

Summary

In feb 2024 a feature to firmware(9) was introduced to be able to load
plain firmware files (not kernel modules) from /boot/firmware/ .
If the system is modern enough stop building kernel modules but simply
copy the firmware files in. This makes the entire build process a lot
simpler.
For older versions we still have to generate kernel modules for the
forseeable future.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 59959
Build 56844: arc lint + arc unit

Event Timeline

bz requested review of this revision.Oct 11 2024, 8:45 PM
bz created this revision.
fernape added inline comments.
net/wifi-firmware-kmod/Makefile.inc
153

Can the above be just NO_BUILD= yes in the if enclosed in line 87?

Use NO_BUILD= as suggested by @fernape

bz marked an inline comment as done.Oct 13 2024, 8:36 PM

Bjoern,

I built the wifi ports on a CURRENT system built after the February changes using poudriere bulk -t -C -i -j 15amd64 -f ~/wifi_ports.txt. Based on your changes, I expected the files to be installed under /boot/firmware. However this is what I see.

$ make -VOSVERSION
1500021

$ pkg info
pkg-1.21.3                     Package manager
wifi-firmware-ath10k-kmod-qca6174_hw21-20240513 Firmware modules for the ath10k (qca6174_hw21) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca6174_hw30-20240513 Firmware modules for the ath10k (qca6174_hw30) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca9377_hw10-20240513 Firmware modules for the ath10k (qca9377_hw10) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca9887_hw10-20240513 Firmware modules for the ath10k (qca9887_hw10) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca9888_hw20-20240513 Firmware modules for the ath10k (qca9888_hw20) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca988x_hw20-20240513 Firmware modules for the ath10k (qca988x_hw20) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca9984_hw10-20240513 Firmware modules for the ath10k (qca9984_hw10) WiFi NIC driver
wifi-firmware-ath10k-kmod-qca99x0_hw20-20240513 Firmware modules for the ath10k (qca99x0_hw20) WiFi NIC driver
wifi-firmware-ath11k-kmod-qca6390_hw20-20240513 Firmware modules for the ath11k (qca6390_hw20) WiFi NIC driver
wifi-firmware-ath11k-kmod-qcn9074_hw10-20240513 Firmware modules for the ath11k (qcn9074_hw10) WiFi NIC driver
wifi-firmware-ath11k-kmod-wcn6855_hw20-20240513 Firmware modules for the ath11k (wcn6855_hw20) WiFi NIC driver
wifi-firmware-ath12k-kmod-wcn7850_hw20-20240513 Firmware modules for the ath12k (wcn7850_hw20) WiFi NIC driver
wifi-firmware-iwlwifi-kmod-22000-20240513 Firmware modules for the iwlwifi (22000) WiFi NIC driver
wifi-firmware-iwlwifi-kmod-7000-20240513 Firmware modules for the iwlwifi (7000) WiFi NIC driver
wifi-firmware-iwlwifi-kmod-8000-20240513 Firmware modules for the iwlwifi (8000) WiFi NIC driver

$ ls -lah /boot/firmware
total 9
drwxr-xr-x   2 root wheel    2B Jul 18 13:36 .
drwxr-xr-x  14 root wheel   71B Jul 25 10:51 ..

$ pkg info -l wifi-firmware-iwlwifi-kmod-22000-20240513
wifi-firmware-iwlwifi-kmod-22000-20240513:
        /boot/modules/iwlwifi_QuZ_a0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_QuZ_a0_jf_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_b0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_b0_jf_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_c0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_cc_a0_77_ucode.ko
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/LICENSE
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/catalog.mk
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/primary
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/whence

Also, if I build the ports individually with, e.g., poudriere testport -i -j 15amd64 net/wifi-firmware-iwlwifi-kmod it fails with a plist error.

====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: /boot/modules/iwlwifi_3160_17_ucode.ko
Error: Missing: /boot/modules/iwlwifi_3168_29_ucode.ko
Error: Missing: /boot/modules/iwlwifi_7260_17_ucode.ko
Error: Missing: /boot/modules/iwlwifi_7265D_29_ucode.ko
Error: Missing: /boot/modules/iwlwifi_7265_17_ucode.ko
Error: Missing: /boot/modules/iwlwifi_8000C_36_ucode.ko
Error: Missing: /boot/modules/iwlwifi_8265_36_ucode.ko
Error: Missing: /boot/modules/iwlwifi_9000_pu_b0_jf_b0_46_ucode.ko
Error: Missing: /boot/modules/iwlwifi_9260_th_b0_jf_b0_46_ucode.ko
Error: Missing: /boot/modules/iwlwifi_QuZ_a0_hr_b0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_QuZ_a0_jf_b0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_Qu_b0_hr_b0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_Qu_b0_jf_b0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_Qu_c0_hr_b0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_cc_a0_77_ucode.ko
Error: Missing: /boot/modules/iwlwifi_gl_c0_fm_c0_83_ucode.ko
Error: Missing: /boot/modules/iwlwifi_gl_c0_fm_c0_pnvm.ko
Error: Missing: /boot/modules/iwlwifi_ma_b0_gf4_a0_89_ucode.ko
Error: Missing: /boot/modules/iwlwifi_ma_b0_gf4_a0_pnvm.ko
Error: Missing: /boot/modules/iwlwifi_ma_b0_gf_a0_89_ucode.ko
Error: Missing: /boot/modules/iwlwifi_ma_b0_gf_a0_pnvm.ko
Error: Missing: /boot/modules/iwlwifi_ma_b0_hr_b0_83_ucode.ko
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped making "check-plist" in /usr/ports/net/wifi-firmware-iwlwifi-kmod

I'll try to investigate the issue, but it may take me a day or two.

In D47068#1074926, @jrm wrote:

Bjoern,

I built the wifi ports on a CURRENT system built after the February changes using poudriere bulk -t -C -i -j 15amd64 -f ~/wifi_ports.txt. Based on your changes, I expected the files to be installed under /boot/firmware. However this is what I see.

$ ls -lah /boot/firmware
total 9
drwxr-xr-x   2 root wheel    2B Jul 18 13:36 .
drwxr-xr-x  14 root wheel   71B Jul 25 10:51 ..

$ pkg info -l wifi-firmware-iwlwifi-kmod-22000-20240513
wifi-firmware-iwlwifi-kmod-22000-20240513:
        /boot/modules/iwlwifi_QuZ_a0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_QuZ_a0_jf_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_b0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_b0_jf_b0_77_ucode.ko
        /boot/modules/iwlwifi_Qu_c0_hr_b0_77_ucode.ko
        /boot/modules/iwlwifi_cc_a0_77_ucode.ko
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/LICENSE
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/catalog.mk
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/primary
        /usr/local/share/licenses/wifi-firmware-iwlwifi-kmod-22000-20240513/whence

This one is without the port update (one of the other reviews):

% pkg info -l wifi-firmware-rtw89-kmod-20240513
wifi-firmware-rtw89-kmod-20240513:
        /boot/firmware/rtw89/rtw8851b_fw.bin
        /boot/firmware/rtw89/rtw8852a_fw.bin
        /boot/firmware/rtw89/rtw8852b_fw-1.bin
        /boot/firmware/rtw89/rtw8852c_fw.bin
        /boot/firmware/rtw89/rtw8922a_fw.bin
        /usr/local/share/licenses/wifi-firmware-rtw89-kmod-20240513/LICENSE
        /usr/local/share/licenses/wifi-firmware-rtw89-kmod-20240513/catalog.mk
        /usr/local/share/licenses/wifi-firmware-rtw89-kmod-20240513/primary
        /usr/local/share/licenses/wifi-firmware-rtw89-kmod-20240513/whence
% ls -l /boot/firmware/
total 4
drwxr-xr-x  2 root wheel 512 Oct 11 20:38 rtw89
% ls -l /boot/firmware/rtw89/
total 6944
-r--r--r--  1 root wheel 1162024 Oct 11 20:34 rtw8851b_fw.bin
-r--r--r--  1 root wheel 1423232 Oct 11 20:34 rtw8852a_fw.bin
-r--r--r--  1 root wheel 1242808 Oct 11 20:34 rtw8852b_fw-1.bin
-r--r--r--  1 root wheel 1532656 Oct 11 20:34 rtw8852c_fw.bin
-r--r--r--  1 root wheel 1537690 Oct 11 20:34 rtw8922a_fw.bin

Also, if I build the ports individually with, e.g., poudriere testport -i -j 15amd64 net/wifi-firmware-iwlwifi-kmod it fails with a plist error.

...

> Error: Plist issues found.

  • Error code 1

Stop.
make: stopped making "check-plist" in /usr/ports/net/wifi-firmware-iwlwifi-kmod

Is that with the other change on top already or just with this one?

I'll try to investigate the issue, but it may take me a day or two.

Can pourdiere still be used without ZFS? I think I should setup myself with such a system somehow as it seems to yield different results to calling make in the ports tree

In D47068#1075044, @bz wrote:

Is that with the other change on top already or just with this one?

Just this one. I wasn't aware that this review depended on another. I'll stack them and test again later.

Can pourdiere still be used without ZFS? I think I should setup myself with such a system somehow as it seems to yield different results to calling make in the ports tree

There is a NO_ZFS=yes knob for poudriere.conf. I've only used poudriere with ZFS, so cannot comment on how well it works.

In D47068#1075045, @jrm wrote:
In D47068#1075044, @bz wrote:

Is that with the other change on top already or just with this one?

Just this one. I wasn't aware that this review depended on another. I'll stack them and test again later.

They should all build by itself one after the other. The update depends on this one to be applied; I should open a stack.

Can pourdiere still be used without ZFS? I think I should setup myself with such a system somehow as it seems to yield different results to calling make in the ports tree

There is a NO_ZFS=yes knob for poudriere.conf. I've only used poudriere with ZFS, so cannot comment on how well it works.

I'll go and have a look.

bz added a subscriber: rene.

This now seems to build on amd64 14.1-R and main under poudriere for me.

Problems solved:

  • do not add the .ko files to the PLIST if we do not build kmods anymore (use a PLIST file for symmetry in both cases)
  • set SSP_UNSAFE as otherwise on the 14.1-R I got a build error
  • pull the USES[+=kmod] back out before the .include <bsd.port.pre.mk> as otherwise logic does not work correctly and the stage dir is not created because _USES_install+= from kmod.mk are not added (emailed @rene).

Also added OSVERSION checks for the next __FreeBSD_version bump in stable/14 to catch the direct firmware file loading there too.
Sent a email to ports@ for clarification if this will actually work for package builders before 14.1-R expires and we'll build on 14.2.

Fix PLIST for the plain firmware file case.

Also remove the SSP_UNSAFE= again as that was also caused by the
USES vs. kmod vs. bsd.port.pre.mk problem it seems.

Need to disect the results still but pouder with -t was happy again.

net/wifi-firmware-kmod/Makefile.inc
105

@imp I had used the next version proactively; I agree which should switch that to 1401504 to 1402000 now given 1401504 was never used.

Change the 14-branch __FreeBSD_verison naumber to check to one actually used (and documented)

This revision is now accepted and ready to land.Fri, Nov 1, 12:37 AM
imp added inline comments.
net/wifi-firmware-kmod/Makefile.inc
105

I came here to suggest this very thing