Jump to content
  • 0

Can't load wireguard kernel module


michcubox

Question

Armbianmonitor:

Hello,

 

I wanted to test wireguard with my cubox i4, but I'm not able to load the module.

 

I tried to search the net for this error, but fond nothing useful.

 

Maybe someone has an idea.

 

Thank you

Michael

 

uname -a
Linux loki 4.19.41-cubox #5.85 SMP Wed May 8 15:52:55 CEST 2019 armv7l GNU/Linux

dpkg -l | grep linux
ii  console-setup-linux              1.164                              all          Linux specific part of console-setup
ii  libselinux1:armhf                2.6-3+b3                           armhf        SELinux runtime shared libraries
ii  linux-base                       4.5                                all          Linux image base package
ii  linux-dtb-next-cubox             5.85                               armhf        Linux DTB, version 4.19.41-cubox
ii  linux-headers-next-cubox         5.85                               armhf        Linux kernel headers for 4.19.41-cubox on armhf
ii  linux-image-next-cubox           5.85                               armhf        Linux kernel, version 4.19.41-cubox
ii  linux-libc-dev                   5.70                               armhf        Linux support headers for userspace development
ii  linux-stretch-root-next-cubox-i  5.85                               armhf        Armbian tweaks for stretch on cubox-i (next branch)
ii  linux-u-boot-cubox-i-next        5.85                               armhf        Uboot loader 2013.10-rc4
ii  util-linux                       2.29.2-1+deb9u1                    armhf        miscellaneous system utilities

modprobe wireguard
modprobe: ERROR: could not insert 'wireguard': Exec format error

dmesg | grep wireguard
[320752.917616] wireguard: unknown relocation: 102

modinfo wireguard
filename:       /lib/modules/4.19.41-cubox/kernel/net/wireguard/wireguard.ko
alias:          net-pf-16-proto-16-family-wireguard
alias:          rtnl-link-wireguard
version:        0.0.20190406
author:         Jason A. Donenfeld <Jason@zx2c4.com>
description:    WireGuard secure network tunnel
license:        GPL v2
srcversion:     9996946C3FF07EF91C1E1DA
depends:
intree:         Y
name:           wireguard
vermagic:       4.19.41-cubox SMP mod_unload modversions ARMv7 thumb2 p2v8

 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
1 hour ago, michcubox said:

Maybe someone has an idea.


Are you able to build a kernel on your own? Build a fresh kernel with parameter WIREGUARD="yes" ... it is known to work on our most used Allwinner kernel.

Link to comment
Share on other sites

  • 0

Hi, I tried it with the new " 5.1.16-cubox #5.90 SMP Sun Jul 7 11:37:47 CEST 2019 armv7l GNU/Linux" kernel, but still the same problem.

 

I also tried to build the module with dkms with the wireguard package from debian sid, but the build fails. Here is the logfile of the build.

 

 cat /var/lib/dkms/wireguard/0.0.20190702/build/make.log
