我是 Kali 新手,我在 StackExchange 中看到有人告诉我按照以下步骤修复它。我尝试过,但收到以下错误。我认为我的情况下固件有问题,请帮忙
提供的解决方案:
几乎所有的惠普笔记本电脑都有这个问题,这是 WiFi 适配器只有一根天线,所以你需要安装不同的固件。我必须一次又一次地这样做,所以我做了一个脚本。使用 USB 网络共享插入以太网连接并
fixwifi.sh
使用创建一个文件
nano fixwifi.sh
复制内容
apt install linux-headers-$(uname -r) git build-essential dkms
git clone git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
sudo dkms add ./rtlwifi_new
sudo dkms install rtlwifi-new/0.6
sudo modprobe -r rtl8723de && sudo modprobe rtl8723de
echo "options rtl8723de ant_sel=2" | sudo tee /etc/modprobe.d/rtl8723de.conf
保存文件
Ctrl+S和Ctrl+X
使用执行它
chmod +x fixwifi.sh && ./fixwifi.sh
现在就可以走了。
Error:Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8).
dkms is already the newest version (2.8.2-2).
git is already the newest version (1:2.27.0-1).
linux-headers-5.6.0-kali2-amd64 is already the newest version (5.6.14-2kali1).
0 upgraded, 0 newly installed, 0 to remove and 884 not upgraded.
fatal: Too many arguments.
用法:git clone [<options>] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
--progress force progress reporting
-n, --no-checkout don't create a checkout
--bare create a bare repository
--mirror create a mirror repository (implies bare)
-l, --local to clone from a local repository
--no-hardlinks don't use local hardlinks, always copy
-s, --shared setup as shared repository
--recurse-submodules[=<pathspec>]
initialize submodules in the clone
--recursive ... alias of --recurse-submodules
-j, --jobs <n> number of submodules cloned in parallel
--template <template-directory>
directory from which templates will be used
--reference <repo> reference repository
--reference-if-able <repo>
reference repository
--dissociate use --reference only while cloning
-o, --origin <name> use <name> instead of 'origin' to track upstream
-b, --branch <branch>
checkout <branch> instead of the remote's HEAD
-u, --upload-pack <path>
path to git-upload-pack on the remote
--depth <depth> create a shallow clone of that depth
--shallow-since <time>
create a shallow clone since a specific time
--shallow-exclude <revision>
deepen history of shallow clone, excluding rev
--single-branch clone only one branch, HEAD or --branch
--no-tags don't clone any tags, and make later fetches not to follow them
--shallow-submodules any cloned submodules will be shallow
--separate-git-dir <gitdir>
separate git dir from working tree
-c, --config <key=value>
set config inside the new repository
--server-option <server-specific>
option to transmit
-4, --ipv4 use IPv4 addresses only
-6, --ipv6 use IPv6 addresses only
--filter <args> object filtering
--remote-submodules any cloned submodules will use their remote-tracking branch
--sparse initialize sparse-checkout file to include only files at root
错误!
Could not find module source directory.
Directory: /usr/src/.-rtlwifi_new does not exist.
Error! Could not find module source directory.
Directory: /usr/src/rtlwifi-new-0.6 does not exist.
modprobe: FATAL: Module rtl8723de not found.
options rtl8723de ant_sel=2
我的$ lspci -vq
结果
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
DeviceName: Hanksville Gbe Lan Connection
Subsystem: Hewlett-Packard Company RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Flags: bus master, fast devsel, latency 0, IRQ 16
I/O ports at 4000 [size=256]
Memory at b1104000 (64-bit, non-prefetchable) [size=4K]
Memory at b1100000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
Capabilities: [170] Latency Tolerance Reporting
Capabilities: [178] L1 PM Substates
Kernel driver in use: r8169
Kernel modules: r8169
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723DE 802.11b/g/n PCIe Adapter
DeviceName: Hanksville Gbe Lan Connection
Subsystem: Hewlett-Packard Company RTL8723DE 802.11b/g/n PCIe Adapter
Flags: bus master, fast devsel, latency 0, IRQ 11
I/O ports at 3000 [size=256]
Memory at b1000000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Virtual Channel
Capabilities: [168] Device Serial Number 00-e0-4c-00-00-00-00-00
Capabilities: [178] Latency Tolerance Reporting
Capabilities: [180] L1 PM Substates
Kernel modules: wl
iwconfig results:
lo no wireless extensions.
eth0 no wireless extensions.
usb0 no wireless extensions.
wlan0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
wlan1 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
hwsim0 no wireless extensions.
ifconfig results:
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 18:60:24:14:83:0b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 556 (556.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 556 (556.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.42.53 netmask 255.255.255.0 broadcast 192.168.42.255
inet6 2401:4900:2586:2d5e:d805:78ff:fe65:65b3 prefixlen 64 scopeid 0x0<global>
inet6 fe80::d805:78ff:fe65:65b3 prefixlen 64 scopeid 0x20<link>
inet6 2401:4900:2586:2d5e:fd3a:dc44:a795:21ca prefixlen 64 scopeid 0x0<global>
ether da:05:78:65:65:b3 txqueuelen 1000 (Ethernet)
RX packets 32851 bytes 37101808 (35.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 21202 bytes 3335363 (3.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 52:fd:b2:36:a8:38 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 72:06:d6:de:52:48 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
答案1
第一个实际的错误消息是:
fatal: Too many arguments.
usage: git clone [<options>] [--] <repo> [<dir>]
[... rest of git usage message omitted ...]
git clone
这应该告诉您脚本中的命令中不应该出现某些内容。相关行是:
git clone git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
不git clone
应该这样重复。
随后的错误消息是由第一次失败引起的:因为git
无法下载rtl8723de
模块的源代码,所以旨在编译该源代码并安装生成的驱动程序的命令当然也会失败。
您的lspci -vq
输出还表明wl
驱动程序当前正在使用您的 RTL8723DE 卡,并且脚本不会对此进行任何更改。
如果你实际上阅读脚本将下载的驱动程序的 GitHub 页面,你会看到这样的文字:
该仓库的主分支已被正式放弃。如果您运行的内核版本高于 5.0,请使用内核中内置的驱动程序。这样工作量就少了很多。
如果您查看脚本尝试使用的分支的子页面extended
,您还会发现:
该存储库的扩展分支已被正式放弃。如果您运行的内核版本高于 5.0,请使用内核中内置的驱动程序。这样工作量就少了很多。
两个分支还包含以下建议:
如果您使用的是 Realtek RTL8723DE、RTL8822BE、RTL8822CE 或 RTL8821CE,则需要 rtw88 分支:
这建议您尝试使用的建议和脚本可能已经过时了自从编写建议和脚本以来,Kali 中的驱动程序开发和内核版本都在不断进步。
但如果您仍然想尝试这个驱动程序,我建议修改该脚本的版本:
apt install linux-headers-$(uname -r) git build-essential dkms
git clone -b rtw88 https://github.com/lwfinger/rtlwifi_new.git
sudo dkms add ./rtlwifi_new
sudo dkms install rtlwifi-new/0.6
echo "options rtl8723de ant_sel=2" | sudo tee /etc/modprobe.d/rtl8723de.conf
echo "blacklist wl" | sudo tee -a /etc/modprobe.d/rtl8723de.conf
sudo modprobe -r rtl8723de wl && sudo modprobe rtl8723de
因此,线上的修改git clone
将删除重复的命令,并将驱动程序的分支从废弃更改extended
为当前推荐的rtw88
。我为您当前的wl
驱动程序添加了黑名单,以便新rt8723de
模块能够取代它。我还稍微更改了操作顺序,这样如果模块实际上无需重新启动即可加载,它也会选择该ant_sel=2
选项。但由于该卡已经处于活动状态,该脚本可能无法卸载旧驱动程序,因此您可能需要在运行脚本后重新启动。
如果您发现新的驱动程序根本不起作用,将系统配置返回到起点的方法是:
sudo rm /etc/modprobe.d/rtl8723de.conf
sudo dkms remove rtlwifi-new/0.6 --all