Public bug reported:

Dear Ubuntu maintainers,
On Ubuntu 22.04 with the HWE 6.8 kernel, the current `v4l2loopback-dkms` 
package (version 0.12.7-2ubuntu2~22.04.1) fails to build due to a removed 
kernel API (`strlcpy`).

The upstream `v4l2loopback` project has already addressed this issue in
version 0.15.0 by switching to `strscpy`. Could you please consider
updating the package to version 0.15.0, or backporting the relevant fix?

# Bug analyze:
kernel 6.8.0 remove the function "strlcpy", but the v4l2loopback-dkms 0.12.7 
still use it.

# kernel version:
```
$ uname -a
Linux c 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 
19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
```

# apt Default version: 0.12.7
```
$ apt-cache policy v4l2loopback-dkms
v4l2loopback-dkms:
Installed: (none)
Candidate: 0.12.7-2ubuntu2~22.04.1
Version table:
0.12.7-2ubuntu2~22.04.1 500
```

# install error message
```
$ sudo apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up v4l2loopback-dkms (0.12.7-2ubuntu2~22.04.1) ...
Removing old v4l2loopback-0.12.7 DKMS files...
Deleting module v4l2loopback-0.12.7 completely from the DKMS tree.
Loading new v4l2loopback-0.12.7 DKMS files...
Building for 6.8.0-60-generic
Building initial module for 6.8.0-60-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/v4l2loopback-dk
ms.0.crash'
Error! Bad return status for module build on kernel: 6.8.0-60-generic (x86_64)
Consult /var/lib/dkms/v4l2loopback/0.12.7/build/make.log for more information.
dpkg: error processing package v4l2loopback-dkms (--configure):
installed v4l2loopback-dkms package post-installation script subprocess returne
d error exit status 10
Errors were encountered while processing:
v4l2loopback-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
```

logs
```
$ cat /var/lib/dkms/v4l2loopback/0.12.7/build/make.log
DKMS make.log for v4l2loopback-0.12.7 for kernel 6.8.0-60-generic (x86_64)
2025年07月09日 星期三 10:39:23 CST
Building v4l2-loopback driver...
make -C /lib/modules/6.8.0-60-generic/build 
M=/var/lib/dkms/v4l2loopback/0.12.7/build modules CC=x86_64-linux-gnu-gcc-12
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-60-generic'
CC [M]  /var/lib/dkms/v4l2loopback/0.12.7/build/v4l2loopback.o
/var/lib/dkms/v4l2loopback/0.12.7/build/v4l2loopback.c: In function 
‘vidioc_querycap’:
/var/lib/dkms/v4l2loopback/0.12.7/build/v4l2loopback.c:727:9: error: implicit 
declaration of function ‘strlcpy’; did you mean ‘strscpy’? 
[-Werror=implicit-function-declaration]
727 |         strlcpy(cap->driver, "v4l2 loopback", sizeof(cap->driver));
|         ^~~~~~~
|         strscpy
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: 
/var/lib/dkms/v4l2loopback/0.12.7/build/v4l2loopback.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.8.0-60-generic/Makefile:1925: 
/var/lib/dkms/v4l2loopback/0.12.7/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-60-generic'
make: *** [Makefile:43: v4l2loopback.ko] Error 2
```

# workaround:
Manually installing the upstream version 0.15.0 works correctly with kernel 
6.8. This version contains the compatibility fix:
```
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
#define strscpy strlcpy
#endif
```

```
sudo apt purge v4l2loopback-dkms
sudo apt install git dkms build-essential linux-headers-$(uname -r)

git clone https://github.com/umlaeute/v4l2loopback.git
sudo mkdir -p /usr/src/v4l2loopback-0.15.0
sudo cp -r * /usr/src/v4l2loopback-0.15.0/
cd /usr/src/v4l2loopback-0.15.0/
sudo dkms add -m v4l2loopback -v 0.15.0
sudo dkms build -m v4l2loopback -v 0.15.0
sudo dkms install -m v4l2loopback -v 0.15.0

//avoid apt install v4l2loopback-dkms again
sudo apt-mark hold v4l2loopback-dkms
apt-mark showhold
```

# Impact

This issue affects all Ubuntu 22.04 LTS users who have received the 6.8
HWE kernel and attempt to install v4l2loopback-dkms. Until the package
is updated, it cannot be installed using the default Ubuntu
repositories.

Thank you for maintaining Ubuntu!

** Affects: v4l2loopback (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2116230

Title:
  ubuntu22 can't install v4l2loopback-dkms 0.12.7

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/v4l2loopback/+bug/2116230/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to