From 024a28e5e8b6eea0aec56f937212b0c26b44452c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 10 Dec 2014 12:23:11 +0100 Subject: [PATCH] v4l2loopback: fix build in kernel 3.18 --- .../linux/v4l2loopback/default.nix | 2 ++ .../linux/v4l2loopback/kernel-3.18-fix.patch | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch diff --git a/pkgs/os-specific/linux/v4l2loopback/default.nix b/pkgs/os-specific/linux/v4l2loopback/default.nix index 5b88d4c75560..127341412abe 100644 --- a/pkgs/os-specific/linux/v4l2loopback/default.nix +++ b/pkgs/os-specific/linux/v4l2loopback/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { sed -i '/depmod/d' Makefile export PATH=${kmod}/sbin:$PATH ''; + + patches = [ ./kernel-3.18-fix.patch ]; buildInputs = [ kmod ]; diff --git a/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch b/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch new file mode 100644 index 000000000000..9f6dc57f322a --- /dev/null +++ b/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch @@ -0,0 +1,31 @@ +From 21195cd6d1ff767a271359dfa7d201078f766611 Mon Sep 17 00:00:00 2001 +From: tatokis +Date: Mon, 24 Nov 2014 16:28:33 +0200 +Subject: [PATCH] Updated v4l2loopback.c to compile on >= 3.18 kernel + +--- + v4l2loopback.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/v4l2loopback.c b/v4l2loopback.c +index bb228bb..67f6ed4 100644 +--- a/v4l2loopback.c ++++ b/v4l2loopback.c +@@ -498,10 +498,15 @@ static ssize_t attr_store_maxopeners(struct device *cd, + { + struct v4l2_loopback_device *dev = NULL; + unsigned long curr = 0; +- ++ ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) ++ if (kstrtoul(buf, 0, &curr)) ++ return -EINVAL; ++ #else + if (strict_strtoul(buf, 0, &curr)) + return -EINVAL; +- ++ #endif ++ + dev = v4l2loopback_cd2dev(cd); + + if (dev->max_openers == curr)