All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/util-linux: fix build on kernel < 4.11
@ 2022-04-06 16:37 Fabrice Fontaine
  2022-04-14 19:25 ` Arnout Vandecappelle
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-04-06 16:37 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

lsns unconditionally uses NS_GET_NSTYPE since version 2.38 and
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=de72df79d72fa906e71e2ac922d8745ff22deee5
which is only available since kernel 4.11 and
https://github.com/torvalds/linux/commit/e5ff5ce6e20ee22511398bb31fb912466cf82a36
resulting in the following build failure:

sys-utils/lsns.c: In function 'add_namespace_for_nsfd':
sys-utils/lsns.c:719:25: error: 'NS_GET_NSTYPE' undeclared (first use in this function)
  719 |  clone_type = ioctl(fd, NS_GET_NSTYPE);
      |                         ^~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/572ecf8e37ac733a4e4265f4f78f35230337278e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...improve-dependence-on-NS_GET_-ioctls.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch

diff --git a/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch b/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch
new file mode 100644
index 0000000000..8e79b8d4d3
--- /dev/null
+++ b/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch
@@ -0,0 +1,34 @@
+From fc686823b008bc95e2ebe904c706a117a03e2754 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 6 Apr 2022 10:38:43 +0200
+Subject: lsns: improve dependence on NS_GET_ ioctls
+
+Fixes: http://autobuild.buildroot.org/results/572ecf8e37ac733a4e4265f4f78f35230337278e
+Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+
+[Retrieved from:
+https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=fc686823b008bc95e2ebe904c706a117a03e2754]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ sys-utils/lsns.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
+index 1a7e9f333..75625b3a6 100644
+--- a/sys-utils/lsns.c
++++ b/sys-utils/lsns.c
+@@ -40,7 +40,9 @@
+ 
+ #ifdef HAVE_LINUX_NSFS_H
+ # include <linux/nsfs.h>
+-# define USE_NS_GET_API	1
++# if defined(NS_GET_NSTYPE) && defined(NS_GET_OWNER_UID)
++#  define USE_NS_GET_API	1
++# endif
+ #endif
+ 
+ #include "pathnames.h"
+-- 
+cgit 
+
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/util-linux: fix build on kernel < 4.11
  2022-04-06 16:37 [Buildroot] [PATCH 1/1] package/util-linux: fix build on kernel < 4.11 Fabrice Fontaine
@ 2022-04-14 19:25 ` Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2022-04-14 19:25 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot



On 06/04/2022 18:37, Fabrice Fontaine wrote:
> lsns unconditionally uses NS_GET_NSTYPE since version 2.38 and
> https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=de72df79d72fa906e71e2ac922d8745ff22deee5
> which is only available since kernel 4.11 and
> https://github.com/torvalds/linux/commit/e5ff5ce6e20ee22511398bb31fb912466cf82a36
> resulting in the following build failure:
> 
> sys-utils/lsns.c: In function 'add_namespace_for_nsfd':
> sys-utils/lsns.c:719:25: error: 'NS_GET_NSTYPE' undeclared (first use in this function)
>    719 |  clone_type = ioctl(fd, NS_GET_NSTYPE);
>        |                         ^~~~~~~~~~~~~
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/572ecf8e37ac733a4e4265f4f78f35230337278e
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   ...improve-dependence-on-NS_GET_-ioctls.patch | 34 +++++++++++++++++++
>   1 file changed, 34 insertions(+)
>   create mode 100644 package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch
> 
> diff --git a/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch b/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch
> new file mode 100644
> index 0000000000..8e79b8d4d3
> --- /dev/null
> +++ b/package/util-linux/0001-lsns-improve-dependence-on-NS_GET_-ioctls.patch
> @@ -0,0 +1,34 @@
> +From fc686823b008bc95e2ebe904c706a117a03e2754 Mon Sep 17 00:00:00 2001
> +From: Karel Zak <kzak@redhat.com>
> +Date: Wed, 6 Apr 2022 10:38:43 +0200
> +Subject: lsns: improve dependence on NS_GET_ ioctls
> +
> +Fixes: http://autobuild.buildroot.org/results/572ecf8e37ac733a4e4265f4f78f35230337278e
> +Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Signed-off-by: Karel Zak <kzak@redhat.com>
> +
> +[Retrieved from:
> +https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=fc686823b008bc95e2ebe904c706a117a03e2754]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + sys-utils/lsns.c | 4 +++-
> + 1 file changed, 3 insertions(+), 1 deletion(-)
> +
> +diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
> +index 1a7e9f333..75625b3a6 100644
> +--- a/sys-utils/lsns.c
> ++++ b/sys-utils/lsns.c
> +@@ -40,7 +40,9 @@
> +
> + #ifdef HAVE_LINUX_NSFS_H
> + # include <linux/nsfs.h>
> +-# define USE_NS_GET_API	1
> ++# if defined(NS_GET_NSTYPE) && defined(NS_GET_OWNER_UID)
> ++#  define USE_NS_GET_API	1
> ++# endif
> + #endif
> +
> + #include "pathnames.h"
> +--
> +cgit
> +
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-14 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 16:37 [Buildroot] [PATCH 1/1] package/util-linux: fix build on kernel < 4.11 Fabrice Fontaine
2022-04-14 19:25 ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.