Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build DKMS modules for sunxi-next #1369

Closed
mkudlacek opened this issue May 14, 2019 · 15 comments
Closed

Cannot build DKMS modules for sunxi-next #1369

mkudlacek opened this issue May 14, 2019 · 15 comments

Comments

@mkudlacek
Copy link

mkudlacek commented May 14, 2019

I have OrangePi R1 running Debian Stretch:

Linux orangepi 4.19.38-sunxi #5.86 SMP Sun May 12 17:56:25 CEST 2019 armv7l GNU/Linux

I installed headers of the same version:

ii  linux-headers-next-sunxi            5.86                           armhf        Linux kernel headers for 4.19.38-sunxi on armhf
ii  linux-image-next-sunxi              5.86                           armhf        Linux kernel, version 4.19.38-sunxi

When I try building a module via DKMS, it ends up with an error:

root@orangepi:~# dpkg-reconfigure wireguard-dkms

------------------------------
Deleting module version: 0.0.20190406
completely from the DKMS tree.
------------------------------
Done.
Loading new wireguard-0.0.20190406 DKMS files...
Building for 4.19.38-sunxi
Building initial module for 4.19.38-sunxi
Error! Bad return status for module build on kernel: 4.19.38-sunxi (armv7l)
Consult /var/lib/dkms/wireguard/0.0.20190406/build/make.log for more information.

The mentioned log file contains:

DKMS make.log for wireguard-0.0.20190406 for kernel 4.19.38-sunxi (armv7l)
Tue May 14 10:36:54 UTC 2019
make: Entering directory '/usr/src/linux-headers-4.19.38-sunxi'
Makefile:619: arch//Makefile: No such file or directory
make: *** No rule to make target 'arch//Makefile'.  Stop.
make: Leaving directory '/usr/src/linux-headers-4.19.38-sunxi'

It looks like the $SRCARCH is empty (line 619 of the mentioned Makefile):

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=
ARCH_AFLAGS :=
ARCH_CFLAGS :=
include arch/$(SRCARCH)/Makefile

I tried to force the architecture by following suggestions on this page: diederikdehaas/rtl8812AU#103

Namely:

ARCH=arm dpkg-reconfigure wireguard-dkms

Or adding the symlink:

root@orangepi:/usr/src/linux-headers-4.19.38-sunxi/arch# ls -l
total 124
drwxr-xr-x   9 root root  4096 May 13 12:42 alpha
drwxr-xr-x  13 root root  4096 May 13 12:42 arc
drwxr-xr-x 100 root root  4096 May 13 12:42 arm
drwxr-xr-x  11 root root  4096 May 13 12:42 arm64
lrwxrwxrwx   1 root root     3 May  8 18:46 armv7l -> arm

Or even changing the line 619 in the /usr/src/linux-headers-4.19.38-sunxi/Makefile to:

include arch/arm/Makefile

But none of it worked. I tried different DKMS module (virtualbox-dkms), but obviously, the problem is in the linux-headers-next-sunxi package.

What can I do to make it work?

Thanks,
Martin

@igorpecovnik
Copy link
Member

igorpecovnik commented May 14, 2019

Wireguard is part of all Armbian kernels. (Probably) that's why you can't build. Just run:

modprobe wireguard

@mkudlacek
Copy link
Author

Hi @igorpecovnik,
thanks for the reply. It fixed my problem - I am able to run the wireguard now:) However, I don't think the problem is related to the wireguard module already being part of the kernel. The same error happens when I try to build the virtualbox dkms module:

root@orangepi:/# dpkg-reconfigure virtualbox-dkms

------------------------------
Deleting module version: 5.2.24
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-5.2.24 DKMS files...
Building for 4.19.38-sunxi
Building initial module for 4.19.38-sunxi
Error! Bad return status for module build on kernel: 4.19.38-sunxi (armv7l)
Consult /var/lib/dkms/virtualbox/5.2.24/build/make.log for more information.

Content of the mentioned log:

