pi64 icon indicating copy to clipboard operation
pi64 copied to clipboard

kernel headers

Open jedisct1 opened this issue 7 years ago • 21 comments

Hi Bilal,

Is there an easy way to install the kernel headers?

I'd like to run Wireguard, but it comes with a kernel module, so it requires the presence of headers for the running kernel.

jedisct1 avatar Jun 08 '17 12:06 jedisct1

Indeed they are missing at the moment! Would it be enough if I run make headers_install as described here?

I'll probably add a tarball release just for kernel / modules / headers soon (to prepare #9).

bamarni avatar Jun 23 '17 13:06 bamarni

Hi Bilal,

Yes, that would do the trick!

jedisct1 avatar Jun 23 '17 15:06 jedisct1

In the meanwhile if you want to grab the tarball manually here it is :) (https://github.com/bamarni/pi64-kernel/releases)

bamarni avatar Jun 25 '17 12:06 bamarni

does the tarball referenced above had the kernal headers?

Thanks

clint3501 avatar Jul 26 '17 16:07 clint3501

Yes they should.

bamarni avatar Jul 26 '17 16:07 bamarni

thanks

clint3501 avatar Jul 26 '17 19:07 clint3501

fixed in latest release

bamarni avatar Jul 31 '17 02:07 bamarni

Sorry for reopening this issue, but the kernel headers are referencing to old symlinks on the build machine. I cannot compile any kernel module because of that.

root@raspberrypi:~# ls -la /lib/modules/4.11.12-pi64+/
total 1800
drwxr-xr-x  3 root root   4096 Jul 30 18:52 .
drwxr-xr-x  3 root root   4096 Jul 30 18:50 ..
lrwxrwxrwx  1 root root     29 Jul 30 18:50 build -> /mnt/dev/pi64/build/linux-src
drwxr-xr-x 10 root root   4096 Jul 30 18:52 kernel
-rw-r--r--  1 root root 468314 Jul 30 18:52 modules.alias
-rw-r--r--  1 root root 480671 Jul 30 18:52 modules.alias.bin
-rw-r--r--  1 root root   4833 Jul 30 18:52 modules.builtin
-rw-r--r--  1 root root   6590 Jul 30 18:52 modules.builtin.bin
-rw-r--r--  1 root root 143089 Jul 30 18:52 modules.dep
-rw-r--r--  1 root root 208587 Jul 30 18:52 modules.dep.bin
-rw-r--r--  1 root root    302 Jul 30 18:52 modules.devname
-rw-r--r--  1 root root  58610 Jul 30 18:52 modules.order
-rw-r--r--  1 root root    327 Jul 30 18:52 modules.softdep
-rw-r--r--  1 root root 195103 Jul 30 18:52 modules.symbols
-rw-r--r--  1 root root 240025 Jul 30 18:52 modules.symbols.bin
lrwxrwxrwx  1 root root     29 Jul 30 18:52 source -> /mnt/dev/pi64/build/linux-src

JohnnyLeone avatar Aug 01 '17 20:08 JohnnyLeone

@JohnnyLeone : kernel headers I've installed should be in /usr/include. I'm not familiar with installing a kernel module from source, but aren't the kernel headers enough? (cf. https://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html).

That linux sources folder it's referencing on the build machine is 1.6G of size, I'd really rather avoid shipping it unless absolutely necessary...

bamarni avatar Aug 02 '17 09:08 bamarni

The headers from /usr/include are not the headers from the kernel tree. Without them we cannot build modules against the kernel. The size is huge, but we could shrink it if we import only the kernel architecture, module includes...

JohnnyLeone avatar Aug 03 '17 18:08 JohnnyLeone

@JohnnyLeone : I'm currently looking at how to achieve that. This script seems relevant : https://github.com/torvalds/linux/blob/23ea3f62f3f90caaa7b4bf32690c341101228cca/scripts/package/builddeb#L318

It's the part which builds the kernel headers package for debian. I can probably extract what we need from there, I'll give it a shot soon.

bamarni avatar Aug 13 '17 12:08 bamarni

Nod :( Modules still cannot be built :(

jedisct1 avatar Aug 24 '17 09:08 jedisct1

I've just made a new kernel release containing stripped down kernel sources, using the same filters as the script linked above.

You can download it with sudo pi64-update or if you have a too old release directly from here : https://github.com/bamarni/pi64-kernel/releases

Could anyone confirm if modules can be built with this one?

bamarni avatar Aug 27 '17 16:08 bamarni

Yes!

It works! 👍

jedisct1 avatar Aug 27 '17 17:08 jedisct1

Awesome, thanks for checking

bamarni avatar Aug 28 '17 10:08 bamarni

Sorry for reopening this.

There is still a remaining issue.

The scripts/basic/fixdep file is an x86_64 executable, not an aarch64 one.

jedisct1 avatar Sep 27 '17 13:09 jedisct1

Same for bin2c.

jedisct1 avatar Sep 27 '17 13:09 jedisct1

Same for recordmcount :)_

jedisct1 avatar Sep 27 '17 13:09 jedisct1

Same for modpost, etc....

jedisct1 avatar Sep 27 '17 13:09 jedisct1

same here, file /usr/src/linux-headers-4.11.12-pi64+/scripts/basic/fixdep /usr/src/linux-headers-4.11.12-pi64+/scripts/basic/fixdep: 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]=91599

drwatson32 avatar Nov 12 '17 18:11 drwatson32

Same problem here. All the binaries in /usr/src/linux-headers-4.11.12-pi64+/scripts/ are x86-64. I ended up building this repo from source on a raspberry pi and copying over the new headers to /usr/src/

mohakshah avatar Dec 01 '17 03:12 mohakshah