4

I'm trying to use DKMS to build a module. My problem is that I cannot seem to make DKMS pass the right ARCH to 'make'. It keeps using the architecture of the my OS's kernel which is armv7l. But there's no map
/usr/src/linux/arch/armv7l
It needs to look inside
/usr/src/linux/arch/arm

I have tried passing -a arm, -k 4.4.21-v7+/arm as arguments to 'dkms build', but it doesn't pass that down to 'make'. Adding BUILD_EXCLUSIVE_ARCH="arm" to /usr/src/rtl8812AU-4.3.14/dkms.conf also makes no difference.

sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k 4.4.21-v7+/arm

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
'make'....(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.4.21-v7+ (arm)
Consult /var/lib/dkms/rtl8812AU/4.3.14/build/make.log for more information.

cat /var/lib/dkms/rtl8812AU/4.3.14/build/make.log

DKMS make.log for rtl8812AU-4.3.14 for kernel 4.4.21-v7+ (arm)
Thu Sep 29 16:36:07 UTC 2016
make ARCH=armv7l CROSS_COMPILE= -C /lib/modules/4.4.21-v7+/build M=/var/lib/dkms/rtl8812AU/4.3.14/build modules
make[1]: Entering directory '/usr/src/linux'
Makefile:606: 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'
Makefile:1576: recipe for target 'modules' failed
make: [modules] Error 2

How to solve this?
Thank you already

Yuri Borges
  • 315
  • 4
  • 14

2 Answers2

6

I solved this problem on a Raspberry Pi 2 with Ubuntu Mate (16.04) by symlinking the arm directory:

sudo ln -s arm armv7l

Dirty hack, but it works :)

MayaPosch
  • 315
  • 8
  • 20
  • 1
    I marked it as the right answer, but I actually didn't test it. I'll just trust your answer based on your reputation. :P – Yuri Borges Apr 18 '17 at 16:31
  • It worked on my machine :D Since it's apparently just the folder name which is the problem and not an architectural incompatibility, it should Just Work (tm). For my own use case I ended up using a different driver which was not installed via DKMS. Seems like there aren't too many of such drivers around (yet). – MayaPosch Apr 18 '17 at 17:26
  • Did not work for me :( I'm trying to build an RTL8192eu driver on the Odroud XU3 with the official 4.9 kernel. I could change the 'make' command with ```ARCH=arm``` but later it still fails with ```Error! Bad return status for module build on kernel: 4.9.28-38 (armv7l)``` =/ – ecth Sep 23 '17 at 07:26
  • worked for me in order to build rtl8821au-dkms-git aur package on a rpi3 with archlinux arm. still dirty though. – Mathieu Westphal Apr 13 '18 at 21:24
0

You can pass arch by -a, --arch like this:

dkms install rtl8188fu/1.0 -j 4-a arm

Read more on man page by running man dkms or find it here:

http://manpages.ubuntu.com/manpages/bionic/man8/dkms.8.html

MSS
  • 3,520
  • 24
  • 29