void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.6k stars 2.17k forks source link

dkms modules fail to build on raspberry pi (missing arm64 aarch64 symlink) #24106

Closed SumGR closed 3 years ago

SumGR commented 4 years ago

I'm using the void Linux image for the raspberry pi3. I'm trying to load an external USB Wi-Fi module. The rtl8822bu-dkms fails to build because it's looking for aarch64 kernel headers.

xbps-install -S rtl8822bu-dkms-20200407_1
...
...
rtl8822bu-dkms-20200407_1: configuring ...
DKMS module '88x2bu-20200407' already added, skipping.
Building DKMS module '88x2bu-20200407' for kernel-4.19.127_2... FAILED!
DKMS module '88x2bu-20200407' failed to build, please check /var/lib/dkms
for errors in the log file.

The DKMS build logs show this:

cat /var/lib/dkms/88x2bu/20200407/build/make.log 
DKMS make.log for 88x2bu-20200407 for kernel 5.7.13_1 (aarch64)
Wed 05 Aug 2020 07:19:42 PM UTC
/bin/sh: 1: bc: not found
make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/5.7.13_1/build M=/var/lib/dkms/88x2bu/20200407/build  modules
make[1]: Entering directory '/usr/src/kernel-headers-5.7.13_1'
Makefile:669: arch/aarch64/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/aarch64/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/kernel-headers-5.7.13_1'
make: *** [Makefile:2001: modules] Error 2

I tried installing the rpi-kernel-headers package, but it seems to place all the headers in /usr/src/rpi-kernel-headers-4.19.127_2 under the arch of arm64 instead of aarch64

I ran the following to get the module to build:

cd /usr/src/rpi-kernel-headers-4.19.127_2/
ln -s arm64 aarch64
xbps-install -Sf rtl8822bu-dkms-20200407_1

This seems to affect other dkms modules as well. Should the rpi-kernel-headers package be patched to always have this symbolic link so dkms modules can build? or is this something that should be fixed (or is fixed) upstream in dkms?

Kernel: Linux void-live 4.19.127_2 #1 SMP PREEMPT Fri Jul 17 14:28:57 UTC 2020 aarch64 GNU/Linux Package: rtl8822bu-dkms-20200407_1

ericonr commented 4 years ago

@pbui @Piraty

Piraty commented 3 years ago

I recall this issue came up once before ..? passing ARCH=aarch64 is wrong, it's named arm64 in the kernel

Piraty commented 3 years ago

as pointed out by @pbui on IRC, there's a note in the project's readme about non-x86 archs. that makefile should be patched to pick the correct karch