Skip to contentSkip to conversation

util-linux-native: workaround the build on CentOS 5.10

PATCH New Mark Hatle 1 participant 1 message Nov 19, 2014

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 util-linux-native: workaround the build on CentOS 5.10

From: Robert Yang <[email protected]>

[ Sent for Yocto Project compliance, unlikely to be generally applicable ]

There are no MS_* macros are added after glibc 2.7.0, but it is 2.5 on CentOS 5.10, so workaround atm, I think that we can try to use the macros from libmount.h as a fix.

---
 .../util-linux/util-linux-native-MS.patch          | 48 ++++++++++++++++++++++
 meta/recipes-core/util-linux/util-linux_2.24.2.bb  |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-native-MS.patch
meta/recipes-core/util-linux/util-linux/util-linux-native-MS.patch new file +48 -0
new file mode 100644
index 0000000..971050c
@@ -0,0 +1,48 @@
+From 3664b148e8f72be2d70dc66265edd9f52940ac00 Mon Sep 17 00:00:00 2001
+From: Robert Yang <[email protected]>
+Date: Thu, 27 Mar 2014 13:56:40 +0000
+Subject: [PATCH] sys-utils/unshare.c: fix build on CentOS 10
+
+There are no MS_* macros are added after glibc 2.7.0, but it is 2.5 on
+CentOS 5.10, so workaround atm, I think that we can try to use the
+macros from libmount.h as a fix.
+
+Signed-off-by: Robert Yang <[email protected]>
+---
+ sys-utils/unshare.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
+index 114f17d..f293c03 100644
+--- a/sys-utils/unshare.c
++++ b/sys-utils/unshare.c
+@@ -33,6 +33,26 @@
+ #include "namespace.h"
+ #include "exec_shell.h"
+ 
++#ifndef MS_PRIVATE
++#define MS_PRIVATE      (1<<18) /* 262144 Private*/
++#endif
++
++#ifndef MS_REC
++#define MS_REC          0x4000  /* 16384: Recursive loopback */
++#endif
++
++#ifndef MS_NOSUID
++#define MS_NOSUID        2      /* Ignore suid and sgid bits */
++#endif
++
++#ifndef MS_NOEXEC
++#define MS_NOEXEC        8      /* Disallow program execution */
++#endif
++
++#ifndef MS_NODEV
++#define MS_NODEV         4      /* Disallow access to device special files */
++#endif
++
+ static void usage(int status)
+ {
+ 	FILE *out = status == EXIT_SUCCESS ? stdout : stderr;
+-- 
+1.8.3.4
+
meta/recipes-core/util-linux/util-linux_2.24.2.bb +1 -0
index ed753e4..d0fc3de 100644
@@ -7,6 +7,7 @@ PR = "r1"
 OLDHOST = ""
 OLDHOST_class-native = "file://util-linux-native.patch \
                         file://util-linux-native-qsort.patch \
+                        file://util-linux-native-MS.patch \
 			"
 
 SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
Signature · 1 line
1.9.3