DKMS make.log for virtualbox-5.2.24 for kernel 4.19.38-sunxi (armv7l)
Tue May 14 12:32:51 UTC 2019
make: Entering directory '/usr/src/linux-headers-4.19.38-sunxi'
Makefile:619: arch//Makefile: No such file or directory
make: *** No rule to make target 'arch//Makefile'.  Stop.
make: Leaving directory '/usr/src/linux-headers-4.19.38-sunxi'

But the module is not available:

root@orangepi:/# modprobe vboxdrv
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.19.38-sunxi

@igorpecovnik
Copy link
Member

Nice, and how did you solve it?

@mkudlacek
Copy link
Author

mkudlacek commented May 14, 2019

The wireguard by modprobing the module:

modprobe wireguard

The virtualbox I did not. I don't actually need it, I just wanted to demonstrate, that it is probably some other issue than the one with wireguard.

@igorpecovnik
Copy link
Member

Aha, ok ... IIRC DKMS was broken upstream for some time and since its impossible to fix everything it will remain as is until someone would desperately need this function :) Since DMKS is apparently broken I'll leave this open.

@devinrsmith
Copy link

devinrsmith commented May 23, 2019

Ditto on ROCKPro64, getting similar error trying to install wireguard-dkms:

DKMS make.log for wireguard-0.0.20190406 for kernel 4.4.178-rockchip64 (aarch64)
Thu May 23 16:46:08 UTC 2019
make: Entering directory '/usr/src/linux-headers-4.4.178-rockchip64'
Makefile:666: arch//Makefile: No such file or directory
make: *** No rule to make target 'arch//Makefile'.  Stop.
make: Leaving directory '/usr/src/linux-headers-4.4.178-rockchip64'

(Although, I do see that modprobe wireguard works, so that's good :) )

@pianoquintet
Copy link

Same on an Odroid HC1 with armbian stretch. "modprobe wireguard" returns no errors but I am left without all the wireguard commands (wg-quick, wg, wg-show, etc.)

@igorpecovnik
Copy link
Member

Same on an Odroid HC1 with armbian stretch. "modprobe wireguard" returns no errors but I am left without all the wireguard commands (wg-quick, wg, wg-show, etc.)

If you care to add and maintain (usually nothing) the build of wg packages https://github.com/armbian/build/tree/master/packages/extras-buildpkgs

Or those tools already exists in some repository?

@zhangn1985
Copy link
Contributor

Hi, @igorpecovnik please due to I rebase sunxi-next to upstream LTS, please set WIREGUARD=yes to enable wireguard for sunxi-next release, if wireguard is required feature.

igorpecovnik added a commit that referenced this issue Aug 13, 2019
Its tested on all build and is attached to tested branch. Also #1369
@pianoquintet
Copy link

pianoquintet commented Aug 13, 2019 via email

@igorpecovnik
Copy link
Member

igorpecovnik commented Aug 13, 2019

Where do I place this setting? Thanks.

Just build image/kernel, now WG is default. For the DKMS way I can't help without deep investigation ...

@zhfreal
Copy link

zhfreal commented Sep 9, 2019

Hey,
I fixed this issue by rebuild headers in armbian device.

update:
You need some kernel source headers and rebuild somethings.

$ local_ver=$(uname -r | sed 's/^[0-9]*.[0-9]*.[0-9]*//')
$ sudo cp -ra your_kernel_source_dir/tools/include /usr/src/linux-headers-$(uname -r)/tools/
$ sudo cp -ra your_kernel_source_dir/security/selinux/include /usr/src/linux-headers-$(uname -r)/security/selinux/
$ cd /usr/src/linux-headers-$(uname -r)/
$ sudo make scripts LOCALVERSION="$local_ver"

After this, dkms will be working.

@mmriech
Copy link
Contributor

mmriech commented Dec 28, 2019

Pull request #1697 is supposed to fix this issue. Please retest as soon as the PR is merged.

@Heisath
Copy link
Member

Heisath commented Dec 28, 2019

I just merged it. Please rebuild and test.

@igorpecovnik
Copy link
Member

Tested, works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants