Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
deleted file mode 100644
index 7ec66f8..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From ae10245c15a617bd57337981bb42eb36629f9b59 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Wed, 8 Feb 2017 15:53:31 +0800
-Subject: [PATCH 01/26] add _GNU_SOURCE to pec_listener.c
-
-In previous patch 0007-replace-SIGCLD-with-SIGCHLD.patch made by Khem Raj
-contains two aspects:
-
-	1. replace SIGCLD with SIGCHLD
-	2. add _GNU_SOURCE to pec_listener.c
-
-The replace SIGCLD with SIGCHLD have been integrated upstream, so make a
-another patch to add _GNU_SOURCE to pec_listener.c comply with Khem Raj's
-previous patch.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
-Upstream-Status: Pending
-
-%% original patch: 0001-add-_GNU_SOURCE-to-pec_listener.c.patch
----
- testcases/kernel/connectors/pec/pec_listener.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
-index d11e4dc..b8b5e0d 100644
---- a/testcases/kernel/connectors/pec/pec_listener.c
-+++ b/testcases/kernel/connectors/pec/pec_listener.c
-@@ -20,6 +20,7 @@
- /*                                                                            */
- /******************************************************************************/
- 
-+#define _GNU_SOURCE
- #include <sys/socket.h>
- #include <sys/poll.h>
- #include <sys/types.h>
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch
new file mode 100644
index 0000000..da62687
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch
@@ -0,0 +1,31 @@
+From 4ace68a6ba501907a0741dba5f5f155e06a74c35 Mon Sep 17 00:00:00 2001
+From: Petr Vorel <pvorel@suse.cz>
+Date: Wed, 7 Feb 2018 11:09:49 +0100
+Subject: [PATCH] configure: Fix default value of --without-numa switch in help
+
+The default value is no.
+
+Fixes: 39a85a1f1 ("configure: add knob to control numa support")
+
+Signed-off-by: Petr Vorel <pvorel@suse.cz>
+Upstream-Status: Accepted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b39a31d..d66ea00 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,7 +86,7 @@ fi
+ # Numa
+ AC_ARG_WITH([numa],
+   AC_HELP_STRING([--without-numa],
+-    [without numa support (default=yes)]),
++    [without numa support (default=no)]),
+   [with_numa=no],
+   [with_numa=yes]
+ )
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch
new file mode 100644
index 0000000..8aaa287
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch
@@ -0,0 +1,50 @@
+From 39a85a1f1e6624f554215ba4b6843d3689a8415e Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Mon, 5 Feb 2018 11:56:04 +0100
+Subject: [PATCH] configure: add knob to control numa support
+
+Allow to disable numa from the top level.
+
+Based on patch:
+http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/ltp?id=4c7873552e13dfdba96afca7562c398d2966ca71
+
+Reported-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+Signed-off-by: Petr Vorel <pvorel@suse.cz>
+Upstream-Status: Accepted
+---
+ configure.ac | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 5c8d4ea..b39a31d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,6 +83,14 @@ else
+     AC_SUBST([WITH_EXPECT],["no"])
+ fi
+ 
++# Numa
++AC_ARG_WITH([numa],
++  AC_HELP_STRING([--without-numa],
++    [without numa support (default=yes)]),
++  [with_numa=no],
++  [with_numa=yes]
++)
++
+ # Perl
+ AC_ARG_WITH([perl],
+   [AC_HELP_STRING([--with-perl],
+@@ -157,7 +165,9 @@ LTP_CHECK_SELINUX
+ LTP_CHECK_SIGNAL
+ LTP_CHECK_SYSCALL_EVENTFD
+ LTP_CHECK_SYSCALL_MODIFY_LDT
++if test "x$with_numa" = xyes; then
+ LTP_CHECK_SYSCALL_NUMA
++fi
+ LTP_CHECK_SYSCALL_QUOTACTL
+ LTP_CHECK_SYSCALL_SIGNALFD
+ LTP_CHECK_SYSCALL_UNSHARE
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
deleted file mode 100644
index 9865020..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001
-From: "Roy.Li" <rongqing.li@windriver.com>
-Date: Thu, 7 Jan 2016 17:33:26 +0000
-Subject: [PATCH 02/32] Add knob to control whether numa support should be
- checked
-
-otherwise undeterministic dependency will be generated
-during build depending upong numa being staged or not
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
----
- m4/ltp-numa.m4 | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
-index 60ae07b..ed7078d 100644
---- a/m4/ltp-numa.m4
-+++ b/m4/ltp-numa.m4
-@@ -24,7 +24,13 @@ dnl ----------------------------
- dnl
- AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
- [dnl
--AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
-+AC_MSG_CHECKING([for numa])
-+AC_ARG_WITH(
-+	[numa],
-+	AC_HELP_STRING([--without-numa],
-+	[without numa support]),
-+	[],
-+	[AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
- 	LTP_SYSCALL_NUMA_HEADERS=yes
- 	AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
- 	if  test "x$have_numa_alloc_onnode" = "xyes"; then
-@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then
- 	AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests])
- fi
- )])
-+AC_MSG_RESULT([$with_numa])
-+])
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
index cf74463..84ab37e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
@@ -22,10 +22,10 @@
  testcases/realtime/stress/pi-tests/Makefile | 5 +++++
  8 files changed, 35 insertions(+), 2 deletions(-)
 
