brutella / hkcam

Open-Source HomeKit Surveillance Camera
https://hochgatterer.me/hkcam/
Apache License 2.0
942 stars 139 forks source link

v4l2loopback make fails #103

Closed 0xPr0xy closed 3 years ago

0xPr0xy commented 3 years ago
fatal: [192.168.178.238]: FAILED! => {"changed": false, "cmd": "cd /tmp/v4l2loopback-0.12.5 && make && sudo make install && depmod -a", "delta": "0:00:00.040840", "end": "2020-12-31 09:43:28.101464", "msg": "non-zero return code", "rc": 2, "start": "2020-12-31 09:43:28.060624", "stderr": "make[1]: *** /lib/modules/5.10.3-v7+/build: No such file or directory.  Stop.\nmake: *** [Makefile:43: v4l2loopback.ko] Error 2", "stderr_lines": ["make[1]: *** /lib/modules/5.10.3-v7+/build: No such file or directory.  Stop.", "make: *** [Makefile:43: v4l2loopback.ko] Error 2"], "stdout": "Building v4l2-loopback driver...\nmake -C /lib/modules/`uname -r`/build M=/tmp/v4l2loopback-0.12.5 modules", "stdout_lines": ["Building v4l2-loopback driver...", "make -C /lib/modules/`uname -r`/build M=/tmp/v4l2loopback-0.12.5 modules"]}
0xPr0xy commented 3 years ago

I was on 5.10 kernel version of which the headers were not included. 2 options:

1 downgrade to stable kernel:

sudo apt-get update
sudo apt install --reinstall libraspberrypi0 libraspberrypi-{bin,dev,doc} raspberrypi-bootloader raspberrypi-kernel

source: https://www.raspberrypi.org/documentation/raspbian/applications/rpi-update.md

2 install kernel headers checkout right kernel version branch, move the checkout to /usr/src/linux-headers-5.x.x then symlink /lib/modules/5.x.x/build -> /usr/src/linux-headers-5.x.x

source: https://www.raspberrypi.org/documentation/linux/kernel/building.md