Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dkms build fails on kernel version >6.8.0 #575

Closed
jschwender opened this issue Mar 12, 2024 · 3 comments
Closed

dkms build fails on kernel version >6.8.0 #575

jschwender opened this issue Mar 12, 2024 · 3 comments
Assignees
Labels
duplicate there's already a bug describing the same problem. please enhance the original issue. pending topic:kernel things regarding the actual kernel module

Comments

@jschwender
Copy link

build fails with error on strlcpy() function.

gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0

  • v4l2loopback version: 0.12.7
  • Distribution (+version): _____
    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 23.10
    Release: 23.10
    Codename: mantic

Steps to reproduce:

build vanilla kernel 6.8.0
run dkms build on installation the kernel

Observed Results:

build fails

Suggested fix:
--- v4l2loopback.c.sav 2023-07-05 14:05:05.000000000 +0200
+++ v4l2loopback.c 2024-03-12 08:36:48.736536585 +0100
@@ -739,7 +739,11 @@
->devicenr;
__u32 capabilities = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
strlcpy(cap->driver, "v4l2 loopback", sizeof(cap->driver));
+#else

  • strscpy(cap->driver, "v4l2 loopback", sizeof(cap->driver));
    +#endif
    vidioc_fill_name(cap->card, sizeof(cap->card), devnr);
    snprintf(cap->bus_info, sizeof(cap->bus_info),
    "platform:v4l2loopback-%03d", devnr);
    @@ -1247,7 +1251,11 @@
    if (!cnf)
    BUG();

+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
strlcpy(q->name, cnf->name, sizeof(q->name));
+#else

  • strscpy(q->name, cnf->name, sizeof(q->name));
    +#endif
    q->default_value = cnf->def;
    q->type = cnf->type;
    q->minimum = cnf->min;
    @@ -1352,7 +1360,11 @@
    memset(outp, 0, sizeof(*outp));

    outp->index = index;
    +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
    strlcpy(outp->name, "loopback in", sizeof(outp->name));
    +#else

  • strscpy(outp->name, "loopback in", sizeof(outp->name));
    +#endif
    outp->type = V4L2_OUTPUT_TYPE_ANALOG;
    outp->audioset = 0;
    outp->modulator = 0;
    @@ -1411,7 +1423,11 @@
    memset(inp, 0, sizeof(*inp));

    inp->index = index;
    +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
    strlcpy(inp->name, "loopback", sizeof(inp->name));
    +#else

  • strscpy(inp->name, "loopback", sizeof(inp->name));
    +#endif
    inp->type = V4L2_INPUT_TYPE_CAMERA;
    inp->audioset = 0;
    inp->tuner = 0;

replacing the function for kernels > 6.8 works for me, but i don't feel involved enough with the code, so i want you to look over it and decide if that is a good idea or not. Hope it helps.

@cbricart
Copy link

@jschwender fix is already in (yet unreleased) code: first with commit ee177b6 and refined by commit b261f19

@edmundlaugasson
Copy link

edmundlaugasson commented Mar 18, 2024

I can confirm with EndeavourOS:
kernel 6.8.1-arch1-1
v4l2loopback-dkms 0.12.7-2
v4l-utils 1.26.1-1

DKMS make.log for v4l2loopback-0.12.7 for kernel 6.8.1-arch1-1 (x86_64)
Sunday, March 17 2024 10:33:34 EET
Building v4l2-loopback driver...
make -C /usr/lib/modules/6.8.1-arch1-1/build M=/var/lib/dkms/v4l2loopback/0.12.7/build modules
make[1]: Entering directory '/usr/lib/modules/6.8.1-arch1-1/build'
  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:717:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
  717 |         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/lib/modules/6.8.1-arch1-1/build/Makefile:1921: /var/lib/dkms/v4l2loopback/0.12.7/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.8.1-arch1-1/build'
make: *** [Makefile:43: v4l2loopback.ko] Error 2

@umlaeute umlaeute added pending duplicate there's already a bug describing the same problem. please enhance the original issue. topic:kernel things regarding the actual kernel module and removed needs triage new issues labels Mar 19, 2024
@command-z-z
Copy link

I can confirm with EndeavourOS: kernel 6.8.1-arch1-1 v4l2loopback-dkms 0.12.7-2 v4l-utils 1.26.1-1

DKMS make.log for v4l2loopback-0.12.7 for kernel 6.8.1-arch1-1 (x86_64)
Sunday, March 17 2024 10:33:34 EET
Building v4l2-loopback driver...
make -C /usr/lib/modules/6.8.1-arch1-1/build M=/var/lib/dkms/v4l2loopback/0.12.7/build modules
make[1]: Entering directory '/usr/lib/modules/6.8.1-arch1-1/build'
  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:717:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
  717 |         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/lib/modules/6.8.1-arch1-1/build/Makefile:1921: /var/lib/dkms/v4l2loopback/0.12.7/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.8.1-arch1-1/build'
make: *** [Makefile:43: v4l2loopback.ko] Error 2

v4l2loopback/0.13.1.r8.gc94a1e8 fix the problem, you can update this package:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate there's already a bug describing the same problem. please enhance the original issue. pending topic:kernel things regarding the actual kernel module
Projects
None yet
Development

No branches or pull requests

5 participants