brektrou / rtl8821CU

Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux
GNU General Public License v2.0
1.59k stars 460 forks source link

RaspBerry Pi 4B / Raspbian Buster Make fail: Error! Bad return status for module build on kernel: 4.19.97-v7l+ (armv7l) #48

Closed zambalee closed 4 years ago

zambalee commented 4 years ago

Hardware: Raspberry Pi 4B; OS: Raspbian Buster;

Process: 1. Install tools apt install -y gcc linux-header git dkms

2. Clone driver git clone https://github.com/brektrou/rtl8821CU.git

3. Install use dkms-install.sh root@raspberrypi:~/rtl8821CU# ./dkms-install.sh About to run dkms install steps... Creating symlink /var/lib/dkms/rtl8821CU/5.4.1/source -> /usr/src/rtl8821CU-5.4.1 DKMS: add completed. Kernel preparation unnecessary for this kernel. Skipping... Building module: cleaning build area... 'make' KVER=4.19.97-v7l+...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.19.97-v7l+ (armv7l) Consult /var/lib/dkms/rtl8821CU/5.4.1/build/make.log for more information.

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... 'make' KVER=4.19.97-v7l+...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.19.97-v7l+ (armv7l) Consult /var/lib/dkms/rtl8821CU/5.4.1/build/make.log for more information. Finished running dkms install steps.

4. Error log

root@raspberrypi:~/rtl8821CU# more /var/lib/dkms/rtl8821CU/5.4.1/build/make.log DKMS make.log for rtl8821CU-5.4.1 for kernel 4.19.97-v7l+ (armv7l) Sun 29 Mar 09:50:52 BST 2020 /bin/sh: 1: bc: not found make ARCH=armv7l CROSS_COMPILE= -C /lib/modules/4.19.97-v7l+/build M=/var/lib/dkms/rtl8821CU/5.4.1/build modules make[1]: Entering directory '/usr/src/linux-headers-4.19.97-v7l+' Makefile:614: arch/armv7l/Makefile: No such file or directory make[1]: No rule to make target 'arch/armv7l/Makefile'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.19.97-v7l+' make: [Makefile:2213: modules] Error 2

rrafal1337 commented 4 years ago

Hi. You forgot to install bc package.

apt install bc
zambalee commented 4 years ago

Hi Rafał,

Thanks for your help! But after installed "bc" by using "apt install -y bc", the same error still appears:

Platform Detail

root@raspberrypi:~/rtl8821CU# ./dkms-install.sh About to run dkms install steps... Error! DKMS tree already contains: rtl8821CU-5.4.1 You cannot add the same module/version combo more than once.

Kernel preparation unnecessary for this kernel. Skipping . . .

Building module: cleaning build area... 'make' KVER=4.19.97-v7l+...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.19.97-v7l+ (armv7l) Consult /var/lib/dkms/rtl8821CU/5.4.1/build/make.log for more information.

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... 'make' KVER=4.19.97-v7l+...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.19.97-v7l+ (armv7l) Consult /var/lib/dkms/rtl8821CU/5.4.1/build/make.log for more information. Finished running dkms install steps.

root@raspberrypi:~/rtl8821CU# more /var/lib/dkms/rtl8821CU/5.4.1/build/make.log DKMS make.log for rtl8821CU-5.4.1 for kernel 4.19.97-v7l+ (armv7l) Sun 29 Mar 16:35:20 BST 2020 make ARCH=armv7l CROSS_COMPILE= -C /lib/modules/4.19.97-v7l+/build M=/var/lib/dk ms/rtl8821CU/5.4.1/build modules make[1]: Entering directory '/usr/src/linux-headers-4.19.97-v7l+' Makefile:614: arch/armv7l/Makefile: No such file or directory make[1]: No rule to make target 'arch/armv7l/Makefile'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.19.97-v7l+' make: [Makefile:2213: modules] Error 2

rrafal1337 commented 4 years ago

It seems that installation bc helped and you won't have same error again. This time there error is related to missing directory in kernel sources and you must follow instruction from readme file about avoiding errors during compilation. https://github.com/brektrou/rtl8821CU/#arm-architecture-tweak-for-this-driver-this-solves-compilation-problem-of-this-driver

zambalee commented 4 years ago

Sorry for that, just missing the whole big picture......

Thanks for your help! I should read the manual more carefully, now it works fine, thanks again!

Zamba