DKMS make.log for wireguard-0.0.20190702 for kernel 5.1.16-cubox (armv7l)
Wed Jul 10 23:21:13 CEST 2019
make: Entering directory '/usr/src/linux-headers-5.1.16-cubox'
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/main.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/noise.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/device.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/peer.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/timers.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/queueing.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/send.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/receive.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/socket.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/peerlookup.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/allowedips.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/cookie.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/netlink.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20.o
  PERLASM /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20-arm.S
  AS [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20-unrolled-arm.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305.o
  PERLASM /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305-arm.S
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20poly1305.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/blake2s/blake2s.o
/bin/sh: 1: scripts/genksyms/genksyms: not found
scripts/Makefile.build:275: recipe for target '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305.o' failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305.o] Error 127
make[1]: *** Deleting file '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305.o'
make[1]: *** Waiting for unfinished jobs....
/bin/sh: 1: scripts/genksyms/genksyms: not found
scripts/Makefile.build:275: recipe for target '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20.o' failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20.o] Error 127
make[1]: *** Deleting file '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20.o'
/bin/sh: 1: scripts/genksyms/genksyms: not found
scripts/Makefile.build:275: recipe for target '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20poly1305.o' failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20poly1305.o] Error 127
make[1]: *** Deleting file '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20poly1305.o'
/bin/sh: 1: scripts/genksyms/genksyms: not found
scripts/Makefile.build:275: recipe for target '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/blake2s/blake2s.o' failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/blake2s/blake2s.o] Error 127
make[1]: *** Deleting file '/var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/blake2s/blake2s.o'
Makefile:1571: recipe for target '_module_/var/lib/dkms/wireguard/0.0.20190702/build' failed
make: *** [_module_/var/lib/dkms/wireguard/0.0.20190702/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.1.16-cubox'

 

Link to comment
Share on other sites

  • 0
21 minutes ago, michcubox said:

i, I tried it with the new " 5.1.16-cubox #5.90 SMP Sun Jul 7 11:37:47 CEST 2019 armv7l GNU/Linux" kernel, but still the same problem.

 

What about modprobe wireguard since module should be build into the kernel?

DKMS could need some fine tuning ...

Link to comment
Share on other sites

  • 0

Same problem on hummingboard i2ex (running -cubox kernel) both on kernel 4.14 and 5.1. Built-in module doesn't work - throws this exec format error.

 

DKMS on 4.14 says that it built identical module to one shipped with kernel. I removed wireguard from /lib/modules, run depmod and installed wireguard -> no luck.

On 5.1 fails to build scripts/ in headers (won't build at all), like headers are broken. Self-built module from linux-source-next-cubox after make oldconfig fails in the same way (Exec format error).

 

Found older versions of wireguard sources -> wireguard-dkms_0.0.20190406-1_all.deb and wireguard-dkms_0.0.20190227-1_all.deb,  nothing changed.

 

Trying to load module pops "wireguard: unknown relocation: 102" in dmesg.

 

Spoiler

filename:       /lib/modules/4.14.132-cubox/kernel/net/wireguard/wireguard.ko
alias:          net-pf-16-proto-16-family-wireguard
alias:          rtnl-link-wireguard
version:        0.0.20190702
author:         Jason A. Donenfeld <Jason@zx2c4.com>
description:    WireGuard secure network tunnel
license:        GPL v2
srcversion:     721C4EEB0529AC764DAD357
depends:        
intree:         Y
name:           wireguard
vermagic:       4.14.132-cubox SMP mod_unload modversions ARMv7 thumb2 p2v8
####
filename:       /lib/modules/4.14.132-cubox/updates/dkms/wireguard.ko
alias:          net-pf-16-proto-16-family-wireguard
alias:          rtnl-link-wireguard
version:        0.0.20190406
author:         Jason A. Donenfeld <Jason@zx2c4.com>
description:    WireGuard secure network tunnel
license:        GPL v2
srcversion:     9996946C3FF07EF91C1E1DA
depends:        
name:           wireguard
vermagic:       4.14.132-cubox SMP mod_unload modversions ARMv7 thumb2 p2v8
#####
filename:       /lib/modules/4.14.132-cubox/updates/dkms/wireguard.ko
alias:          net-pf-16-proto-16-family-wireguard
alias:          rtnl-link-wireguard
version:        0.0.20190227
author:         Jason A. Donenfeld <Jason@zx2c4.com>
description:    WireGuard secure network tunnel
license:        GPL v2
srcversion:     17F2A236FAA55F91E7B0A56
depends:        
name:           wireguard
vermagic:       4.14.132-cubox SMP mod_unload modversions ARMv7 thumb2 p2v8 
 

 

 

Edited by kitor
Link to comment
Share on other sites

  • 0
13 hours ago, kitor said:

Same problem on hummingboard i2ex


We need to fix kernel recompilation first. I tried to build 5.2.y and 5.3.y yesterday, but could not boot the board ... will debug perhaps later today or next week. Then Wireguard.

Link to comment
Share on other sites

  • 0

WG works, thanks!

Yesterday I noticed that at least on 4.14 GPIOs doesn't work for me (exports, sets direction without errors, but real output on pins won't change) , but that's story for another thread. I used oldstable (with kernel 3.14.79-cubox) until yesterday so I just found that - need to investigate first.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines