util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure.ac: add lsns option
@ 2022-04-05 18:04 Fabrice Fontaine
  2022-04-06  8:43 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2022-04-05 18:04 UTC (permalink / raw)
  To: util-linux; +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);
      |                         ^~~~~~~~~~~~~

So add an option to allow the user to disable lsns

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 configure.ac | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 11c86b9a7..52c5b280a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1922,7 +1922,11 @@ UL_REQUIRES_LINUX([lsipc])
 UL_REQUIRES_BUILD([lsipc], [libsmartcols])
 AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes])
 
-UL_BUILD_INIT([lsns], [check])
+AC_ARG_ENABLE([lsns],
+  AS_HELP_STRING([--disable-lsns], [do not build lsns]),
+  [], [UL_DEFAULT_ENABLE([lsns], [check])]
+)
+UL_BUILD_INIT([lsns])
 UL_REQUIRES_LINUX([lsns])
 UL_REQUIRES_BUILD([lsns], [libsmartcols])
 UL_REQUIRES_BUILD([lsns], [libmount])
-- 
2.35.1


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

* Re: [PATCH] configure.ac: add lsns option
  2022-04-05 18:04 [PATCH] configure.ac: add lsns option Fabrice Fontaine
@ 2022-04-06  8:43 ` Karel Zak
  2022-04-06  9:33   ` Fabrice Fontaine
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2022-04-06  8:43 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: util-linux

On Tue, Apr 05, 2022 at 08:04:59PM +0200, Fabrice Fontaine wrote:
>  configure.ac | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks.

It's good idea to add --disable-lsns, but for your use-case it's
workaround. The proper solution is to compile lsns, but without
NS_GET_ ioctls. Fixed by:

    https://github.com/util-linux/util-linux/commit/fc686823b008bc95e2ebe904c706a117a03e2754

 Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


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

* Re: [PATCH] configure.ac: add lsns option
  2022-04-06  8:43 ` Karel Zak
@ 2022-04-06  9:33   ` Fabrice Fontaine
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-04-06  9:33 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

Thanks for your quick feedback, I'll backport your patch to buildroot.

Best Regards,

Fabrice


Le mer. 6 avr. 2022 à 10:43, Karel Zak <kzak@redhat.com> a écrit :
>
> On Tue, Apr 05, 2022 at 08:04:59PM +0200, Fabrice Fontaine wrote:
> >  configure.ac | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
>
> Applied, thanks.
>
> It's good idea to add --disable-lsns, but for your use-case it's
> workaround. The proper solution is to compile lsns, but without
> NS_GET_ ioctls. Fixed by:
>
>     https://github.com/util-linux/util-linux/commit/fc686823b008bc95e2ebe904c706a117a03e2754
>
>  Karel
>
> --
>  Karel Zak  <kzak@redhat.com>
>  http://karelzak.blogspot.com
>

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 18:04 [PATCH] configure.ac: add lsns option Fabrice Fontaine
2022-04-06  8:43 ` Karel Zak
2022-04-06  9:33   ` Fabrice Fontaine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).