-diff --git a/Makefile b/Makefile
-index 297f8e7..906b280 100644
---- a/Makefile
-+++ b/Makefile
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
 @@ -49,6 +49,11 @@ SKIP_IDCHECK		?= 0
  UCLINUX			?= 0
  export UCLINUX
@@ -38,11 +38,11 @@
  # CLEAN_TARGETS:	Targets which exist solely in clean.
  # COMMON_TARGETS:	Targets which exist in all, clean, and install.
  # INSTALL_TARGETS:	Targets which exist in clean and install (contains
-diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
-index 50a12fa..4f1987f 100644
---- a/testcases/kernel/Makefile
-+++ b/testcases/kernel/Makefile
-@@ -47,13 +47,16 @@ SUBDIRS			+= connectors \
+Index: git/testcases/kernel/Makefile
+===================================================================
+--- git.orig/testcases/kernel/Makefile
++++ git/testcases/kernel/Makefile
+@@ -48,13 +48,16 @@ SUBDIRS			+= connectors \
  			   logging \
  			   mem \
  			   numa \
@@ -60,10 +60,10 @@
  ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
  SUBDIRS			+= power_management
  endif
-diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
-index 6245ed0..aa4eb7f 100644
---- a/testcases/kernel/sched/Makefile
-+++ b/testcases/kernel/sched/Makefile
+Index: git/testcases/kernel/sched/Makefile
+===================================================================
+--- git.orig/testcases/kernel/sched/Makefile
++++ git/testcases/kernel/sched/Makefile
 @@ -23,5 +23,7 @@
  top_srcdir		?= ../../..
  
@@ -73,11 +73,11 @@
 +	FILTER_OUT_DIRS += process_stress
 +endif
  include $(top_srcdir)/include/mk/generic_trunk_target.mk
-diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
-index 8acb395..b749126 100644
---- a/testcases/kernel/syscalls/Makefile
-+++ b/testcases/kernel/syscalls/Makefile
-@@ -28,5 +28,10 @@ ifeq ($(UCLINUX),1)
+Index: git/testcases/kernel/syscalls/Makefile
+===================================================================
+--- git.orig/testcases/kernel/syscalls/Makefile
++++ git/testcases/kernel/syscalls/Makefile
+@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1)
  FILTER_OUT_DIRS	+= capget capset chmod chown clone fork getcontext llseek \
  		   mincore mprotect nftw profil remap_file_pages sbrk
  endif
@@ -87,12 +87,13 @@
 +		   ustat
 +endif
  
- include $(top_srcdir)/include/mk/generic_trunk_target.mk
-diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
-index 8bc78c2..c36cf50 100644
---- a/testcases/network/nfsv4/acl/Makefile
-+++ b/testcases/network/nfsv4/acl/Makefile
-@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
+ ifeq ($(UCLIBC),1)
+ FILTER_OUT_DIRS	+= profil
+Index: git/testcases/network/nfsv4/acl/Makefile
+===================================================================
+--- git.orig/testcases/network/nfsv4/acl/Makefile
++++ git/testcases/network/nfsv4/acl/Makefile
+@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre
  
  LDLIBS			+= $(ACL_LIBS)
  
