[OE-core] [PATCH][dizzy] util-linux-native: workaround the build on CentOS 5.10

Mark Hatle mark.hatle at windriver.com
Wed Nov 19 02:41:43 UTC 2014


From: Robert Yang <liezhi.yang at windriver.com>

[ 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.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
---
 .../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

diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native-MS.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native-MS.patch
new file mode 100644
index 0000000..971050c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-native-MS.patch
@@ -0,0 +1,48 @@
+From 3664b148e8f72be2d70dc66265edd9f52940ac00 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang at windriver.com>
+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 <liezhi.yang at windriver.com>
+---
+ 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
+
diff --git a/meta/recipes-core/util-linux/util-linux_2.24.2.bb b/meta/recipes-core/util-linux/util-linux_2.24.2.bb
index ed753e4..d0fc3de 100644
--- a/meta/recipes-core/util-linux/util-linux_2.24.2.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.24.2.bb
@@ -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 \
-- 
1.9.3




More information about the Openembedded-core mailing list