raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.09k stars 4.97k forks source link

v4l2loopback-dkms fails on 6.1.19-v8+ #5410

Open aurimas-kudarauskas-epam opened 1 year ago

aurimas-kudarauskas-epam commented 1 year ago

Describe the bug

After running apt full-upgrade installation of v4l2loopback kernel module fails. Dkms package reports missing header files.

Steps to reproduce the behaviour

Start with v4l2loopback module installed on Rasbian os with kernel 5.x.x Make sure that headers for kernel version pressent: sudo apt-get install v4l2loopback-dkms

run apt update + apt full-upgrade to update into 6.1.xx Kernel version

update fails with failure to rebuild v4l2loopback kernel module

Device (s)

Raspberry Pi 4 Mod. B

System

cat /etc/rpi-issue -> Raspberry Pi reference 2023-02-21 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f2d385517c9631f2ded876deb1115725d0c75995, stage4

vcgencmd version -> Mar 17 2023 10:50:39 Copyright (c) 2012 Broadcom version 82f3750a65fadae9a38077e3c2e217ad158c8d54 (clean) (release) (start)

uname -a -> Linux tvbox 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux

Logs

sudo apt full-upgrade ->

Loading new v4l2loopback-0.12.5 DKMS files... It is likely that 6.1.19-v8+ belongs to a chroot's host Building for 6.1.19+, 6.1.19-v7+, 6.1.19-v7l+ and 6.1.19-v8+ Building initial module for 6.1.19+ Error! Bad return status for module build on kernel: 6.1.19+ (aarch64) Consult /var/lib/dkms/v4l2loopback/0.12.5/build/make.log for more information. dpkg: error processing package v4l2loopback-dkms (--configure): installed v4l2loopback-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: v4l2loopback-dkms E: Sub-process /usr/bin/dpkg returned an error code (1)


cat /var/lib/dkms/v4l2loopback/0.12.5/build/make.log ->

DKMS make.log for v4l2loopback-0.12.5 for kernel 6.1.19+ (aarch64) Tue 28 Mar 14:26:33 BST 2023 Building v4l2-loopback driver... make -C /lib/modules/6.1.19+/build M=/var/lib/dkms/v4l2loopback/0.12.5/build modules make[1]: Entering directory '/usr/src/linux-headers-6.1.19+' CC [M] /var/lib/dkms/v4l2loopback/0.12.5/build/v4l2loopback.o In file included from ./include/linux/preempt.h:10, from ./include/linux/spinlock.h:56, from ./include/linux/vmalloc.h:5, from /var/lib/dkms/v4l2loopback/0.12.5/build/v4l2loopback.c:17: ./include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory 8 | #include <asm/linkage.h> | ^~~~~~~ compilation terminated. make[2]: [scripts/Makefile.build:250: /var/lib/dkms/v4l2loopback/0.12.5/build/v4l2loopback.o] Error 1 make[1]: [Makefile:2012: /var/lib/dkms/v4l2loopback/0.12.5/build] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.1.19+' make: *** [Makefile:43: v4l2loopback.ko] Error 2

Additional context

Tried: apt install --reinstall raspberrypi-kernel-headers Manually reinstall: http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel-headers_1.20230317-1_arm64.deb ( Got error that system is armhf)

http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel-headers_1.20230317-1_armhf.deb (installed without issue)

popcornmix commented 1 year ago

Does adding arm_64bit=0 to config.txt (and rebooting) allow this to succeed?

This is a workaround rather than a fix, but would confirm if the issue is purely related to the 64-bit kernel, rather than other 6.1 kernel changes.

terminet85 commented 1 year ago

Tried: apt install --reinstall raspberrypi-kernel-headers Manually reinstall: http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel-headers_1.20230317-1_arm64.deb ( Got error that system is armhf)

--force-all

terminet85 commented 1 year ago

./include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory

this point to ./usr/src/linux-headers-6.1.19-v8+/arch/arm64/include/asm/linkage.h that is missing 'cause you haven't the right headers.

aurimas-kudarauskas-epam commented 1 year ago

arm_64bit=0

Setting this, rebooting and reruning apt full-upgrade build v4l2loopback kernel module. Is it safe to use thus hotfix until final fix issued?

aurimas-kudarauskas-epam commented 1 year ago

./include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory

this point to ./usr/src/linux-headers-6.1.19-v8+/arch/arm64/include/asm/linkage.h that is missing 'cause you haven't the right headers.

Thank you for suggestion, have not tried as previous one also worked

terminet85 commented 1 year ago

arm_64bit=0

Setting this, rebooting and reruning apt full-upgrade build v4l2loopback kernel module. Is it safe to use thus hotfix until final fix issued?

https://github.com/raspberrypi/linux/issues/5395 OOM Killer issue, better apply the lru_gen workaround

popcornmix commented 1 year ago

Setting this, rebooting and reruning apt full-upgrade build v4l2loopback kernel module. Is it safe to use thus hotfix until final fix issued?

arm_64bit used to default to 0, and has been changed to default to 1 recently. So you are just switching back to the old behaviour.

mstiehm-NF commented 1 year ago

Hi all. I ran into this issue today and setting the arm_64bit value to 0 made my pi unable to boot, so this didn't work for me.

pelwell commented 1 year ago

arm_64bit=0 is only a reasonable thing to do with a 32-bit OS installation. If the OS is 64-bit then:

  1. the processor will not be able to execute the applications, and
  2. there may be no 32-bit kernel to run.
mstiehm-NF commented 1 year ago

Then I am unclear on how the solution worked for OP. I am using the same Kernel and the same RPi. Wouldn't we both have the same 64bit OS?

pelwell commented 1 year ago

They must have been running the 32-bit OS, which will come with the 64-bit kernel as well.

mstiehm-NF commented 1 year ago

So, my particular issue is that it says I am missing the linux headers package when I try to build the module, but I have already installed the headers package. It seems that there is no build dir in /lib/modules/6.1.19-v8+. I have tried building using both dkms and making in the module.

mstiehm-NF commented 1 year ago

I was able to get this working by installing v4l2loopback-source then using the module assistant to install. Still not sure why the other methods didn't work.

terminet85 commented 1 year ago

It seems that there is no build dir in /lib/modules/6.1.19-v8+.

https://github.com/raspberrypi/linux/issues/5408