Linux-Kernel

我正在嘗試安裝驅動程序,核心給了我這個錯誤:

  • April 2, 2022

我正在嘗試安裝驅動程序,核心給了我這個錯誤:

Kernel preparation unnecessary for this kernel.  Skipping...


Building module:

cleaning build area...

make -j1 KERNELRELEASE=5.10.0-kali6-amd64 KVER=5.10.0-kali6-amd64...(bad exit status: 2)

Error! Bad return status for module build on kernel: 5.10.0-kali6-amd64 (x86_64)

Consult /var/lib/dkms/rtl88x2bu/5.2.4.4/build/make.log for more information.

我正在使用 Realtek 的 rtl8812bu

有什麼辦法可以解決這個問題嗎?

這是錯誤日誌:

DKMS make.log for rtl88x2bu-5.2.4.4 for kernel 5.10.0-kali6-amd64 (x86_64)

Thu 08 Apr 2021 05:19:05 AM CDT

/bin/sh: 1: bc: not found

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.0-kali6-amd64/build M=/var/lib/dkms/rtl88x2bu/5.2.4.4/build  modules

make[1]: Entering directory '/usr/src/linux-headers-5.10.0-kali6-amd64'

/bin/sh: 1: bc: not found

 CC [M]  /var/lib/dkms/rtl88x2bu/5.2.4.4/build/core/rtw_cmd.o

In file included from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/include/drv_types.h:77,

                from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/core/rtw_cmd.c:17:

/var/lib/dkms/rtl88x2bu/5.2.4.4/build/include/rtw_security.h:246:8: error: redefinition of ‘struct sha256_state’

 246 | struct sha256_state {

     |        ^~~~~~~~~~~~

In file included from /usr/src/linux-headers-5.10.0-kali6-common/include/linux/filter.h:24,

                from /usr/src/linux-headers-5.10.0-kali6-common/include/net/sock.h:59,

                from /usr/src/linux-headers-5.10.0-kali6-common/include/linux/tcp.h:19,

                from /usr/src/linux-headers-5.10.0-kali6-common/include/linux/ipv6.h:87,

                from /usr/src/linux-headers-5.10.0-kali6-common/include/net/addrconf.h:50,

                from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/include/osdep_service_linux.h:51,

                from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/include/osdep_service.h:42,

                from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/include/drv_types.h:27,

                from /var/lib/dkms/rtl88x2bu/5.2.4.4/build/core/rtw_cmd.c:17:

/usr/src/linux-headers-5.10.0-kali6-common/include/crypto/sha.h:84:8: note: originally defined here

  84 | struct sha256_state {

     |        ^~~~~~~~~~~~

make[3]: *** [/usr/src/linux-headers-5.10.0-kali6-common/scripts/Makefile.build:284: /var/lib/dkms/rtl88x2bu/5.2.4.4/build/core/rtw_cmd.o] Error 1

make[2]: *** [/usr/src/linux-headers-5.10.0-kali6-common/Makefile:1821: /var/lib/dkms/rtl88x2bu/5.2.4.4/build] Error 2

make[1]: *** [/usr/src/linux-headers-5.10.0-kali6-common/Makefile:185:
__sub-make] Error 2

make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-kali6-amd64'

make: *** [Makefile:1795: modules] Error 2

對於 5.10 核心,請使用此git 儲存庫

sudo apt update
sudo apt install -y dkms git bc
git clone -b v5.6.1 https://github.com/fastoe/RTL8812BU.git
cd RTL8812BU
make
sudo make install
sudo reboot

引用自:https://unix.stackexchange.com/questions/644112