Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
index 305be52..bf3f98f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -1,21 +1,20 @@
-From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001
+From 4dab9bed1033f797ef9b482c77342fe3fe26d0be Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 6 Oct 2015 23:51:34 +0000
 Subject: [PATCH] Fix build with musl
 
-Upstream-Status: Pending
+Upstream-Status: Backport
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
 ---
- mkfs.jffs2.c  | 44 ++++++++++++++++++++++++++++++++++++++++++--
- recv_image.c  |  1 -
- serve_image.c |  1 -
- 3 files changed, 42 insertions(+), 4 deletions(-)
+ jffsX-utils/mkfs.jffs2.c | 1 +
+ 1 file changed, 1 insertion(+)
 
-diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
-index f09c0b2..ed2dc43 100644
---- a/mkfs.jffs2.c
-+++ b/mkfs.jffs2.c
+diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
+index 5446a16..ca5e0d5 100644
+--- a/jffsX-utils/mkfs.jffs2.c
++++ b/jffsX-utils/mkfs.jffs2.c
 @@ -72,6 +72,7 @@
  #include <byteswap.h>
  #include <crc32.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
index 7d783e7..853de6a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -1,11 +1,48 @@
-Replace rpmatch() usage with checking first character of line
+From 82839c3c0371ca2a1643a99d7d01f5bc1c850b28 Mon Sep 17 00:00:00 2001
+From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Date: Thu, 2 Mar 2017 11:40:36 +0100
+Subject: [PATCH] Replace rpmatch() usage with checking first character of line
 
-Upstream-Status: Pending
+This is based on the patch from Khem Raj used by openembedded. In
+addition to the original patch, this also removes the fallback
+implementation that was provided for C libraries that don't implement
+rpmatch.
+
+Upstream-Status: Backport
+
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ include/common.h | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
 
+diff --git a/include/common.h b/include/common.h
+index d0c706d..d609257 100644
 --- a/include/common.h
 +++ b/include/common.h
-@@ -122,10 +122,12 @@
+@@ -129,21 +129,6 @@ extern "C" {
+ 	fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
+ } while(0)
+ 
+-/* uClibc versions before 0.9.34 and musl don't have rpmatch() */
+-#if defined(__UCLIBC__) && \
+-		(__UCLIBC_MAJOR__ == 0 && \
+-		(__UCLIBC_MINOR__ < 9 || \
+-		(__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))) || \
+-	!defined(__GLIBC__)
+-#undef rpmatch
+-#define rpmatch __rpmatch
+-static inline int __rpmatch(const char *resp)
+-{
+-    return (resp[0] == 'y' || resp[0] == 'Y') ? 1 :
+-	(resp[0] == 'n' || resp[0] == 'N') ? 0 : -1;
+-}
+-#endif
+-
+ /**
+  * prompt the user for confirmation
+  */
+@@ -164,10 +149,12 @@ static inline bool prompt(const char *msg, bool def)
  		}
  
  		if (strcmp("\n", line) != 0) {
@@ -22,3 +59,5 @@
  				puts("unknown response; please try again");
  				continue;
  			}
+-- 
+2.6.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
index 57d6a30..0e3776a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -1,7 +1,7 @@
 Upstream-Status: Pending
 
 --- /tmp/mkfs.jffs2.c	2009-01-11 15:28:41.000000000 +0100
-+++ git/mkfs.jffs2.c	2009-01-11 15:59:29.000000000 +0100
++++ git/jffsX-utils/mkfs.jffs2.c	2009-01-11 15:59:29.000000000 +0100
 @@ -100,6 +100,11 @@
  	struct rb_node hardlink_rb;
  };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
index 05f1629..6fc594f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -1,16 +1,25 @@
-Upstream-Status: Pending
+From 7d026a85946a08b8167dcd792ea6660bf6a49e08 Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Date: Thu, 2 Mar 2017 10:43:56 +0100
+Subject: [PATCH] Fix alignment trap triggered by NEON instructions
 
 NEON instruction VLD1.64 was used to copy 64 bits data after type
 casting, and they will trigger alignment trap.
 This patch uses memcpy to avoid alignment problem.
 
-Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Upstream-Status: Backport
 
-diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
-index d3a02d4..e7e9218 100644
---- a/mkfs.ubifs/key.h
-+++ b/mkfs.ubifs/key.h
-@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ ubifs-utils/mkfs.ubifs/key.h | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
+index 39379fd..118858b 100644
+--- a/ubifs-utils/mkfs.ubifs/key.h
++++ b/ubifs-utils/mkfs.ubifs/key.h
+@@ -159,10 +159,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
   */
  static inline void key_write(const union ubifs_key *from, void *to)
  {
@@ -26,7 +35,7 @@
  	memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
  }
  
-@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
+@@ -174,10 +176,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
   */
  static inline void key_write_idx(const union ubifs_key *from, void *to)
  {
@@ -42,3 +51,5 @@
  }
  
  /**
+-- 
+2.6.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
index 7207cfc..0f42e73 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -49,8 +49,8 @@
 
 diff --git a/flash_erase.c b/flash_erase.c
 index 933373a..4b9d84b 100644
---- a/flash_erase.c
-+++ b/flash_erase.c
+--- a/misc-utils/flash_erase.c
++++ b/misc-utils/flash_erase.c
 @@ -99,6 +99,7 @@ int main(int argc, char *argv[])
  	bool isNAND;
  	int error = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 8a3afaf..4fbc54f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -5,26 +5,27 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
 
+inherit autotools pkgconfig
+
 DEPENDS = "zlib lzo e2fsprogs util-linux"
 
-PV = "1.5.2"
+PV = "2.0.0"
 
-SRCREV = "aea36417067dade75192bafa03af70b6eb2677b1"
+SRCREV = "1bfee8660131fca7a18f68e9548a18ca6b3378a0"
 SRC_URI = "git://git.infradead.org/mtd-utils.git \
            file://add-exclusion-to-mkfs-jffs2-git-2.patch \
            file://fix-armv7-neon-alignment.patch \
            file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
            file://0001-Fix-build-with-musl.patch \
+           file://010-fix-rpmatch.patch \
 "
 
-SRC_URI_append_libc-musl = " file://010-fix-rpmatch.patch "
-
 S = "${WORKDIR}/git/"
 
 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
 # regardless whether acl is enabled or disabled in the distro should be okay.
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
 PACKAGECONFIG[xattr] = ",,acl,"
 
 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"