@@ -101,10 +102,10 @@
 +endif
 +
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
-diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile
-index 3160813..9bdf5d0 100644
---- a/testcases/network/rpc/basic_tests/Makefile
-+++ b/testcases/network/rpc/basic_tests/Makefile
+Index: git/testcases/network/rpc/basic_tests/Makefile
+===================================================================
+--- git.orig/testcases/network/rpc/basic_tests/Makefile
++++ git/testcases/network/rpc/basic_tests/Makefile
 @@ -23,4 +23,9 @@
  top_srcdir		?= ../../../..
  
@@ -115,11 +116,11 @@
 +endif
 +
  include $(top_srcdir)/include/mk/generic_trunk_target.mk
-diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
-index 7a7a57a..5808866 100644
---- a/testcases/realtime/func/pi-tests/Makefile
-+++ b/testcases/realtime/func/pi-tests/Makefile
-@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
+Index: git/testcases/realtime/func/pi-tests/Makefile
+===================================================================
+--- git.orig/testcases/realtime/func/pi-tests/Makefile
++++ git/testcases/realtime/func/pi-tests/Makefile
+@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre
  include $(abs_srcdir)/../../config.mk
  
  MAKE_TARGETS		:= testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex
@@ -129,10 +130,10 @@
 +
  
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
-diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
-index 5edc3b4..aa5987a 100644
---- a/testcases/realtime/stress/pi-tests/Makefile
-+++ b/testcases/realtime/stress/pi-tests/Makefile
+Index: git/testcases/realtime/stress/pi-tests/Makefile
+===================================================================
+--- git.orig/testcases/realtime/stress/pi-tests/Makefile
++++ git/testcases/realtime/stress/pi-tests/Makefile
 @@ -24,4 +24,9 @@ top_srcdir		?= ../../../..
  
  include $(top_srcdir)/include/mk/env_pre.mk
