DKMS building error


#1

DKMS make.log for wireguard-0.0.20181218 for kernel 4.4.154-72-rockchip-g6520deb (aarch64)
Sun Jan 20 20:17:25 CST 2019
make: Entering directory ‘/usr/src/linux-headers-4.4.154-72-rockchip-g6520deb’
 LD      /var/lib/dkms/wireguard/0.0.20181218/build/built-in.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/noise.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/main.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/device.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/timers.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/peer.o
 CC [M]  /var/lib/dkms/wireguard/0.0.20181218/build/queueing.o
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/main.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/main.o] Error 2
make[1]: *** Waiting for unfinished jobs…
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/queueing.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/queueing.o] Error 2
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/peer.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/peer.o] Error 2
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/device.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/device.o] Error 2
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/timers.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/timers.o] Error 2
/bin/sh: 1: ./scripts/recordmcount: Exec format error
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/wireguard/0.0.20181218/build/noise.o’ failed
make[1]: *** [/var/lib/dkms/wireguard/0.0.20181218/build/noise.o] Error 2
Makefile:1474: recipe for target ‘module/var/lib/dkms/wireguard/0.0.20181218/build’ failed
make: *** [module/var/lib/dkms/wireguard/0.0.20181218/build] Error 2
make: Leaving directory ‘/usr/src/linux-headers-4.4.154-72-rockchip-g6520deb’

file /usr/src/linux-headers-4.4.154-72-rockchip-g6520deb/scripts
/usr/src/linux-headers-4.4.154-72-rockchip-g6520deb/scripts/recordmcount: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=8bf6e966ec087c96bbe4e5e69b93e7eaa7c148d


#2

*[HowToCrossBuildAnOfficialDebianKernelPackage](https://wiki.debian.org/HowToCrossBuildAnOfficialDebianKernelPackage)

According to upper debian official cross-kernel-package building instructions, some env variable are not exported in Radxa vendor kernel building instructions.


#3

I think you are building on ROCK Pi 4 or cross compiling?


#4

I am trying to install wireguard on ubuntu on RockPI-4B with linux-headers-4.4.154-72-rockchip-g6520deb provided in Radxa repo.


#5

quickfix

sudo -i
apt-get install libssl-dev build-essential -y
export HEADER_DIR=/usr/src/linux-headers-$(uname -r)
find “$HEADER_DIR/scripts” -type f | while read i; do if file -b $i | egrep -q “^ELF.*x86-64”; then rm “$i”; fi; done
cd $HEADER_DIR/scripts
gcc mkkrnlimg.c -o “$HEADER_DIR/scripts/mkkrnlimg”
gcc kallsyms.c -o “$HEADER_DIR/scripts/kallsyms”
gcc pnmtologo.c -o “$HEADER_DIR/scripts/pnmtologo”
gcc conmakehash.c -o “$HEADER_DIR/scripts/conmakehash”
gcc resource_tool.c -o “$HEADER_DIR/scripts/resource_tool”
gcc ./basic/bin2c.c -o “$HEADER_DIR/scripts/basic/bin2c”
gcc recordmcount.c -o “$HEADER_DIR/scripts/recordmcount”
gcc -I…/tools/include sortextable.c -o “$HEADER_DIR/scripts/sortextable”
gcc unifdef.c -o “$HEADER_DIR/scripts/unifdef”
gcc ./basic/fixdep.c -o “$HEADER_DIR/scripts/basic/fixdep”
gcc extract-cert.c -o “$HEADER_DIR/scripts/extract-cert” -lssl -lcrypto
gcc ./mod/modpost.c ./mod/file2alias.c ./mod/sumversion.c -o “$HEADER_DIR/scripts/mod/modpost”
gcc ./mod/mk_elfconfig.c -o “$HEADER_DIR/scripts/mod/mk_elfconfig”
gcc -I…/include asn1_compiler.c -o “$HEADER_DIR/scripts/asn1_compiler”
ln -f ./genksyms/parse.tab.c_shipped ./genksyms/parse.tab.c;
ln -f ./genksyms/parse.tab.h_shipped ./genksyms/parse.tab.h;
ln -f ./genksyms/lex.lex.c_shipped ./genksyms/lex.lex.c;
ln -f ./genksyms/keywords.hash.c_shipped ./genksyms/keywords.hash.c;
gcc ./genksyms/genksyms.c ./genksyms/parse.tab.c ./genksyms/lex.lex.c -o “$HEADER_DIR/scripts/genksyms/genksyms”


#6

sudo dpkg-reconfigure wireguard-dkms

-------- Uninstall Beginning --------
Module:  wireguard
Version: 0.0.20181218
Kernel:  4.4.154-72-rockchip-g6520deb (aarch64)

Status: Before uninstall, this module version was ACTIVE on this kernel.

wireguard.ko:

  • Uninstallation
      - Deleting from: /lib/modules/4.4.154-72-rockchip-g6520deb/updates/dkms/
  • Original module
      - No original module was found for this module on this kernel.
      - Use the dkms install command to reinstall any previous module version.

depmod…

DKMS: uninstall completed.


Deleting module version: 0.0.20181218
completely from the DKMS tree.

Done.
Loading new wireguard-0.0.20181218 DKMS files…
Building for 4.4.154-72-rockchip-g6520deb
Building initial module for 4.4.154-72-rockchip-g6520deb

Done.

wireguard:
Running module version sanity check.

  • Original module
      - No original module exists within this kernel
  • Installation
      - Installing to /lib/modules/4.4.154-72-rockchip-g6520deb/updates/dkms/

depmod…

DKMS: install completed.


#7

Although upper quick-fix works,
the linux-header package in repo should be fixed anyway.