Linux from Scratch:无法连接家庭 WLAN

Linux from Scratch:无法连接家庭 WLAN

我开始构建 LFS 以了解有关 Linux 内部的更多信息。我费了好大劲才配置好 WLAN,但甚至无法缩小问题范围。我的笔记本电脑有双启动(ubuntu 22 和 LFS 11.3),在 ubuntu 上我的 WLAN 运行良好,因此这里没有硬件问题。

在 Ubuntu 上:

$ sudo lspci -v | grep -i "Network controller" -A 11
00:14.3 Network controller: Intel Corporation Comet Lake PCH-LP CNVi WiFi
    Subsystem: Intel Corporation Wi-Fi 6 AX201 160MHz
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at d1418000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [c8] Power Management version 3
    Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
    Capabilities: [80] MSI-X: Enable+ Count=16 Masked-
    Capabilities: [100] Latency Tolerance Reporting
    Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 <?>
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi

显然有一个 wlan-interface

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:2b:67:21:eb:fe brd ff:ff:ff:ff:ff:ff
3: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 40:ec:99:1f:d7:f4 brd ff:ff:ff:ff:ff:ff

我可以在 /proc/net/wireless 中看到它

$ sudo cat /proc/net/wireless 
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp0s20f3: 0000   67.  -43.  -256        0      0      0      0    198    

在 LFS 11.3 上我找不到这个界面

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:2b:67:21:eb:fe brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0

/proc/net/wireless 没有显示任何设备

$ cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22

如果我比较 lsmod 的输出,可能会提示缺少 cfg80211

在 Ubuntu 上:

$ lsmod | grep iwlwifi
iwlwifi               503808  1 iwlmvm
cfg80211             1052672  3 iwlmvm,iwlwifi,mac80211

在 LFS 11.3 上:

$ lsmod
Module                  Size  Used by
x86_pkg_temp_thermal    20480  0
iwlwifi               454656  0

但是,我不明白为什么它消失了,因为我必须用这些选项重新编译内核

[*] Networking support  --->                              [CONFIG_NET]
  [*] Wireless  --->                                      [CONFIG_WIRELESS]
    <*/M> cfg80211 - wireless configuration API           [CONFIG_CFG80211]
    [*]     cfg80211 wireless extensions compatibility    [CONFIG_CFG80211_WEXT]
    <*/M> Generic IEEE 802.11 Networking Stack (mac80211) [CONFIG_MAC80211]
Device Drivers  --->
  [*] Network device support  --->                        [CONFIG_NETDEVICES]
    [*] Wireless LAN  --->                                [CONFIG_WLAN]

安装wpa_supplicant-2.10

提前致谢

答案1

当比较 ubuntu 和 lfs 的 dmesg 输出时,我意识到 lfs 的 dmesg 包含非常精确的错误:

[    3.796496] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-72.ucode failed with error -2
[    3.797314] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-71.ucode failed with error -2
[    3.797326] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-70.ucode failed with error -2
[    3.797335] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-69.ucode failed with error -2

...
...
...

[    3.797584] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-40.ucode failed with error -2
[    3.797599] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-39.ucode failed with error -2
[    3.797600] iwlwifi 0000:00:14.3: no suitable firmware found!

我在英特尔的网页上没有找到合适的固件,但将固件从 ubuntu 复制/lib/firmware到 lfs /lib/firmware确实有帮助。

但是,我还是不明白 ubuntu 如何确定他们需要什么固件。

相关内容