BPI-Router-Images icon indicating copy to clipboard operation
BPI-Router-Images copied to clipboard

kernel-headers

Open mithrandir42 opened this issue 2 years ago • 3 comments

Thanks for the R3 images. I have tried out your bookworm image from https://drive.google.com/drive/folders/1fxDR-uL3DIO-8ebgqOJd5MoWORQTTm7Z . It looks like we cannot easily build kernel modules directly on the board (dkms, etc.), due to missing kernel headers. Any chance to include the kernel headers in the images?

mithrandir42 avatar Jan 05 '24 00:01 mithrandir42

My kernel-repo creates deb packages with headers,maybe this is a way? Else you can clone the source to board and fix symlink in lib/modules/version

frank-w avatar Jan 05 '24 06:01 frank-w

Thanks, great, haven´t seen the packages. Installed https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.1-main-6.1.60-2023-10-26_1511/linux-headers-6.1.60-bpi-r3-main_6.1.60-bpi-r3-main-8_arm64.deb

with kernel root@bpi-r3:/usr/src/MIRROR.5.4# uname -a Linux bpi-r3 6.1.50-bpi-r3-main #7 SMP Sun Sep 3 09:34:28 UTC 2023 aarch64 GNU/Linux

I get the following errors when trying to build out of tree modules: ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing.

With another module I get: make[1]: Entering directory '/usr/src/linux-headers-6.1.60-bpi-r3-main' SYNC include/config/auto.conf.cmd can't find file Kconfig

Also tried to install v4l2loopback-dkms (just for testing): Building initial module for 6.1.50-bpi-r3-main Error! The /var/lib/dkms/v4l2loopback/0.12.7/6.1.50-bpi-r3-main/aarch64/dkms.con f for module v4l2loopback includes a BUILD_EXCLUSIVE directive which does not ma tch this kernel/arch/config. This indicates that it should not be built. Skipped.

Afterwards tried to use https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.1-main-6.1.50-2023-09-03_0744/linux-headers-6.1.50-bpi-r3-main_6.1.50-bpi-r3-main-8_arm64.deb (and fixed the build symlink again) getting the same errors.

Looks like there is something missing in the headers package. Let me see if can find out what is going on.

./include/config/auto.conf is inside the headers. include/generated/autoconf.h is missing

If we could get this working, I think it would be great to use https://github.com/rpatterson/github-apt-repos to integrate the kernel repository with apt (in the image, and fix the symlink in the header package), so everyone can just install the headers package with apt-get, as usual. This should (if the kernel packages work, have not tried) also enable us to upgrade the kernel of the running system just with apt-get.

Afterwards I tried to install the most recent kernel package (to have exactly the same version of kernel and headers for testing the 6.1.60 package)

root@bpi-r3:~# dpkg -i linux-image-6.1.60-bpi-r3-main_6.1.60-bpi-r3-main-8_arm64.deb (Reading database ... 46905 files and directories currently installed.) Preparing to unpack linux-image-6.1.60-bpi-r3-main_6.1.60-bpi-r3-main-8_arm64.deb ... Unpacking linux-image-6.1.60-bpi-r3-main (6.1.60-bpi-r3-main-8) over (6.1.60-bpi-r3-main-8) ... dpkg: error processing archive linux-image-6.1.60-bpi-r3-main_6.1.60-bpi-r3-main-8_arm64.deb (--install): unable to make backup link of './boot/System.map-6.1.60-bpi-r3-main' before installing new version: Operation not permitted dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

This might be related to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1318951. Anyways this could be easily fixed by using an ext partition for boot instead of vfat.

After moving things in /boot away manually (bananapi.bak, config-6.1.60-bpi-r3-main.bak, System.map-6.1.60-bpi-r3-main.bak) I managed to get the package installed (at least dpkg tells). However, after a reboot the kernel version does not match the package version:

root@bpi-r3:~# uname -a Linux bpi-r3 6.1.50-bpi-r3-main #7 SMP Sun Sep 3 09:34:28 UTC 2023 aarch64 GNU/Linux

So the installation of the kernel-image package failed somehow. Not sure what is going on. Thus the upgrade with apt, suggetsted above, won´t work until the image installation works manually.

Further investigations later on...

mithrandir42 avatar Jan 05 '24 22:01 mithrandir42