간단히 다음을 입력하여 v4l2loopback을 빌드하려고 합니다.
만들다
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/user/dev/labs/v4l2loopback modules
make[1]: Entering directory '/usr/lib/modules/5.13.0-22-generic/build'
make[1]: *** No rule to make target 'modules'. Stop.
make[1]: Leaving directory '/usr/lib/modules/5.13.0-22-generic/build'
make: *** [Makefile:46: v4l2loopback.ko] Error 2
이름 없음 -r
5.13.0-22-generic
ls -l /usr/src/linux-headers-$(uname -r)
total 1772
drwxr-xr-x 3 root root 4096 Dec 20 00:26 arch
lrwxrwxrwx 1 root root 41 Nov 9 15:21 block -> ../linux-hwe-5.13-headers-5.13.0-22/block
lrwxrwxrwx 1 root root 41 Nov 9 15:21 certs -> ../linux-hwe-5.13-headers-5.13.0-22/certs
lrwxrwxrwx 1 root root 42 Nov 9 15:21 crypto -> ../linux-hwe-5.13-headers-5.13.0-22/crypto
lrwxrwxrwx 1 root root 49 Nov 9 15:21 Documentation -> ../linux-hwe-5.13-headers-5.13.0-22/Documentation
lrwxrwxrwx 1 root root 43 Nov 9 15:21 drivers -> ../linux-hwe-5.13-headers-5.13.0-22/drivers
lrwxrwxrwx 1 root root 38 Nov 9 15:21 fs -> ../linux-hwe-5.13-headers-5.13.0-22/fs
drwxr-xr-x 4 root root 4096 Dec 20 00:26 include
lrwxrwxrwx 1 root root 40 Nov 9 15:21 init -> ../linux-hwe-5.13-headers-5.13.0-22/init
lrwxrwxrwx 1 root root 39 Nov 9 15:21 ipc -> ../linux-hwe-5.13-headers-5.13.0-22/ipc
lrwxrwxrwx 1 root root 42 Nov 9 15:21 Kbuild -> ../linux-hwe-5.13-headers-5.13.0-22/Kbuild
lrwxrwxrwx 1 root root 43 Nov 9 15:21 Kconfig -> ../linux-hwe-5.13-headers-5.13.0-22/Kconfig
drwxr-xr-x 2 root root 4096 Dec 20 00:26 kernel
lrwxrwxrwx 1 root root 39 Nov 9 15:21 lib -> ../linux-hwe-5.13-headers-5.13.0-22/lib
lrwxrwxrwx 1 root root 44 Nov 9 15:21 Makefile -> ../linux-hwe-5.13-headers-5.13.0-22/Makefile
lrwxrwxrwx 1 root root 38 Nov 9 15:21 mm -> ../linux-hwe-5.13-headers-5.13.0-22/mm
-rw-r--r-- 1 root root 1783838 Nov 9 15:21 Module.symvers
lrwxrwxrwx 1 root root 39 Nov 9 15:21 net -> ../linux-hwe-5.13-headers-5.13.0-22/net
lrwxrwxrwx 1 root root 43 Nov 9 15:21 samples -> ../linux-hwe-5.13-headers-5.13.0-22/samples
drwxr-xr-x 7 root root 12288 Dec 20 00:26 scripts
lrwxrwxrwx 1 root root 44 Nov 9 15:21 security -> ../linux-hwe-5.13-headers-5.13.0-22/security
lrwxrwxrwx 1 root root 41 Nov 9 15:21 sound -> ../linux-hwe-5.13-headers-5.13.0-22/sound
drwxr-xr-x 4 root root 4096 Dec 20 00:26 tools
lrwxrwxrwx 1 root root 42 Nov 9 15:21 ubuntu -> ../linux-hwe-5.13-headers-5.13.0-22/ubuntu
lrwxrwxrwx 1 root root 39 Nov 9 15:21 usr -> ../linux-hwe-5.13-headers-5.13.0-22/usr
lrwxrwxrwx 1 root root 40 Nov 9 15:21 virt -> ../linux-hwe-5.13-headers-5.13.0-22/virt
설치 제목:
sudo apt install linux-headers-$(uname -r)
내가 무엇을 놓치고 있나요?
답변1
/lib/modules/$(uname -r)/build
디렉토리가 아니어야 하며 에 대한 심볼릭 링크여야 합니다 /usr/src/linux-headers-$(uname -r)
. 이 문제를 해결하면
sudo rmdir "/lib/modules/$(uname -r)/build"
sudo ln -s "/usr/src/linux-headers-$(uname -r)" "/lib/modules/$(uname -r)/build"
빌드가 작동해야 합니다.