@@ -143,6 +144,3 @@
 +endif
 +
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
deleted file mode 100644
index 25f6ba7..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From dc1905b6d972f9176b40da270c83d8fb4d1751b5 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Wed, 8 Feb 2017 16:12:34 +0800
-Subject: [PATCH 2/5] Rename sigset variable to sigset1
-
-sigset API from signal.h is shadowed by this name conflict
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
-
-Upstream-Status: Pending
----
- testcases/kernel/mem/shmt/shmt04.c                    | 10 +++++-----
- testcases/kernel/mem/shmt/shmt06.c                    | 10 +++++-----
- testcases/kernel/syscalls/sigprocmask/sigprocmask01.c | 10 +++++-----
- 3 files changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
-index b2682da..3f35fad 100644
---- a/testcases/kernel/mem/shmt/shmt04.c
-+++ b/testcases/kernel/mem/shmt/shmt04.c
-@@ -56,7 +56,7 @@ int TST_TOTAL = 2;		/* Total number of test cases. */
- /**************/
- 
- key_t key;
--sigset_t set;
-+sigset_t set1;
- 
- #define  SIZE  16*1024
- 
-@@ -71,9 +71,9 @@ int main(void)
- 
- 	key = (key_t) getpid();
- 
--	sigemptyset(&set);
--	sigaddset(&set, SIGUSR1);
--	sigprocmask(SIG_BLOCK, &set, NULL);
-+	sigemptyset(&set1);
-+	sigaddset(&set1, SIGUSR1);
-+	sigprocmask(SIG_BLOCK, &set1, NULL);
- 
- 	pid = fork();
- 	switch (pid) {
-@@ -148,7 +148,7 @@ int child(void)
- 	char *cp;
- 	int sig;
- 
--	sigwait(&set, &sig);
-+	sigwait(&set1, &sig);
- 	chld_pid = getpid();
- /*--------------------------------------------------------*/
- 
-diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
-index dd69de7..56fb1da 100644
---- a/testcases/kernel/mem/shmt/shmt06.c
-+++ b/testcases/kernel/mem/shmt/shmt06.c
-@@ -57,7 +57,7 @@ int TST_TOTAL = 2;		/* Total number of test cases. */
- /**************/
- 
- key_t key;
--sigset_t set;
-+sigset_t set1;
- 
- int child();
- static int rm_shm(int);
-@@ -70,9 +70,9 @@ int main(void)
- 
- 	key = (key_t) getpid();
- 
--	sigemptyset(&set);
--	sigaddset(&set, SIGUSR1);
--	sigprocmask(SIG_BLOCK, &set, NULL);
-+	sigemptyset(&set1);
-+	sigaddset(&set1, SIGUSR1);
-+	sigprocmask(SIG_BLOCK, &set1, NULL);
- 
- 	pid = fork();
- 	switch (pid) {
-@@ -147,7 +147,7 @@ int child(void)
- 	char *cp;
- 	int sig;
- 
--	sigwait(&set, &sig);
-+	sigwait(&set1, &sig);
- 	chld_pid = getpid();
- 
- 	if ((shmid = shmget(key, SIZE, 0)) < 0) {
-diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
-index 232d25a..06d902f 100644
---- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
-+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
-@@ -91,7 +91,7 @@ int TST_TOTAL = 1;
- int sig_catch = 0;		/* variable to blocked/unblocked signals */
- 
- struct sigaction sa_new;	/* struct to hold signal info */
--sigset_t set;		/* signal set to hold signal lists */
-+sigset_t set1;		/* signal set to hold signal lists */
- sigset_t sigset2;
- 
- int main(int ac, char **av)
-@@ -112,7 +112,7 @@ int main(int ac, char **av)
- 		 * so that, signal will not be delivered to
- 		 * the test process.
- 		 */
--		TEST(sigprocmask(SIG_BLOCK, &set, 0));
-+		TEST(sigprocmask(SIG_BLOCK, &set1, 0));
- 
- 		/* Get the process id of test process */
- 		my_pid = getpid();
-@@ -165,7 +165,7 @@ int main(int ac, char **av)
- 				 */
- 				errno = 0;
- 				if (sigprocmask(SIG_UNBLOCK,
--						&set, 0) == -1) {
-+						&set1, 0) == -1) {
- 					tst_brkm(TFAIL, cleanup,
- 						 "sigprocmask() failed "
- 						 "to unblock signal, "
-@@ -212,7 +212,7 @@ void setup(void)
- 	 * Initialise the signal sets with the list that
- 	 * excludes/includes  all system-defined signals.
- 	 */
--	if (sigemptyset(&set) == -1) {
-+	if (sigemptyset(&set1) == -1) {
- 		tst_brkm(TFAIL, cleanup,
- 			 "sigemptyset() failed, errno=%d : %s",
- 			 errno, strerror(errno));
-@@ -235,7 +235,7 @@ void setup(void)
- 	 * Add specified signal (SIGINT) to the signal set
- 	 * which excludes system-defined signals.
- 	 */
--	if (sigaddset(&set, SIGINT) == -1) {
-+	if (sigaddset(&set1, SIGINT) == -1) {
- 		tst_brkm(TFAIL, cleanup,
- 			 "sigaddset() failed, errno=%d : %s",
- 			 errno, strerror(errno));
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
index 3e79c9f..462976d 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
@@ -18,10 +18,10 @@
  testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
  3 files changed, 7 insertions(+), 1 deletion(-)
 
-diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
-index d63d1e4..24ca174 100644
---- a/testcases/kernel/syscalls/mremap/mremap01.c
-+++ b/testcases/kernel/syscalls/mremap/mremap01.c
+Index: git/testcases/kernel/syscalls/mremap/mremap01.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap01.c
++++ git/testcases/kernel/syscalls/mremap/mremap01.c
 @@ -76,10 +76,12 @@
   */
  #include <unistd.h>
@@ -35,11 +35,11 @@
 +#undef _GNU_SOURCE
  
  #include "test.h"
- 
-diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
-index 5a51b9a..a530a6b 100644
---- a/testcases/kernel/syscalls/mremap/mremap02.c
-+++ b/testcases/kernel/syscalls/mremap/mremap02.c
+ #include "safe_macros.h"
+Index: git/testcases/kernel/syscalls/mremap/mremap02.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap02.c
++++ git/testcases/kernel/syscalls/mremap/mremap02.c
 @@ -75,9 +75,11 @@
  #include <errno.h>
  #include <unistd.h>
@@ -52,10 +52,10 @@
  
  #include "test.h"
  
-diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
-index 12e3829..9b39f8b 100644
---- a/testcases/kernel/syscalls/mremap/mremap03.c
-+++ b/testcases/kernel/syscalls/mremap/mremap03.c
+Index: git/testcases/kernel/syscalls/mremap/mremap03.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap03.c
++++ git/testcases/kernel/syscalls/mremap/mremap03.c
 @@ -76,9 +76,11 @@
  #include <errno.h>
  #include <unistd.h>
@@ -68,6 +68,3 @@
  
  #include "test.h"
  
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
deleted file mode 100644
index afcba63..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 9d14edfc12eefac900dd54729a88b3ccf91c1c43 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:18:15 +0000
-Subject: [PATCH 25/32] mc_gethost: include sys/types.h
-
-Fix build on musl
-error: unknown type name 'u_char'
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Upstream-Status: Pending
----
- testcases/network/multicast/mc_gethost/mc_gethost.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
-index 5b9a790..c799e2a 100644
---- a/testcases/network/multicast/mc_gethost/mc_gethost.c
-+++ b/testcases/network/multicast/mc_gethost/mc_gethost.c
-@@ -6,6 +6,7 @@
- 
- #include <sys/param.h>
- #include <sys/socket.h>
-+#include <sys/types.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <arpa/nameser.h>
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
deleted file mode 100644
index adf6f27..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 1471012164ba8f26046d4b1ce5531a0d92805ef5 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Wed, 8 Feb 2017 16:21:16 +0800
-Subject: [PATCH 4/5] sysconf01: Use _SC_2_C_VERSION conditionally
-
-_SC_2_C_VERSION is not available on musl
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
-
-Upstream-Status: Pending
----
- testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
-index 583deef..de93695 100644
---- a/testcases/kernel/syscalls/sysconf/sysconf01.c
-+++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
-@@ -103,7 +103,9 @@ int main(void)
- 	test_sysconf(_SC_2_C_BIND);
- 	test_sysconf(_SC_2_C_DEV);
- #ifdef _SC_2_C_VERSION
-+#ifdef __GLIBC__
- 	test_sysconf(_SC_2_C_VERSION);
-+#endif
- #else
- 	tst_resm(TCONF, "_SC_2_C_VERSION not defined");
- #endif
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
deleted file mode 100644
index efa6d06..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 00ba7cdd0608b1507027428f9f87b1cb9747372b Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Thu, 9 Feb 2017 15:54:53 +0800
-Subject: [PATCH] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
-
-e.g. musl does not implement the _NP mutex types
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
-
-Upstream-Status: Pending
----
- lib/tst_res.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/tst_res.c b/lib/tst_res.c
-index 61daaeb..435224f 100644
---- a/lib/tst_res.c
-+++ b/lib/tst_res.c
-@@ -79,7 +79,11 @@ int TEST_ERRNO;
- 	assert(strlen(buf) > 0);		\
- } while (0)
- 
-+#ifdef __GLIBC__
- static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-+#else
-+static pthread_mutex_t tmutex = {  PTHREAD_MUTEX_RECURSIVE };
-+#endif
- 
- static void check_env(void);
- static void tst_condense(int tnum, int ttype, const char *tmesg);
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
deleted file mode 100644
index 868e1cf..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 5e3dea669e5b0b769f322d54a3bb9f320b5327da Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 22 Mar 2016 15:47:14 +0000
-Subject: [PATCH 26/26] shmat1: Cover GNU specific code under __USE_GNU
-
-on x86, we use uc_mcontext element from sigcontext
-which is marked gnu-specific in glibc, this patch
-adds this condition around the code
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- testcases/kernel/mem/mtest06/shmat1.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c
-index 0d6d7a4..bee69f6 100644
---- a/testcases/kernel/mem/mtest06/shmat1.c
-+++ b/testcases/kernel/mem/mtest06/shmat1.c
-@@ -111,7 +111,7 @@ int done_shmat = 0;		/* disallow read and writes before shmat      */
- static void sig_handler(int signal,	/* signal number, set to handle SIGALRM       */
- 			int code, struct ucontext *ut)
- {				/* contains pointer to sigcontext structure   */
--#ifdef __i386__
-+#if defined(__i386__) && defined(__USE_GNU)
- 	unsigned long except;	/* exception type.                            */
- 	int ret = 0;		/* exit code from signal handler.             */
- 	struct sigcontext *scp =	/* pointer to sigcontext structure            */
-@@ -122,7 +122,7 @@ static void sig_handler(int signal,	/* signal number, set to handle SIGALRM
- 		fprintf(stdout, "Test ended, success\n");
- 		exit(0);
- 	}
--#ifdef __i386__
-+#if defined(__i386__) && defined(__USE_GNU)
- 	else {
- 		except = scp->trapno;
- 		fprintf(stderr, "signal caught - [%d] ", signal);
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
deleted file mode 100644
index c8738ae..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From a9d5595d2fa2ab252f1cabf63f4b65c3efbafeb9 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Thu, 10 Aug 2017 15:27:03 +0800
-Subject: [PATCH] ltp: fix PAGE_SIZE redefinition and O_CREAT undeclear when
- build with musl
-
-error 1:
-
-|stack_clash.c:50:22: error: expected identifier or '(' before numeric constant
-| static unsigned long PAGE_SIZE;
-
-This is because the musl libc already contain PAGE_SIZE definition in limits.c,
-we can check it here:
-
-    https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n43
-
-error 2:
-
-|ck01.c:157:22: error: 'O_CREAT' undeclared (first use in this function); did you mean 'S_IREAD'?
-|   fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0644);
-|                       ^~~~~~~
-|                       S_IREAD
-
-This is because the musl libc put those in fcntl.h, so we should include that
-file.
-
-Upstream-Status: Submitted [ https://github.com/linux-test-project/ltp/pull/194 ]
-
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
----
- testcases/cve/stack_clash.c               | 12 ++++++------
- testcases/kernel/syscalls/flock/flock01.c |  1 +
- testcases/kernel/syscalls/flock/flock02.c |  1 +
- 3 files changed, 8 insertions(+), 6 deletions(-)
-
-diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c
-index 2ef1a82..7c45991 100644
---- a/testcases/cve/stack_clash.c
-+++ b/testcases/cve/stack_clash.c
-@@ -47,7 +47,7 @@
- #include "tst_test.h"
- #include "tst_safe_stdio.h"
- 
--static unsigned long PAGE_SIZE;
-+static unsigned long PAGE_SIZE_tst;
- static unsigned long PAGE_MASK;
- static unsigned long GAP_PAGES = 256;
- static unsigned long THRESHOLD;
-@@ -66,7 +66,7 @@ void exhaust_stack_into_sigsegv(void)
- 	exhaust_stack_into_sigsegv();
- }
- 
--#define MAPPED_LEN PAGE_SIZE
-+#define MAPPED_LEN PAGE_SIZE_tst
- static unsigned long mapped_addr;
- 
- void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED)
-@@ -150,7 +150,7 @@ void do_child(void)
- 	stack_t signal_stack;
- 	struct sigaction segv_sig = {.sa_sigaction = segv_handler, .sa_flags = SA_ONSTACK|SA_SIGINFO};
- 	void *map;
--	unsigned long gap = GAP_PAGES * PAGE_SIZE;
-+	unsigned long gap = GAP_PAGES * PAGE_SIZE_tst;
- 	struct rlimit rlimit;
- 
- 	rlimit.rlim_cur = rlimit.rlim_max = RLIM_INFINITY;
-@@ -200,8 +200,8 @@ void setup(void)
- {
- 	char buf[4096], *p;
- 
--	PAGE_SIZE = sysconf(_SC_PAGESIZE);
--	PAGE_MASK = ~(PAGE_SIZE - 1);
-+	PAGE_SIZE_tst = sysconf(_SC_PAGESIZE);
-+	PAGE_MASK = ~(PAGE_SIZE_tst - 1);
- 
- 	buf[4095] = '\0';
- 	SAFE_FILE_SCANF("/proc/cmdline", "%4095[^\n]", buf);
-@@ -214,7 +214,7 @@ void setup(void)
- 		tst_res(TINFO, "stack_guard_gap = %ld", GAP_PAGES);
- 	}
- 
--	THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE;
-+	THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE_tst;
- 
- 	{
- 		volatile int *a = alloca(128);
-diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c
-index 3e17be4..06d89e3 100644
---- a/testcases/kernel/syscalls/flock/flock01.c
-+++ b/testcases/kernel/syscalls/flock/flock01.c
-@@ -69,6 +69,7 @@
- #include <stdio.h>
- #include <sys/wait.h>
- #include <sys/file.h>
-+#include <fcntl.h>
- #include "test.h"
- 
- void setup(void);
-diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c
-index 414df68..9ddf729 100644
---- a/testcases/kernel/syscalls/flock/flock02.c
-+++ b/testcases/kernel/syscalls/flock/flock02.c
-@@ -75,6 +75,7 @@
- #include <sys/types.h>
- #include <sys/file.h>
- #include <sys/wait.h>
-+#include <fcntl.h>
- #include <errno.h>
- #include <stdio.h>
- #include "test.h"
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch
deleted file mode 100644
index f7c0a4b..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 2f6ab8f694b26b7f2566624f6d1f23788d6ab8a0 Mon Sep 17 00:00:00 2001
-From: Jan Stancek <jstancek@redhat.com>
-Date: Mon, 11 Sep 2017 12:57:58 +0200
-Subject: [PATCH] commands/gdb01: replace stdin with /dev/null
-
-If this testcase runs as background process, gdb can receive
-SIGTTOU and then testcase gets stuck.
-
-Signed-off-by: Jan Stancek <jstancek@redhat.com>
-
-Upstream-Status: Backport
-[https://github.com/linux-test-project/ltp/commit/2f6ab8f694b26b7f2566624f6d1f23788d6ab8a0]
-
-Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
----
- testcases/commands/gdb/gdb01.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/commands/gdb/gdb01.sh b/testcases/commands/gdb/gdb01.sh
-index 07ae36f..e3a5b51 100755
---- a/testcases/commands/gdb/gdb01.sh
-+++ b/testcases/commands/gdb/gdb01.sh
-@@ -29,7 +29,7 @@ TST_NEEDS_CMDS="gdb /bin/cat"
- 
- simple_test()
- {
--	gdb /bin/cat -ex "run /etc/passwd" -ex quit
-+	gdb /bin/cat -ex "run /etc/passwd" -ex quit < /dev/null
- 	RC=$?
- 	if [ $RC -eq 0 ] ; then
- 		tst_res TPASS "gdb attached to process and completed run"
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch
new file mode 100644
index 0000000..e7c927e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch
@@ -0,0 +1,252 @@
+From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001
+From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+Date: Wed, 13 Sep 2017 15:48:42 +0800
+Subject: [PATCH] commands/ar01: Fix for test in deterministic mode
+
+If binutils was configured with --enable-deterministic-archives,
+ar will run in deterministic mode by default, and use zero for
+timestamps and uids/gids, which makes the test case abnormal.
+
+Fix this by add the "U" modifier when deterministic mode is default.
+
+Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+Signed-off-by: Fei Jie <feij.fnst@cn.fujitsu.com>
+
+Upstream-Status: Backport
+[http://lists.linux.it/pipermail/ltp/2017-September/005668.html]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++--------------------
+ 1 file changed, 52 insertions(+), 40 deletions(-)
+
+diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01
+index ddab2e0..d688f76 100644
+--- a/testcases/commands/ar/ar01
++++ b/testcases/commands/ar/ar01
+@@ -23,14 +23,26 @@
+ # This is a basic ar command test.
+ #
+ TST_CNT=17
++TST_SETUP=setup
+ TST_TESTFUNC=test
+ TST_NEEDS_TMPDIR=1
+ . tst_test.sh
+ 
++setup()
++{
++	ar --help | grep "use zero for timestamps and uids/gids (default)" \
++		>/dev/null
++	if [ $? -eq 0 ]; then
++		MOD="U"
++	else
++		MOD=""
++	fi
++}
++
+ test1()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+-	ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++	ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -47,9 +59,9 @@ test1()
+ 
+ test2()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-		         $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
+-	ROD ar -ma file1.in lib.a file4.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
++	ROD ar -ma"$MOD" file1.in lib.a file4.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -66,8 +78,8 @@ test2()
+ 
+ test3()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+-	ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++	ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -84,9 +96,9 @@ test3()
+ 
+ test4()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+-	                 $TST_DATAROOT/file2.in
+-	ROD ar -mb file3.in lib.a file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++			       $TST_DATAROOT/file2.in
++	ROD ar -mb"$MOD" file3.in lib.a file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -103,7 +115,7 @@ test4()
+ 
+ test5()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
+ 
+ 	if [ -s ar.out ]; then
+ 		tst_res TFAIL "ar produced output unexpectedly (-c)"
+@@ -117,7 +129,7 @@ test5()
+ 
+ test6()
+ {
+-	ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out
++	ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
+ 
+ 	if [ -s ar.out ]; then
+ 		tst_res TFAIL "ar produced output unexpectedly (-qc)"
+@@ -131,9 +143,9 @@ test6()
+ 
+ test7()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-	                 $TST_DATAROOT/file3.in
+-	ROD ar -d lib.a file1.in file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in
++	ROD ar -d"$MOD" lib.a file1.in file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file3.in\n" > ar.exp
+@@ -150,9 +162,9 @@ test7()
+ 
+ test8()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-	                 $TST_DATAROOT/file3.in
+-	ROD ar -d lib.a
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in
++	ROD ar -d"$MOD" lib.a
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -169,8 +181,8 @@ test8()
+ 
+ test9()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+-	ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++	ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -187,9 +199,9 @@ test9()
+ 
+ test10()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+-	                 $TST_DATAROOT/file2.in
+-	ROD ar -mi file3.in lib.a file2.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++			       $TST_DATAROOT/file2.in
++	ROD ar -mi"$MOD" file3.in lib.a file2.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -206,9 +218,9 @@ test10()
+ 
+ test11()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+-	                 $TST_DATAROOT/file2.in
+-	ROD ar -m lib.a file3.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++			       $TST_DATAROOT/file2.in
++	ROD ar -m"$MOD" lib.a file3.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -225,9 +237,9 @@ test11()
+ 
+ test12()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-	                 $TST_DATAROOT/file3.in
+-	ROD ar -p lib.a \> ar.out
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in
++	ROD ar -p"$MOD" lib.a \> ar.out
+ 
+ 	printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp
+ 
+@@ -244,9 +256,9 @@ test12()
+ test13()
+ {
+ 
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-	                 $TST_DATAROOT/file3.in
+-	ROD ar -q lib.a $TST_DATAROOT/file4.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in
++	ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in
+ 	ROD ar -t lib.a \> ar.out
+ 
+ 	printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp
+@@ -264,14 +276,14 @@ test13()
+ test14()
+ {
+ 	ROD touch file0.in
+-	ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in
++	ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
+ 
+ 	file0_mtime1=$(ar -tv lib.a | grep file0.in)
+ 	file1_mtime1=$(ar -tv lib.a | grep file1.in)
+ 
+ 	touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in
+ 
+-	ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in
++	ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
+ 
+ 	file0_mtime2=$(ar -tv lib.a | grep file0.in)
+ 	file1_mtime2=$(ar -tv lib.a | grep file1.in)
+@@ -293,7 +305,7 @@ test14()
+ 
+ test15()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in
+ 	ROD ar -tv lib.a \> ar.out
+ 
+ 	if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then
+@@ -308,9 +320,9 @@ test15()
+ 
+ test16()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+-	                 $TST_DATAROOT/file3.in
+-	ROD ar -xv lib.a \> ar.out
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++			       $TST_DATAROOT/file3.in
++	ROD ar -xv"$MOD" lib.a \> ar.out
+ 
+ 	printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp
+ 
+@@ -332,8 +344,8 @@ test16()
+ 
+ test17()
+ {
+-	ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
+-	ROD ar -xv lib.a file2.in \> ar.out
++	ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
++	ROD ar -xv"$MOD" lib.a file2.in \> ar.out
+ 
+ 	printf "x - file2.in\n" > ar.exp
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
new file mode 100644
index 0000000..5096a85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
@@ -0,0 +1,40 @@
+From 67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d Mon Sep 17 00:00:00 2001
+From: Li Wang <liwang@redhat.com>
+Date: Tue, 23 Jan 2018 17:46:35 +0800
+Subject: [PATCH] safe_macros: make is_fuse() return zero if fs_type is NULL
+
+This commmit 28507e514c(safe_mount: Do not try mount() syscall for FUSE fs)
+involves FUSE fs check in safe_mount(), but we'd better guarantee the "fs_type"
+is legal to check in is_fuse() function otherwise system will kill the program.
+
+  cmdline="fanotify06"
+  contacts=""
+  analysis=exit
+  <<<test_output>>>
+  tst_test.c:980: INFO: Timeout per run is 0h 10m 00s
+  tst_test.c:1025: BROK: Test killed by SIGSEGV!
+
+Signed-off-by: Li Wang <liwang@redhat.com>
+Acked-by: Jan Stancek <jstancek@redhat.com>
+Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d]
+---
+ lib/safe_macros.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/safe_macros.c b/lib/safe_macros.c
+index c48e436dc..abdeca013 100644
+--- a/lib/safe_macros.c
++++ b/lib/safe_macros.c
+@@ -708,6 +708,9 @@ static int is_fuse(const char *fs_type)
+ {
+ 	unsigned int i;
+ 
++	if (!fs_type)
++		return 0;
++
+ 	for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) {
+ 		if (!strcmp(fuse_fs_types[i], fs_type))
+ 			return 1;
+-- 
+2.11.0
+