building kernel modules => need kernel source installed

Moderators: mdrjr, odroid

building kernel modules => need kernel source installed

Unread postby intuxikated » Wed Sep 13, 2017 4:51 am

is there any way to install the kernel source in ubuntu (with kernel4.9)
i've installed ubuntu on my server (odroid HC1) and i'm trying to install wireguard on it, which requires a kernel module to be built
under normal ubuntu i can just "apt install linux-source-4.8" or whatever kernel is currently installed, though on the odroid the 4.9 kernel is used, though the kernel-source package for it is completely absent.

any way to install the kernel source on it?
intuxikated
 
Posts: 3
Joined: Wed Sep 13, 2017 4:42 am
languages_spoken: english
ODROIDs: HC1

Re: building kernel modules => need kernel source installed

Unread postby odroid » Wed Sep 13, 2017 9:52 am

You need to use "git" command to pull the source code.
https://wiki.odroid.com/odroid-xu4/soft ... nel#linux1

BTW, if "wireguard" driver module works well, please let us know.
We will include it in the next kernel update.
User avatar
odroid
Site Admin
 
Posts: 24992
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: building kernel modules => need kernel source installed

Unread postby intuxikated » Thu Sep 14, 2017 1:30 am

thanks for the reply, i'll see what i can do, since i'm no expert at all at building kernel modules (never done it before)
it would be extremely handy if you could add a linux-apt package for the kernel source to the repository though, that would make building modules more convenient :D
intuxikated
 
Posts: 3
Joined: Wed Sep 13, 2017 4:42 am
languages_spoken: english
ODROIDs: HC1

Re: building kernel modules => need kernel source installed

Unread postby meveric » Thu Sep 14, 2017 7:12 am

for building kernel modules, the kernel sources are not needed, only linux-headers are required.

On my Debian images, I've build plenty of Kernel modules and it's working fine. In fact I use some tools that actually REQUIRE to be able to build Kernel modules, as they are preinstalled on my OGST image and wouldn't work otherwise.
(Virtual CD/DVD drivers for Linux for example)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7860
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: building kernel modules => need kernel source installed

Unread postby intuxikated » Mon Sep 18, 2017 11:31 pm

meveric wrote:for building kernel modules, the kernel sources are not needed, only linux-headers are required.

doesn't seem like this applies to wireguard, which specifically asks for the kernel source to be "installed" to build it's kernel modules. if you can get it to build with just the kernel headers let me know.
i also asked the wireguard IRC channel on freenode and they confirmed that the kernel source is required to build the wireguard kernel modules
intuxikated
 
Posts: 3
Joined: Wed Sep 13, 2017 4:42 am
languages_spoken: english
ODROIDs: HC1

Re: building kernel modules => need kernel source installed

Unread postby meveric » Tue Sep 19, 2017 1:45 am

intuxikated wrote:doesn't seem like this applies to wireguard, which specifically asks for the kernel source to be "installed" to build it's kernel modules. if you can get it to build with just the kernel headers let me know.
i also asked the wireguard IRC channel on freenode and they confirmed that the kernel source is required to build the wireguard kernel modules

Sadly you failed to say what exactly you try to install so I checked for the wireguard-dkms module which is available for Debian Sid, and backported it to Debian Jessie.
Here's the result when I try to install it on my Debian Jessie image without having kernel sources installed:
Code: Select all
root@gamestation-turbo:~# apt-get install wireguard-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  wireguard-tools
The following NEW packages will be installed:
  wireguard-dkms wireguard-tools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 168 kB of archives.
After this operation, 1,026 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://oph.mdrjr.net/meveric/ jessie/backports wireguard-dkms all 0.0.20170907-1~bpo8 [121 kB]
Get:2 https://oph.mdrjr.net/meveric/ jessie/backports wireguard-tools armhf 0.0.20170907-1~bpo8 [47.1 kB]
Fetched 168 kB in 1s (96.6 kB/s)     
Selecting previously unselected package wireguard-dkms.
(Reading database ... 250570 files and directories currently installed.)
Preparing to unpack .../wireguard-dkms_0.0.20170907-1~bpo8_all.deb ...
Unpacking wireguard-dkms (0.0.20170907-1~bpo8) ...
Selecting previously unselected package wireguard-tools.
Preparing to unpack .../wireguard-tools_0.0.20170907-1~bpo8_armhf.deb ...
Unpacking wireguard-tools (0.0.20170907-1~bpo8) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up wireguard-dkms (0.0.20170907-1~bpo8) ...
Loading new wireguard-0.0.20170907-1~bpo8 DKMS files...
First Installation: checking all kernels...
Building only for 4.9.50+
Building initial module for 4.9.50+
Done.

wireguard:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.9.50+/updates/dkms/

depmod....

DKMS: install completed.
Setting up wireguard-tools (0.0.20170907-1~bpo8) ...
root@gamestation-turbo:~# dkms status
rtl8812au, 5.2.9, 4.9.44+, armhf: installed
rtl8812au, 5.2.9, 4.9.50+, armv7l: installed
vhba, 20170610, 4.9.43+, armv7l: installed
vhba, 20170610, 4.9.44+, armv7l: installed
vhba, 20170610, 4.9.50+, armv7l: installed
wireguard, 0.0.20170907-1~bpo8, 4.9.50+, armv7l: installed
root@gamestation-turbo:~# dpkg --list | grep linux-
ii  linux-headers-4.9-armhf-odroid-xu3    4.9.50-1                                   armhf        Linux Image/Headers Meta Package for ODROIDs
ii  linux-headers-4.9.43+                 4.9.43-20170817-XU3                        armhf        Header files related to Linux kernel, specifically,
ii  linux-headers-4.9.44+                 4.9.44-20170824-XU3                        armhf        Header files related to Linux kernel, specifically,
ii  linux-headers-4.9.50+                 4.9.50-20170918-XU3                        armhf        Header files related to Linux kernel, specifically,
ii  linux-image-4.9-armhf-odroid-xu3      4.9.50-1                                   armhf        Linux Image/Headers Meta Package for ODROIDs
ii  linux-image-4.9.43+                   4.9.43-20170817-XU3                        armhf        Linux kernel binary image for version 4.9.43+
ii  linux-image-4.9.44+                   4.9.44-20170824-XU3                        armhf        Linux kernel binary image for version 4.9.44+
ii  linux-image-4.9.50+                   4.9.50-20170918-XU3                        armhf        Linux kernel binary image for version 4.9.50+
ii  linux-libc-dev:armhf                  3.16.43-2+deb8u3                           armhf        Linux support headers for userspace development
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7860
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2


Return to Ubuntu

Who is online

Users browsing this forum: orst and 1 guest