* [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers
@ 2023-04-12 22:40 Stefan Ott via buildroot
2023-04-15 12:51 ` Yann E. MORIN
2023-04-23 9:28 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Ott via buildroot @ 2023-04-12 22:40 UTC (permalink / raw)
To: buildroot; +Cc: Eric Le Bihan, Bernd Kuhls, Stefan Ott
Kernel versions prior to 3.4 did not have V4L2_CAP_DEVICE_CAPS and
compiling against such a kernel will fail.
This patch introduces a version check and makes eudev fall back to
v2cap.capabilities on these kernels.
Upstream: https://github.com/eudev-project/eudev/pull/247
Signed-off-by: Stefan Ott <stefan@ott.net>
---
Changes v1 -> v2 (suggested by Arnout Vandecappelle):
- Clarified description to talk about kernel *headers*
- Use a git-formatted patch instead
- Added a Signed-off-by line
- Added upstream reference
...mpile-time-issue-on-very-old-kernels.patch | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
diff --git a/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch b/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
new file mode 100644
index 0000000000..c18ce2ad5a
--- /dev/null
+++ b/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
@@ -0,0 +1,43 @@
+From 09b536e0b9d0964674936901ab9d2954f935c8b4 Mon Sep 17 00:00:00 2001
+From: Stefan Ott <stefan@ott.net>
+Date: Wed, 5 Apr 2023 18:20:37 +0200
+Subject: [PATCH] Fix compile-time issue on very old kernels
+
+Kernel versions prior to 3.4 did not have V4L2_CAP_DEVICE_CAPS and
+compiling against such a kernel will fail.
+
+This patch introduces a version check and makes eudev fall back to
+v2cap.capabilities on these kernels.
+
+Signed-off-by: Stefan Ott <stefan@ott.net>
+---
+ src/v4l_id/v4l_id.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/v4l_id/v4l_id.c b/src/v4l_id/v4l_id.c
+index 6bf45effe..702d5b687 100644
+--- a/src/v4l_id/v4l_id.c
++++ b/src/v4l_id/v4l_id.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
++#include <linux/version.h>
+ #include <linux/videodev2.h>
+
+ #include "util.h"
+@@ -71,9 +72,11 @@ int main(int argc, char *argv[]) {
+ printf("ID_V4L_VERSION=2\n");
+ printf("ID_V4L_PRODUCT=%s\n", v2cap.card);
+ printf("ID_V4L_CAPABILITIES=:");
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+ if (v2cap.capabilities & V4L2_CAP_DEVICE_CAPS)
+ capabilities = v2cap.device_caps;
+ else
++#endif
+ capabilities = v2cap.capabilities;
+ if ((capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0 ||
+ (capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) > 0)
+--
+2.40.0
+
--
2.40.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers
2023-04-12 22:40 [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers Stefan Ott via buildroot
@ 2023-04-15 12:51 ` Yann E. MORIN
2023-04-23 9:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2023-04-15 12:51 UTC (permalink / raw)
To: Stefan Ott; +Cc: Eric Le Bihan, Bernd Kuhls, buildroot
Stefan, All,
On 2023-04-13 00:40 +0200, Stefan Ott via buildroot spake thusly:
> Kernel versions prior to 3.4 did not have V4L2_CAP_DEVICE_CAPS and
> compiling against such a kernel will fail.
>
> This patch introduces a version check and makes eudev fall back to
> v2cap.capabilities on these kernels.
>
> Upstream: https://github.com/eudev-project/eudev/pull/247
I've moved the upstream reference into the patch itself, since that's
where it'll be easier to find when we need to asses the patch status
next time we bump the package.
And since the PR was accepted and merged, I've changed the reference to
the commit URL.
Applied to master, thanks.
Regards,
Yann E. MORIN.
> Signed-off-by: Stefan Ott <stefan@ott.net>
> ---
> Changes v1 -> v2 (suggested by Arnout Vandecappelle):
> - Clarified description to talk about kernel *headers*
> - Use a git-formatted patch instead
> - Added a Signed-off-by line
> - Added upstream reference
>
> ...mpile-time-issue-on-very-old-kernels.patch | 43 +++++++++++++++++++
> 1 file changed, 43 insertions(+)
> create mode 100644 package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
>
> diff --git a/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch b/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
> new file mode 100644
> index 0000000000..c18ce2ad5a
> --- /dev/null
> +++ b/package/eudev/0002-Fix-compile-time-issue-on-very-old-kernels.patch
> @@ -0,0 +1,43 @@
> +From 09b536e0b9d0964674936901ab9d2954f935c8b4 Mon Sep 17 00:00:00 2001
> +From: Stefan Ott <stefan@ott.net>
> +Date: Wed, 5 Apr 2023 18:20:37 +0200
> +Subject: [PATCH] Fix compile-time issue on very old kernels
> +
> +Kernel versions prior to 3.4 did not have V4L2_CAP_DEVICE_CAPS and
> +compiling against such a kernel will fail.
> +
> +This patch introduces a version check and makes eudev fall back to
> +v2cap.capabilities on these kernels.
> +
> +Signed-off-by: Stefan Ott <stefan@ott.net>
> +---
> + src/v4l_id/v4l_id.c | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/src/v4l_id/v4l_id.c b/src/v4l_id/v4l_id.c
> +index 6bf45effe..702d5b687 100644
> +--- a/src/v4l_id/v4l_id.c
> ++++ b/src/v4l_id/v4l_id.c
> +@@ -28,6 +28,7 @@
> + #include <sys/types.h>
> + #include <sys/time.h>
> + #include <sys/ioctl.h>
> ++#include <linux/version.h>
> + #include <linux/videodev2.h>
> +
> + #include "util.h"
> +@@ -71,9 +72,11 @@ int main(int argc, char *argv[]) {
> + printf("ID_V4L_VERSION=2\n");
> + printf("ID_V4L_PRODUCT=%s\n", v2cap.card);
> + printf("ID_V4L_CAPABILITIES=:");
> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
> + if (v2cap.capabilities & V4L2_CAP_DEVICE_CAPS)
> + capabilities = v2cap.device_caps;
> + else
> ++#endif
> + capabilities = v2cap.capabilities;
> + if ((capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0 ||
> + (capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) > 0)
> +--
> +2.40.0
> +
> --
> 2.40.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers
2023-04-12 22:40 [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers Stefan Ott via buildroot
2023-04-15 12:51 ` Yann E. MORIN
@ 2023-04-23 9:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-04-23 9:28 UTC (permalink / raw)
To: Stefan Ott via buildroot; +Cc: Eric Le Bihan, Bernd Kuhls, Stefan Ott
>>>>> "Stefan" == Stefan Ott via buildroot <buildroot@buildroot.org> writes:
> Kernel versions prior to 3.4 did not have V4L2_CAP_DEVICE_CAPS and
> compiling against such a kernel will fail.
> This patch introduces a version check and makes eudev fall back to
> v2cap.capabilities on these kernels.
> Upstream: https://github.com/eudev-project/eudev/pull/247
> Signed-off-by: Stefan Ott <stefan@ott.net>
> ---
> Changes v1 -> v2 (suggested by Arnout Vandecappelle):
> - Clarified description to talk about kernel *headers*
> - Use a git-formatted patch instead
> - Added a Signed-off-by line
> - Added upstream reference
Committed to 2023.02.x and 2022.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-23 9:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 22:40 [Buildroot] [PATCH v2 1/1] package/eudev: fix compile-time issue with very old kernel headers Stefan Ott via buildroot
2023-04-15 12:51 ` Yann E. MORIN
2023-04-23 9:28 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox