From 5b149694093a74402b1f41b5a8e16687cd19be05 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Wed, 6 Apr 2022 18:37:29 +0200 Subject: [PATCH] package/util-linux: fix build on kernel < 4.11 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 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- ...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 +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 +Signed-off-by: Karel Zak + +[Retrieved from: +https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=fc686823b008bc95e2ebe904c706a117a03e2754] +Signed-off-by: Fabrice Fontaine +--- + 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 +-# 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 +