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/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
index 3ef1792..c8c54a4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
@@ -7,7 +7,7 @@
 SRC_URI[md5sum] = "5928822d855c5cf7ac29655e3e0b8c23"
 SRC_URI[sha256sum] = "0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032"
 
-PNBLACKLIST[apcupsd] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[apcupsd] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit autotools
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch
new file mode 100644
index 0000000..3708f60
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch
@@ -0,0 +1,97 @@
+From 7b651793269b6b86f12c43c30b751b86def27222 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 17:56:40 -0700
+Subject: [PATCH] include missing header files
+
+fixes build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ deviate.c     | 1 +
+ procdbase.c   | 2 +-
+ showgeneric.c | 2 +-
+ showlinux.c   | 2 +-
+ showprocs.c   | 2 +-
+ showsys.c     | 2 +-
+ 6 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/deviate.c b/deviate.c
+index 7cf1b49..8e615af 100644
+--- a/deviate.c
++++ b/deviate.c
+@@ -178,6 +178,7 @@ static const char rcsid[] = "$Id: deviate.c,v 1.45 2010/10/23 14:02:03 gerlof Ex
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <limits.h>
+ #include <memory.h>
+diff --git a/procdbase.c b/procdbase.c
+index 9cab347..0487d26 100644
+--- a/procdbase.c
++++ b/procdbase.c
+@@ -67,7 +67,7 @@ static const char rcsid[] = "$Id: procdbase.c,v 1.8 2010/04/23 12:19:35 gerlof E
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <string.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ 
+ #include "atop.h"
+ #include "photoproc.h"
+diff --git a/showgeneric.c b/showgeneric.c
+index 775afa8..3d5be0e 100644
+--- a/showgeneric.c
++++ b/showgeneric.c
+@@ -268,7 +268,7 @@ static const char rcsid[] = "$Id: showgeneric.c,v 1.71 2010/10/25 19:08:32 gerlo
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <string.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showlinux.c b/showlinux.c
+index 6e60754..aba2ee6 100644
+--- a/showlinux.c
++++ b/showlinux.c
+@@ -274,7 +274,7 @@ static const char rcsid[] = "$Id: showlinux.c,v 1.70 2010/10/23 14:04:12 gerlof
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showprocs.c b/showprocs.c
+index 5194524..f0169ad 100644
+--- a/showprocs.c
++++ b/showprocs.c
+@@ -94,7 +94,7 @@ static const char rcsid[] = "$Id: showprocs.c,v 1.15 2011/09/05 11:44:16 gerlof
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showsys.c b/showsys.c
+index 26331be..5a05fe5 100644
+--- a/showsys.c
++++ b/showsys.c
+@@ -80,7 +80,7 @@ static const char rcsid[] = "XXXXXX";
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
index 21311e3..1ab9e7c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
@@ -15,11 +15,12 @@
 
 DEPENDS = "ncurses zlib"
 
-ATOP_VER = "${@'-'.join(d.getVar('PV', True).rsplit('.', 1))}"
+ATOP_VER = "${@'-'.join(d.getVar('PV').rsplit('.', 1))}"
 
 SRC_URI = " \
     http://www.atoptool.nl/download/${BPN}-${ATOP_VER}.tar.gz \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://volatiles.atop.conf', 'file://volatiles.99_atop', d)} \
+    file://0001-include-missing-header-files.patch \
     file://remove-bashisms.patch \
     file://fix-permissions.patch \
     file://sysvinit-implement-status.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch
new file mode 100644
index 0000000..01235d8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch
@@ -0,0 +1,37 @@
+From 518bb8ccfb3f3fc143fbd571782f3e40573d01b5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 09:15:04 -0700
+Subject: [PATCH] avro-c: Fix build with clang compiler
+
+Clang advertizes itself to be compatible with gcc 4.2.1
+while that was true several years ago, it now supports
+a lot more newer features, the test to just check gcc
+version should be supplanted with clang check as well
+so atomic support in clang can be asserted as well
+
+Fixes
+
+lang/c/src/avro/refcount.h:301:2: error: "No atomic implementation!"
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lang/c/src/avro/refcount.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lang/c/src/avro/refcount.h b/lang/c/src/avro/refcount.h
+index 69afa4fc..d76ba057 100644
+--- a/lang/c/src/avro/refcount.h
++++ b/lang/c/src/avro/refcount.h
+@@ -118,7 +118,8 @@ avro_refcount_dec(volatile int *refcount)
+  * GCC intrinsics
+  */
+ 
+-#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500
++#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500 \
++|| defined(__clang__)
+ 
+ static inline void
+ avro_refcount_set(volatile int *refcount, int value)
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb
new file mode 100644
index 0000000..276fe2b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Apache Avro data serialization system."
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=73bdf70f268f0b3b9c5a83dd7a6f3324"
+
+DEPENDS = "jansson zlib xz"
+PV .= "+git${SRCPV}"
+
+SRCREV = "4b3677c32b879e0e7f717eb95f9135ac654da760"
+SRC_URI = "git://github.com/apache/avro \
+           file://0001-avro-c-Fix-build-with-clang-compiler.patch;patchdir=../../ \
+"
+
+S = "${WORKDIR}/git/lang/c"
+
+LDFLAGS_append_libc-uclibc = " -lm"
+
+inherit cmake
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
index 0ad10a4..da1a2a3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
@@ -15,8 +15,10 @@
 SRC_URI[md5sum] = "02baa941091c5d198cd1623b3ad36e68"
 SRC_URI[sha256sum] = "cfb9ab52cdccd926f1822a457264d0014c7eb9f4600a72626063dd073b26256f"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--enable-x11, --disable-x11, libxi xext virtual/xserver"
 
 PACKAGE_BEFORE_PN += "${PN}-test"
 FILES_${PN}-test = "${bindir}/frame-test*"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch
new file mode 100644
index 0000000..3b3acab
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch
@@ -0,0 +1,43 @@
+From 1e48821ba109b00e9c2931f12aa206c4ef54fd71 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 12:34:55 -0700
+Subject: [PATCH] libgeis: Compare the first character of string to null
+
+gcc7 wants to be specific when it comes to comparing characters
+and strings
+
+fixes
+
+| ../../../../../../../workspace/sources/geis/libgeis/geis_v1.c: In function '_v1_subscribe_device':
+| ../../../../../../../workspace/sources/geis/libgeis/geis_v1.c:613:20: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgeis/geis_v1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgeis/geis_v1.c b/libgeis/geis_v1.c
+index 67045ee..07c0851 100644
+--- a/libgeis/geis_v1.c
++++ b/libgeis/geis_v1.c
+@@ -610,7 +610,7 @@ _v1_subscribe_device(GeisInstance instance,
+                      const char **gesture_list)
+ {
+   GeisStatus result = GEIS_UNKNOWN_ERROR;
+-  if (gesture_list == GEIS_ALL_GESTURES)
++  if (gesture_list[0][0] == GEIS_ALL_GESTURES)
+   {
+     geis_debug("subscribing device %d for all gestures", device_id);
+   }
+@@ -757,7 +757,7 @@ geis_unsubscribe(GeisInstance     instance,
+                  GeisGestureType *gesture_list)
+ {
+   GeisStatus status = GEIS_STATUS_NOT_SUPPORTED;
+-  if (gesture_list == GEIS_ALL_GESTURES)
++  if (gesture_list[0] == GEIS_ALL_GESTURES)
+   {
+     status = geis_subscription_deactivate(instance->subscription);
+   }
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
index 281dc3d..976aafb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
@@ -19,9 +19,10 @@
 
 DEPENDS += "grail dbus-glib python3 virtual/libx11 libxext libxi libxcb dbus frame"
 
-SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.xz\
+SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.xz \
            file://fix-indentation-for-gcc6.patch \
-"
+           file://0001-libgeis-Compare-the-first-character-of-string-to-nul.patch \
+           "
 SRC_URI[md5sum] = "2ff9d76a3ea5794516bb02c9d1924faf"
 SRC_URI[sha256sum] = "8a60f5683852094038904e690d23cc5a90a980fc52da67f0f28890baa25c70eb"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
index 3026744..22fd0f4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
@@ -11,13 +11,14 @@
 inherit autotools pkgconfig
 
 DEPENDS = "frame"
-
+CXXFLAGS_append_toolchain-clang = " -Wno-pessimizing-move"
 SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.bz2"
 SRC_URI[md5sum] = "0df1b3ec6167920f310e2effe6e2ad44"
 SRC_URI[sha256sum] = "5eed1f650f042481daa3a2de5e7d43261fe343b2a1b1e240f3b7fc26572c9df3"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x11, --without-x11, libxi"
 
 PACKAGE_BEFORE_PN += "${PN}-test"
 FILES_${PN}-test = "${bindir}/grail-test*"
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
index 187a57e..61c08ee 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
@@ -24,6 +24,7 @@
 # trying to look inside the stdio headers.
 CKERMIT_ADDITIONAL = ""
 CKERMIT_ADDITIONAL_libc-uclibc = "-DNOARROWKEYS"
+CKERMIT_ADDITIONAL_libc-musl = "-DNOARROWKEYS"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb
similarity index 81%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb
index d160a09..c13b764 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb
@@ -9,11 +9,11 @@
 LICENSE = "GPL-2.0-with-OpenSSL-exception"
 LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
 
-DEPENDS = "util-linux lvm2 popt libgcrypt"
+DEPENDS = "util-linux libdevmapper popt libgcrypt"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v1.7/${BP}.tar.xz"
-SRC_URI[md5sum] = "a11a140cea496961222170944db01fc1"
-SRC_URI[sha256sum] = "dbb35dbf5f0c1749168c86c913fe98e872247bfc8425314b494c2423e7e43342"
+SRC_URI[md5sum] = "058ed35c5b776032c2a036838f9e22a7"
+SRC_URI[sha256sum] = "7ccf893ef79a38fb92d61f03c17b964982119f5319cdaa85a1335b8558cca016"
 
 inherit autotools gettext pkgconfig
 
@@ -28,6 +28,9 @@
                      kernel-module-md5 \
                      kernel-module-cbc \
                      kernel-module-sha256-generic \
+                     kernel-module-xts \
 "
 
 EXTRA_OECONF = "--enable-static"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch
deleted file mode 100644
index c0d552d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-digitemp: allow override of CC and CFLAGS vars
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-
---- a/Makefile	2008-08-28 21:37:00.000000000 +0000
-+++ b/Makefile	2011-11-24 22:22:39.882511272 +0000
-@@ -11,8 +11,9 @@
- 
- VERSION = 3.6.0
- 
--CC	= gcc
--CFLAGS	= -I./src -I./userial -O2 -Wall # -g
-+CC	?= gcc
-+CFLAGS	?=  -O2 -Wall # -g
-+CFLAGS += -I./src -I./userial
- 
- OBJS		=	src/digitemp.o src/device_name.o src/ds2438.o
- HDRS		= 	src/digitemp.h src/device_name.h
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb
deleted file mode 100644
index 2582820..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "read temperature sensors in a 1-Wire net"
-SECTION = "util"
-DEPENDS = "libusb1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
-
-PR = "r2"
-
-SRC_URI = "http://www.digitemp.com/software/linux/digitemp-${PV}.tar.gz \
-           file://makefile-fix.patch"
-SRC_URI[md5sum] = "9be2e48db37920f21925ae6e88f83b84"
-SRC_URI[sha256sum] = "14cfc584cd3714fe8c9a2cdc8388be49e08b5e395d95e6bcd11d4410e2505ca2"
-
-EXTRA_OEMAKE = "ds9097 ds9097u \
-                SYSTYPE='Linux' \
-"
-# Fix GNU_HASH QA errors
-TARGET_CC_ARCH += "${CFLAGS} ${LDFLAGS}"
-
-do_configure() {
-    rm -f digitemp_*
-}
-
-do_install() {
-    install -d ${D}${sbindir}
-    install digitemp_* ${D}${sbindir}
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb
new file mode 100644
index 0000000..460aa14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "read temperature sensors in a 1-Wire net"
+SECTION = "util"
+DEPENDS = "libusb1"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
+
+PV = "3.7.1+git${SRCPV}"
+
+SRC_URI = "git://github.com/bcl/digitemp"
+
+SRCREV = "389f67655efa1674f595106c3a47b5ad082609a7"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "ds9097 ds9097u \
+                SYSTYPE='Linux' \
+"
+do_configure() {
+    rm -f digitemp_*
+}
+
+do_install() {
+    install -d ${D}${sbindir}
+    install -m 0755 digitemp_* ${D}${sbindir}
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
index 1673b91..18af738 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
@@ -7,7 +7,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS += "asciidoc-native"
+DEPENDS += "asciidoc-native xmlto-native"
 
 SRC_URI = "git://github.com/dagwieers/dstat.git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
index 0440f0c..49a3d74 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
@@ -33,3 +33,5 @@
 ALTERNATIVE_PRIORITY[volname] = "100"
 ALTERNATIVE_PRIORITY[eject] = "100"
 
+ALTERNATIVE_${PN}-doc = "eject.1"
+ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
index 012895e..5b905f9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
@@ -18,7 +18,7 @@
 
 EXTRA_OECONF =  "--without-sound --with-crt-dir=${STAGING_LIBDIR} "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x-toolkit=gtk,--without-x --without-dbus,${X11DEPENDS}"
 
 
@@ -86,7 +86,7 @@
     ${STAGING_DIR_TARGET}/${base_libdir}/libgcc_s.so.* \
     ${STAGING_DIR_TARGET}/${base_libdir}/libpthread* $treedir/${base_libdir}/
 
-    if [ ! -z "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'x11', '', d)}" ] ; then
+    if [ ! -z "${@bb.utils.filter('PACKAGECONFIG', 'x11', d)}" ]; then
         echo "X11 build enabled"
         # copy only as much stuff as we need
         # before: 5.5G   ../../qemu-treedir/
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
index a324828..3388ff0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
@@ -2,7 +2,7 @@
 
 PR = "r4"
 
-PNBLACKLIST[emacs] ?= "qemu: uncaught target signal 11 (Segmentation fault) - core dumped"
+PNBLACKLIST[emacs] ?= "qemu: uncaught target signal 11 (Segmentation fault) - core dumped - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${GNU_MIRROR}/emacs/emacs-${PV}.tar.gz;name=tarball \
            file://use-qemu.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
index 2989850..14ce57a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
@@ -9,7 +9,7 @@
 
 DEPENDS = "libnice glib-2.0 libxml2 zlib dbus gstreamer gst-plugins-base"
 
-inherit autotools
+inherit autotools pkgconfig
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[gupnp] = "--enable-gupnp,--disable-gupnp,gupnp-igd"
@@ -28,3 +28,7 @@
 
 SRC_URI[md5sum] = "e1f540cf3ebab06c3d7db1f46b44ac88"
 SRC_URI[sha256sum] = "3ae59aa61a8071c9fad111e5fd606aabc27961eb4192f8729987a27dae6b3974"
+
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted gstreamer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted libnice - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted gst-plugins-base - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb
similarity index 65%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb
index 3c2a054..48c8221 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb
@@ -2,6 +2,8 @@
 DESCRIPTION = "Libnice is an implementation of the IETF's draft Interactive Connectivity Establishment standard (ICE)."
 HOMEPAGE = "http://nice.freedesktop.org/wiki/"
 SRC_URI = "http://nice.freedesktop.org/releases/libnice-${PV}.tar.gz"
+SRC_URI[md5sum] = "3226faeaf48a9150ada00da2e2865959"
+SRC_URI[sha256sum] = "61112d9f3be933a827c8365f20551563953af6718057928f51f487bfe88419e1"
 
 LICENSE = "LGPLv2.1 & MPLv1.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=9c42325015702feda4f4d2f19a55b767 \
@@ -9,21 +11,17 @@
                     file://COPYING.MPL;md5=3c617710e51cdbe0fc00716f056dfb1a \
 "
 
-PR = "r4"
-
-DEPENDS = "glib-2.0 gstreamer"
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[gupnp] = "--enable-gupnp,--disable-gupnp,gupnp-igd"
 
-inherit autotools pkgconfig gtk-doc
+inherit autotools pkgconfig gtk-doc gobject-introspection
 
-EXTRA_OECONF = "--disable-gtk-doc"
-
-FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la"
-FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"
-FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug"
 
 do_configure_prepend() {
     mkdir ${S}/m4 || true
@@ -36,7 +34,3 @@
                   $i
     done
 }
-
-
-SRC_URI[md5sum] = "e5b9f799a57cb939ea2658ec35253ab9"
-SRC_URI[sha256sum] = "d8dd260c486a470a6052a5323920878a084e44a19df09b15728b85c9e3d6edf0"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
index 3e06a5a..49cc270 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
@@ -18,4 +18,4 @@
 SRC_URI[md5sum] = "9356e5e9dcb3f1481977009720a2ccf8"
 SRC_URI[sha256sum] = "1b4a5b5e48ad5e61a21586b7b59d5c0a88691a981e73e2c6dc5868197461791b"
 
-PNBLACKLIST[benchfft] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them"
+PNBLACKLIST[benchfft] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch
new file mode 100644
index 0000000..6340f42
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch
@@ -0,0 +1,80 @@
+From 97af5a2efbe30726ce4d7c921efed6afc32a314f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Sun, 25 Dec 2016 13:41:19 +0100
+Subject: [PATCH] NEON autodetection segfaults: assume neon present
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If TUNE_FEATURES contain 'neon' we can assume our machine supports it
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ simd-support/neon.c | 46 +---------------------------------------------
+ 1 file changed, 1 insertion(+), 45 deletions(-)
+
+diff --git a/simd-support/neon.c b/simd-support/neon.c
+index 86b2cb6..8d6537e 100644
+--- a/simd-support/neon.c
++++ b/simd-support/neon.c
+@@ -23,54 +23,10 @@
+ 
+ #if HAVE_NEON
+ 
+-/* check for an environment where signals are known to work */
+-#if defined(unix) || defined(linux)
+-  # include <signal.h>
+-  # include <setjmp.h>
+-
+-  static jmp_buf jb;
+-
+-  static void sighandler(int x)
+-  {
+-       UNUSED(x);
+-       longjmp(jb, 1);
+-  }
+-
+-  static int really_have_neon(void)
+-  {
+-       void (*oldsig)(int);
+-       oldsig = signal(SIGILL, sighandler);
+-       if (setjmp(jb)) {
+-	    signal(SIGILL, oldsig);
+-	    return 0;
+-       } else {
+-	    /* paranoia: encode the instruction in binary because the
+-	       assembler may not recognize it without -mfpu=neon */
+-	    /*asm volatile ("vand q0, q0, q0");*/
+-	    asm volatile (".long 0xf2000150");
+-	    signal(SIGILL, oldsig);
+-	    return 1;
+-       }
+-  }
+-
+-  int X(have_simd_neon)(void)
+-  {
+-       static int init = 0, res;
+-
+-       if (!init) {
+-	    res = really_have_neon();
+-	    init = 1;
+-       }
+-       return res;
+-  }
+-
+-
+-#else
+-/* don't know how to autodetect NEON; assume it is present */
++/* autodetect NEON broken; assume it is present */
+   int X(have_simd_neon)(void)
+   {
+        return 1;
+   }
+-#endif
+ 
+ #endif
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb
similarity index 83%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb
index e753743..ed14e16 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb
@@ -3,9 +3,14 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
 
-SRC_URI = "http://www.fftw.org/fftw-${PV}.tar.gz"
-SRC_URI[md5sum] = "2edab8c06b24feeb3b82bbb3ebf3e7b3"
-SRC_URI[sha256sum] = "8f0cde90929bc05587c3368d2f15cd0530a60b8a9912a8e2979a72dbe5af0982"
+SRC_URI = " \
+    http://www.fftw.org/fftw-${PV}-pl1.tar.gz \
+    file://0001-NEON-autodetection-segfaults-assume-neon-present.patch \
+"
+SRC_URI[md5sum] = "682a0e78d6966ca37c7446d4ab4cc2a1"
+SRC_URI[sha256sum] = "1ef4aa8427d9785839bc767f3eb6a84fcb5e9a37c31ed77a04e7e047519a183d"
+
+S = "${WORKDIR}/fftw-${PV}-pl1"
 
 inherit autotools pkgconfig
 
@@ -14,6 +19,8 @@
 
 EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads"
 
+CFLAGS += "-D_GNU_SOURCE"
+
 FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}"
 FFTW_NEON_class-native = ""
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
index 51012e6..0883c1a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
@@ -10,3 +10,12 @@
 
 SRC_URI[md5sum] = "ae0aca1cb7b4801f4372f3a75a9e52b5"
 SRC_URI[sha256sum] = "922225f7001e57a0fbace8833b0a48790a68f6c7b491f2d47c78ad537ab78a8b"
+
+# Looks like caused by flite-1.3-alsa_support-1.2.diff
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/armv5te-oe-linux-gnueabi/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/armv5te-oe-linux-gnueabi/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/core2-64-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/core2-64-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/i586-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/i586-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+PNBLACKLIST[flite-alsa] ?= "OLD: wasn't updated in over 6 years, only navit was RSUGGESTing it and doesn't respect LDFLAGS - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb
new file mode 100644
index 0000000..353987e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb
@@ -0,0 +1,16 @@
+require ${BPN}.inc
+
+DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native"
+
+inherit native
+
+EXTRA_OECMAKE += " \
+    -DOPTION_BUILD_SHARED_LIBS=OFF \
+    -DOPTION_USE_THREADS=OFF \
+    -DOPTION_USE_XDBE=OFF \
+    -DOPTION_USE_XFT=OFF \
+    -DOPTION_BUILD_EXAMPLES=OFF \
+    -DOPTION_USE_XINERAMA=OFF \
+    -DOPTION_USE_XFIXES=OFF \
+    -DOPTION_USE_XCURSOR=OFF \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb
new file mode 100644
index 0000000..542fd66
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb
@@ -0,0 +1,34 @@
+require ${BPN}.inc
+
+DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft  ${BPN}-native"
+
+inherit binconfig lib_package gtk-icon-cache mime
+
+EXTRA_OECMAKE = " \
+    -DOPTION_BUILD_SHARED_LIBS=ON \
+    -DOPTION_USE_THREADS=ON \
+    -DOPTION_USE_XDBE=ON \
+    -DOPTION_USE_XFT=ON \
+    -DFLTK_CONFIG_PATH=${libdir}/cmake \
+"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
+
+PACKAGECONFIG[examples] = "-DOPTION_BUILD_EXAMPLES=ON,-DOPTION_BUILD_EXAMPLES=OFF,"
+PACKAGECONFIG[opengl] = "-DOPTION_USE_GL=ON,-DOPTION_USE_GL=OFF,virtual/libgl"
+PACKAGECONFIG[xinerama] = "-DOPTION_USE_XINERAMA=ON,-DOPTION_USE_XINERAMA=OFF,libxinerama"
+PACKAGECONFIG[xfixes] = "-DOPTION_USE_XFIXES=ON,-DOPTION_USE_XFIXES=OFF,libxfixes"
+PACKAGECONFIG[xcursor] = "-DOPTION_USE_XCURSOR=ON,-DOPTION_USE_XCURSOR=OFF,libxcursor"
+
+do_install_append() {
+    sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
+}
+
+python populate_packages_prepend () {
+    if (d.getVar('DEBIAN_NAMES')):
+        d.setVar('PKG_${BPN}', 'libfltk${PV}')
+}
+
+LEAD_SONAME = "libfltk.so"
+
+FILES_${PN} += "${datadir}/mime"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc
new file mode 100644
index 0000000..dbe700a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc
@@ -0,0 +1,21 @@
+SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
+HOMEPAGE = "http://www.fltk.org"
+SECTION = "libs"
+LICENSE = "LGPLv2 & FLTK"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
+
+SRC_URI = " \
+    http://fltk.org/pub/fltk/1.3.4/${BP}-source.tar.gz \
+    file://disable_test.patch \
+    file://fltk-no-freetype-config.patch \
+    file://0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch \
+    file://0002-always-build-fluid-and-export-pointers.patch \
+"
+
+PV = "1.3.4-1"
+SRC_URI[md5sum] = "d7fcd27ab928648e1a1366dd2e273970"
+SRC_URI[sha256sum] = "7fb2c8882433ce694e6900c94fda505e8f4ed3fa9c7e597007098a33b85c53f4"
+
+inherit cmake pkgconfig
+
+TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch
new file mode 100644
index 0000000..e6e68a0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch
@@ -0,0 +1,39 @@
+From e76a062338063615c069fedc5a143cc38c34d9b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 28 Feb 2017 01:00:21 +0100
+Subject: [PATCH] Fl_Preferences.cxx: do not use dlopen in case glibc's headers
+ are missing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx: In static member function ‘static int Fl_Plugin_Manager::load(const char*)’:
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:27: error: ‘RTLD_LAZY’ was not declared in this scope
+|      dl = dlopen(filename, RTLD_LAZY);
+|                            ^~~~~~~~~
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:36: error: ‘dlopen’ was not declared in this scope
+|      dl = dlopen(filename, RTLD_LAZY);
+|                                     ^
+| src/CMakeFiles/fltk.dir/build.make:1217: recipe for target 'src/CMakeFiles/fltk.dir/Fl_Preferences.cxx.o' failed
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ src/Fl_Preferences.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
+index 1233bb1..7857b9b 100644
+--- a/src/Fl_Preferences.cxx
++++ b/src/Fl_Preferences.cxx
+@@ -1737,7 +1737,7 @@ int Fl_Plugin_Manager::load(const char *filename) {
+   HMODULE dl = LoadLibrary(filename);
+ #else
+   void * dl = NULL;
+-# if HAVE_DLSYM
++# if HAVE_DLSYM && HAVE_DLFCN_H
+     dl = dlopen(filename, RTLD_LAZY);
+ # endif
+ #endif
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch
new file mode 100644
index 0000000..cca977c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch
@@ -0,0 +1,31 @@
+From 16010cb1a69ea2326d8102b7f1e34b65aca4b278 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 28 Feb 2017 01:20:42 +0100
+Subject: [PATCH] always build fluid and export pointers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ CMake/export.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/export.cmake b/CMake/export.cmake
+index 968186a..95e04eb 100644
+--- a/CMake/export.cmake
++++ b/CMake/export.cmake
+@@ -21,7 +21,7 @@
+ # final config and export
+ #######################################################################
+ # Set the fluid executable path
+-if(CMAKE_CROSSCOMPILING)
++if(FALSE)
+    find_file(FLUID_PATH
+       NAMES fluid fluid.exe
+       PATHS ENV PATH
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch
deleted file mode 100644
index 014184d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 14c22398f8370e33a798360ed0dad513af8f1470 Mon Sep 17 00:00:00 2001
-From: AlbrechtS <AlbrechtS@ea41ed52-d2ee-0310-a9c1-e6b18d33e121>
-Date: Sun, 15 Mar 2015 19:32:33 +0000
-Subject: [PATCH] Fix 'boolean' issue with jpeg-9 library compatibility (STR
- #2920).
-
-According to comments in STR #2920 and my own tests this is also
-compatible with older jpeg libraries (at least jpeg-8).
-
-Upstream-Status: Backport
-
----
- src/Fl_JPEG_Image.cxx |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx
-index 47120a7..6cebe88 100644
---- a/src/Fl_JPEG_Image.cxx
-+++ b/src/Fl_JPEG_Image.cxx
-@@ -155,7 +155,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *filename)	// I - File to load
-   
-   jpeg_create_decompress(&dinfo);
-   jpeg_stdio_src(&dinfo, fp);
--  jpeg_read_header(&dinfo, 1);
-+  jpeg_read_header(&dinfo, TRUE);
-   
-   dinfo.quantize_colors      = (boolean)FALSE;
-   dinfo.out_color_space      = JCS_RGB;
-@@ -337,7 +337,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
-   
-   jpeg_create_decompress(&dinfo);
-   jpeg_mem_src(&dinfo, data);
--  jpeg_read_header(&dinfo, 1);
-+  jpeg_read_header(&dinfo, TRUE);
-   
-   dinfo.quantize_colors      = (boolean)FALSE;
-   dinfo.out_color_space      = JCS_RGB;
--- 
-1.7.9.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
index 4d13ffc..2a9915b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
@@ -1,20 +1,40 @@
---- a/configure.in.orig	2015-11-26 14:30:17.893426966 +0800
-+++ b/configure.in	2015-11-26 14:33:00.285424099 +0800
-@@ -969,12 +969,12 @@ case $host_os_gui in
-         AC_ARG_ENABLE(xft, [  --enable-xft            turn on Xft support [[default=yes]]])
+From 699420d306cadbb5285942e09f4383d84b01985d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 13 Jan 2017 13:21:23 +0100
+Subject: [PATCH] replace freetype-config by pkg-config
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f0efd48..3af5ecb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1006,12 +1006,12 @@ case $host_os_gui in
  
+ 	xft_found=no
  	if test x$enable_xft != xno; then
--            AC_PATH_PROG(FTCONFIG,freetype-config)
-+            AC_PATH_PROG(PKGCONFIG,pkg-config)
+-	    AC_PATH_PROG(FTCONFIG, freetype-config)
++	    AC_PATH_PROG(PKGCONFIG,pkg-config)
  
 -	    if test "x$FTCONFIG" != x; then
--	        CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
--	        CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
--	        CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
+-		CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
+-		CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
+-		CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
 +	    if test "x$PKGCONFIG" != x; then
 +	        CPPFLAGS="`$PKGCONFIG --cflags xft` $CPPFLAGS"
 +	        CFLAGS="`$PKGCONFIG --cflags xft` $CFLAGS"
 +	        CXXFLAGS="`$PKGCONFIG --cflags xft` $CXXFLAGS"
  
- 	        AC_CHECK_LIB(fontconfig, FcPatternCreate)
+ 		AC_CHECK_LIB(fontconfig, FcPatternCreate)
  		AC_CHECK_HEADER(X11/Xft/Xft.h,
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb
deleted file mode 100644
index 117ecc3..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
-HOMEPAGE = "http://www.fltk.org"
-SECTION = "libs"
-LICENSE = "LGPLv2 & FLTK"
-LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
-
-DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft"
-
-SRC_URI = "http://fltk.org/pub/fltk/${PV}/${BP}-source.tar.gz \
-           file://disable_test.patch \
-           file://fltk-no-freetype-config.patch \
-           file://fix-boolean-issue-with-jpeg9.patch \
-"
-
-SRC_URI[md5sum] = "9ccdb0d19dc104b87179bd9fd10822e3"
-SRC_URI[sha256sum] = "f8398d98d7221d40e77bc7b19e761adaf2f1ef8bb0c30eceb7beb4f2273d0d97"
-
-inherit autotools-brokensep binconfig pkgconfig lib_package
-
-TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"
-
-EXTRA_OECONF = "--enable-shared \
-                --enable-threads \
-                --enable-xdbe \
-                --enable-xft \
-"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', '', d)}"
-
-PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
-PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,libxinerama"
-PACKAGECONFIG[xfixes] = "--enable-xfixes,--disable-xfixes,libxfixes"
-PACKAGECONFIG[xcursor] = "--enable-xcursor,--disable-xcursor,libxcursor"
-
-do_configure() {
-    oe_runconf
-}
-
-do_install_append_class-target() {
-    sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
-}
-
-python populate_packages_prepend () {
-    if (d.getVar('DEBIAN_NAMES', 1)):
-        d.setVar('PKG_${BPN}', 'libfltk${PV}')
-}
-
-LEAD_SONAME = "libfltk.so"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch
new file mode 100644
index 0000000..220edef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch
@@ -0,0 +1,45 @@
+libwinpr/comm_seria: fix missing define
+
+FreeRDP uses CMSPAR, which is defined by glibc in bits/termios.h .
+
+glibc has two flavours of bits/termios.h: a genmeric one and an
+architecture-specific one. When installing, glibc will install the
+architecture-specific file if it exists, otherwise it installs the
+generic file. Only Alpha, MIPS, PPC and Sparc have their own
+bits/termios.h.
+
+The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
+do define CMSPAR. However, the MIPS flavour does not define it.
+
+Define CMSPAR to the value from the generic value, which is also the
+value known to the Linux kernel for MIPS.
+
+Fixes:
+    http://autobuild.buildroot.org/results/0b4/0b4793f0bf9f4c57933897f3480054a4e06528ad/
+    http://autobuild.buildroot.org/results/7a2/7a2284d0a2987158fa2e78f789b07c8c6fcdb974/
+    http://autobuild.buildroot.org/results/387/3874088c3ccd4bbf76ea0c911ca1ef64c7dc9d1c/
+    ...
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Cc: Peter Korsgaard <jacmet@uclibc.org>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+diff -durN freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16.orig/winpr/libwinpr/comm/comm_serial_sys.c freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16/winpr/libwinpr/comm/comm_serial_sys.c
+--- freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16.orig/winpr/libwinpr/comm/comm_serial_sys.c	2015-09-04 16:20:17.000000000 +0100
++++ freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16/winpr/libwinpr/comm/comm_serial_sys.c	2015-10-04 11:07:41.868513726 +0100
+@@ -27,6 +27,14 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <termios.h>
++
++/* glibc for MIPS has its own bits/termios.h which does not define
++ * CMSPAR, so we vampirise the value from the generic bits/termios.h
++ */
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
++
+ #include <unistd.h>
+ 
+ #include "comm_serial_sys.h"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
index 339a053..f0aa1b6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
@@ -17,6 +17,7 @@
 SRC_URI = "git://github.com/FreeRDP/FreeRDP.git \
     file://winpr-makecert-Build-with-install-RPATH.patch \
     file://0001-FindGStreamer_1_0-fix-build-failure-for-new-gstreame.patch \
+    file://0003-add-missing-define.patch \
 "
 
 S = "${WORKDIR}/git"
@@ -32,14 +33,10 @@
     -DWITH_MANPAGES=OFF \
 "
 
-PACKAGECONFIG ??= "  \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}\
-                gstreamer cups \
-                "
+PACKAGECONFIG ??= " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
+    gstreamer cups \
+"
 
 X11_DEPS = "virtual/libx11 libxinerama libxext libxcursor libxv libxi libxrender libxfixes libxdamage libxrandr libxkbfile"
 PACKAGECONFIG[x11] = "-DWITH_X11=ON -DWITH_XINERAMA=ON -DWITH_XEXT=ON -DWITH_XCURSOR=ON -DWITH_XV=ON -DWITH_XI=ON -DWITH_XRENDER=ON -DWITH_XFIXES=ON -DWITH_XDAMAGE=ON -DWITH_XRANDR=ON -DWITH_XKBFILE=ON,-DWITH_X11=OFF,${X11_DEPS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch
new file mode 100644
index 0000000..eab4975
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch
@@ -0,0 +1,24 @@
+From 8520274759cb8f95e483b02a445aff225e13467b Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:00:27 +0200
+Subject: [PATCH] .gitignore the new test case
+
+Upstream-Status: Backport
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ tests/tga/.gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/tga/.gitignore b/tests/tga/.gitignore
+index e88e124..7a659b1 100644
+--- a/tests/tga/.gitignore
++++ b/tests/tga/.gitignore
+@@ -4,3 +4,4 @@
+ /bug00248
+ /bug00248a
+ /tga_null
++/tga_read
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch
new file mode 100644
index 0000000..7ccfbea
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch
@@ -0,0 +1,60 @@
+From c92240c1670c20c2f854761d3a89ab61dd158c91 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Sat, 6 Aug 2016 10:08:53 +0200
+Subject: [PATCH] Fix potential unsigned underflow
+
+No need to decrease `u`, so we don't do it. While we're at it, we also factor
+out the overflow check of the loop, what improves performance and readability.
+
+This issue has been reported by Stefan Esser to security@libgd.org.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10166
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_interpolation.c | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c
+index 7e7943d..9944349 100644
+--- a/src/gd_interpolation.c
++++ b/src/gd_interpolation.c
+@@ -829,8 +829,13 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
+ {
+ 	unsigned int u = 0;
+ 	LineContribType *res;
+-	int overflow_error = 0;
++	size_t weights_size;
+ 
++	if (overflow2(windows_size, sizeof(double))) {
++		return NULL;
++	} else {
++		weights_size = windows_size * sizeof(double);
++	}
+ 	res = (LineContribType *) gdMalloc(sizeof(LineContribType));
+ 	if (!res) {
+ 		return NULL;
+@@ -847,15 +852,11 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
+ 		return NULL;
+ 	}
+ 	for (u = 0 ; u < line_length ; u++) {
+-		if (overflow2(windows_size, sizeof(double))) {
+-			overflow_error = 1;
+-		} else {
+-			res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double));
+-		}
+-		if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) {
++		res->ContribRow[u].Weights = (double *) gdMalloc(weights_size);
++		if (res->ContribRow[u].Weights == NULL) {
+ 			unsigned int i;
+-			u--;
+-			for (i=0;i<=u;i++) {
++
++			for (i=0;i<u;i++) {
+ 				gdFree(res->ContribRow[i].Weights);
+ 			}
+ 			gdFree(res->ContribRow);
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch
new file mode 100644
index 0000000..54ef22c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch
@@ -0,0 +1,48 @@
+From 6ab531ef0d82efb9e00236ee5ea23928335d221f Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Fri, 7 Apr 2017 12:30:22 +0300
+Subject: [PATCH] Fix DOS vulnerability in gdImageCreateFromGd2Ctx()
+
+We must not pretend that there are image data if there are none. Instead
+we fail reading the image file gracefully.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10167
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_gd2.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/gd_gd2.c b/src/gd_gd2.c
+index 8df93c1..bae65ea 100644
+--- a/src/gd_gd2.c
++++ b/src/gd_gd2.c
+@@ -445,18 +445,16 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
+ 
+ 						if (im->trueColor) {
+ 							if (!gdGetInt (&im->tpixels[y][x], in)) {
+-								/*printf("EOF while reading\n"); */
+-								/*gdImageDestroy(im); */
+-								/*return 0; */
+-								im->tpixels[y][x] = 0;
++								gd_error("gd2: EOF while reading\n");
++								gdImageDestroy(im);
++								return NULL;
+ 							}
+ 						} else {
+ 							int ch;
+ 							if (!gdGetByte (&ch, in)) {
+-								/*printf("EOF while reading\n"); */
+-								/*gdImageDestroy(im); */
+-								/*return 0; */
+-								ch = 0;
++								gd_error("gd2: EOF while reading\n");
++								gdImageDestroy(im);
++								return NULL;
+ 							}
+ 							im->pixels[y][x] = ch;
+ 						}
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch
new file mode 100644
index 0000000..aef1060
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch
@@ -0,0 +1,38 @@
+From 2d37bdc03a6e2b820fe380016f22592a7733e0be Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Fri, 7 Apr 2017 12:32:49 +0300
+Subject: [PATCH] Fix #354: Signed Integer Overflow gd_io.c
+
+GD2 stores the number of horizontal and vertical chunks as words (i.e. 2
+byte unsigned). These values are multiplied and assigned to an int when
+reading the image, what can cause integer overflows. We have to avoid
+that, and also make sure that either chunk count is actually greater
+than zero. If illegal chunk counts are detected, we bail out from
+reading the image.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10168
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_gd2.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/gd_gd2.c b/src/gd_gd2.c
+index bae65ea..9006bd2 100644
+--- a/src/gd_gd2.c
++++ b/src/gd_gd2.c
+@@ -151,6 +151,10 @@ _gd2GetHeader (gdIOCtxPtr in, int *sx, int *sy,
+ 	GD2_DBG (printf ("%d Chunks vertically\n", *ncy));
+ 
+ 	if (gd2_compressed (*fmt)) {
++		if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
++			GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
++			goto fail1;
++		}
+ 		nc = (*ncx) * (*ncy);
+ 
+ 		GD2_DBG (printf ("Reading %d chunk index entries\n", nc));
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch
new file mode 100644
index 0000000..97b7f72
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch
@@ -0,0 +1,167 @@
+From fb0e0cce0b9f25389ab56604c3547351617e1415 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:26:19 +0200
+Subject: [PATCH] Fix OOB reads of the TGA decompression buffer
+
+It is possible to craft TGA files which will overflow the decompression
+buffer, but not the image's bitmap. Therefore we augment the check for the
+bitmap's overflow with a check for the buffer's overflow.
+
+This issue had been reported by Ibrahim El-Sayed to security@libgd.org.
+
+CVE-2016-6906
+
+Upstream-Status: Backport
+CVE: CVE-2016-6906
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                |   6 ++++--
+ tests/tga/.gitignore        |   1 +
+ tests/tga/CMakeLists.txt    |   1 +
+ tests/tga/Makemodule.am     |   2 ++
+ tests/tga/heap_overflow.c   |  51 ++++++++++++++++++++++++++++++++++++++++++++
+ tests/tga/heap_overflow.tga | Bin 0 -> 605 bytes
+ 6 files changed, 59 insertions(+), 2 deletions(-)
+ create mode 100644 tests/tga/heap_overflow.c
+ create mode 100644 tests/tga/heap_overflow.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index 8737b04..68e4b17 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -300,7 +300,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size
++						|| buffer_caret + pixel_block_size > rle_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+@@ -316,7 +317,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = decompression_buffer[ buffer_caret ] + 1;
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size
++						|| buffer_caret + (encoded_pixels * pixel_block_size) > rle_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+diff --git a/tests/tga/.gitignore b/tests/tga/.gitignore
+index 7a659b1..cf0556b 100644
+--- a/tests/tga/.gitignore
++++ b/tests/tga/.gitignore
+@@ -3,5 +3,6 @@
+ /bug00247a
+ /bug00248
+ /bug00248a
++/heap_overflow
+ /tga_null
+ /tga_read
+diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt
+index 789fb14..11542a0 100644
+--- a/tests/tga/CMakeLists.txt
++++ b/tests/tga/CMakeLists.txt
+@@ -5,6 +5,7 @@ LIST(APPEND TESTS_FILES
+ 	bug00247a
+ 	bug00248
+ 	bug00248a
++	heap_overflow
+ 	tga_read
+ )
+ 
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index a1e6af6..916d707 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -4,6 +4,7 @@ libgd_test_programs += \
+ 	tga/bug00247a \
+ 	tga/bug00248 \
+ 	tga/bug00248a \
++	tga/heap_overflow \
+ 	tga/tga_null \
+ 	tga/tga_read
+ 
+@@ -14,6 +15,7 @@ EXTRA_DIST += \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+ 	tga/bug00248a.tga \
++	tga/heap_overflow.tga \
+ 	tga/tga_read_rgb.png \
+ 	tga/tga_read_rgb.tga \
+ 	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/heap_overflow.c b/tests/tga/heap_overflow.c
+new file mode 100644
+index 0000000..0e9a2d0
+--- /dev/null
++++ b/tests/tga/heap_overflow.c
+@@ -0,0 +1,51 @@
++/**
++ * Test that the crafted TGA file doesn't trigger OOB reads.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++static size_t read_test_file(char **buffer, char *basename);
++
++
++int main()
++{
++    gdImagePtr im;
++    char *buffer;
++    size_t size;
++
++    size = read_test_file(&buffer, "heap_overflow.tga");
++    im = gdImageCreateFromTgaPtr(size, (void *) buffer);
++    gdTestAssert(im == NULL);
++    free(buffer);
++
++    return gdNumFailures();
++}
++
++
++static size_t read_test_file(char **buffer, char *basename)
++{
++    char *filename;
++    FILE *fp;
++    size_t exp_size, act_size;
++
++    filename = gdTestFilePath2("tga", basename);
++    fp = fopen(filename, "rb");
++    gdTestAssert(fp != NULL);
++
++	fseek(fp, 0, SEEK_END);
++	exp_size = ftell(fp);
++	fseek(fp, 0, SEEK_SET);
++
++    *buffer = malloc(exp_size);
++    gdTestAssert(*buffer != NULL);
++    act_size = fread(*buffer, sizeof(**buffer), exp_size, fp);
++    gdTestAssert(act_size == exp_size);
++
++    fclose(fp);
++    free(filename);
++
++    return act_size;
++}
+diff --git a/tests/tga/heap_overflow.tga b/tests/tga/heap_overflow.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..e9bc0ecb2a847ac6edba92dd0ff61167b49002cd
+GIT binary patch
+literal 605
+zcmZQz;9`IQ9tIu;g&7<$F3o7Yg1qzyh6tefy9wZAs2d<Uh*yuz=?XwW4Qvuv#g2nS
+zp93+mT0rVR>T&8(2TGy=f_l)@gSap~$FayUFu(!|SyJIFga^{8fGj~vwq8kkVgvv>
+Cavop+
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch
new file mode 100644
index 0000000..8b6de97
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch
@@ -0,0 +1,135 @@
+From 58b6dde319c301b0eae27d12e2a659e067d80558 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:26:19 +0200
+Subject: [PATCH] Fix OOB reads of the TGA decompression buffer
+
+It is possible to craft TGA files which will overflow the decompression
+buffer, but not the image's bitmap. Therefore we also have to check for
+potential decompression buffer overflows.
+
+This issue had been reported by Ibrahim El-Sayed to security@libgd.org;
+a modified case exposing an off-by-one error of the first patch had been
+provided by Konrad Beckmann.
+
+This commit is an amendment to commit fb0e0cce, so we use CVE-2016-6906
+as well.
+
+Upstream-Status: Backport
+CVE: CVE-2016-6906
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                  |   8 +++++++-
+ tests/tga/Makemodule.am       |   3 ++-
+ tests/tga/heap_overflow.c     |  16 ++++++++++++----
+ tests/tga/heap_overflow_1.tga | Bin 0 -> 605 bytes
+ tests/tga/heap_overflow_2.tga | Bin 0 -> 8746 bytes
+ 5 files changed, 21 insertions(+), 6 deletions(-)
+ create mode 100644 tests/tga/heap_overflow_1.tga
+ create mode 100644 tests/tga/heap_overflow_2.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index 68e4b17..f80f0b1 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -295,7 +295,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 		buffer_caret = 0;
+ 
+ 		while( bitmap_caret < image_block_size ) {
+-			
++
++			if (buffer_caret + pixel_block_size > rle_size) {
++				gdFree( decompression_buffer );
++				gdFree( conversion_buffer );
++				return -1;
++			}
++
+ 			if ((decompression_buffer[buffer_caret] & TGA_RLE_FLAG) == TGA_RLE_FLAG) {
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index 916d707..ab08dbf 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -15,7 +15,8 @@ EXTRA_DIST += \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+ 	tga/bug00248a.tga \
+-	tga/heap_overflow.tga \
++	tga/heap_overflow_1.tga \
++	tga/heap_overflow_2.tga \
+ 	tga/tga_read_rgb.png \
+ 	tga/tga_read_rgb.tga \
+ 	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/heap_overflow.c b/tests/tga/heap_overflow.c
+index 0e9a2d0..ddd4b63 100644
+--- a/tests/tga/heap_overflow.c
++++ b/tests/tga/heap_overflow.c
+@@ -1,5 +1,5 @@
+ /**
+- * Test that the crafted TGA file doesn't trigger OOB reads.
++ * Test that crafted TGA files don't trigger OOB reads.
+  */
+ 
+ 
+@@ -7,21 +7,29 @@
+ #include "gdtest.h"
+ 
+ 
++static void check_file(char *basename);
+ static size_t read_test_file(char **buffer, char *basename);
+ 
+ 
+ int main()
+ {
++    check_file("heap_overflow_1.tga");
++    check_file("heap_overflow_2.tga");
++
++    return gdNumFailures();
++}
++
++
++static void check_file(char *basename)
++{
+     gdImagePtr im;
+     char *buffer;
+     size_t size;
+ 
+-    size = read_test_file(&buffer, "heap_overflow.tga");
++    size = read_test_file(&buffer, basename);
+     im = gdImageCreateFromTgaPtr(size, (void *) buffer);
+     gdTestAssert(im == NULL);
+     free(buffer);
+-
+-    return gdNumFailures();
+ }
+ 
+ 
+diff --git a/tests/tga/heap_overflow_1.tga b/tests/tga/heap_overflow_1.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..e9bc0ecb2a847ac6edba92dd0ff61167b49002cd
+GIT binary patch
+literal 605
+zcmZQz;9`IQ9tIu;g&7<$F3o7Yg1qzyh6tefy9wZAs2d<Uh*yuz=?XwW4Qvuv#g2nS
+zp93+mT0rVR>T&8(2TGy=f_l)@gSap~$FayUFu(!|SyJIFga^{8fGj~vwq8kkVgvv>
+Cavop+
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/heap_overflow_2.tga b/tests/tga/heap_overflow_2.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..2b681f2df8941d6823aa761be0a7fa3c02c92cbf
+GIT binary patch
+literal 8746
+zcmeIxF$#b%6a>*<djij4?cuz+Vi5?!RIY)@*eDAQ@`zPSwQE1NTI<YQEqdQG#s5@h
+zwDFtAoIjm)CIQa|$z*q(vz}DbnPjrN&RI{Y=}a=&UFWPP)joCZ<31}ey8!(}FZZ71
+zWop>#e)AY=opmMw&j!h4cb&7IRMVMcvb)Y%PpaumGTB|{tS8lUCYkK6bJmk;IzMDC
+D4PYIN
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch
new file mode 100644
index 0000000..64f5c62
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch
@@ -0,0 +1,359 @@
+From 4f8e26f2a40ffaa3a5b77be6a49989a1a42e2b83 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 14:27:23 +0200
+Subject: [PATCH] Fix #290: TGA RLE decoding is broken
+
+We make it work only, for now. Actually, it doesn't make sense that
+`oTga::bitmap` is an `int *` as we're storing only bytes there. If this
+will be changed, we can even get rid of the `conversion_buffer` in
+`read_image_tga` altogether, and read the image data into the
+`decompression_buffer` (if RLE'd) or the `tga->bitmap` (if uncompressed)
+directly.
+
+Upstream-Status: Backport
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                   |  18 ++++++++++--------
+ tests/tga/CMakeLists.txt       |   1 +
+ tests/tga/Makemodule.am        |   8 ++++++--
+ tests/tga/tga_read.c           |  40 ++++++++++++++++++++++++++++++++++++++++
+ tests/tga/tga_read_rgb.png     | Bin 0 -> 2349 bytes
+ tests/tga/tga_read_rgb.tga     | Bin 0 -> 90444 bytes
+ tests/tga/tga_read_rgb_rle.tga | Bin 0 -> 9987 bytes
+ 7 files changed, 57 insertions(+), 10 deletions(-)
+ create mode 100644 tests/tga/tga_read.c
+ create mode 100644 tests/tga/tga_read_rgb.png
+ create mode 100644 tests/tga/tga_read_rgb.tga
+ create mode 100644 tests/tga/tga_read_rgb_rle.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index ec6781f..8737b04 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -207,12 +207,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ {
+ 	int pixel_block_size = (tga->bits / 8);
+ 	int image_block_size = (tga->width * tga->height) * pixel_block_size;
+-	uint8_t* decompression_buffer = NULL;
++	int* decompression_buffer = NULL;
+ 	unsigned char* conversion_buffer = NULL;
+ 	int buffer_caret = 0;
+ 	int bitmap_caret = 0;
+ 	int i = 0;
+ 	int encoded_pixels;
++	int rle_size;
+ 
+ 	if(overflow2(tga->width, tga->height)) {
+ 		return -1;
+@@ -266,7 +267,7 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 		/*! \brief Read in RLE compressed RGB TGA
+ 		 *  Chunk load the pixel data from an RLE compressed RGB type TGA.
+ 		 */
+-		decompression_buffer = (uint8_t*) gdMalloc(image_block_size * sizeof(uint8_t));
++		decompression_buffer = (int*) gdMalloc(image_block_size * sizeof(int));
+ 		if (decompression_buffer == NULL) {
+ 			return -1;
+ 		}
+@@ -277,7 +278,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 			return -1;
+ 		}
+ 
+-		if (gdGetBuf(conversion_buffer, image_block_size, ctx) != image_block_size) {
++		rle_size = gdGetBuf(conversion_buffer, image_block_size, ctx);
++		if (rle_size <= 0) {
+ 			gdFree(conversion_buffer);
+ 			gdFree(decompression_buffer);
+ 			return -1;
+@@ -285,7 +287,7 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 
+ 		buffer_caret = 0;
+ 
+-		while( buffer_caret < image_block_size) {
++		while( buffer_caret < rle_size) {
+ 			decompression_buffer[buffer_caret] = (int)conversion_buffer[buffer_caret];
+ 			buffer_caret++;
+ 		}
+@@ -298,14 +300,14 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) >= image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+ 				}
+ 
+ 				for (i = 0; i < encoded_pixels; i++) {
+-					memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, pixel_block_size);
++					memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, pixel_block_size * sizeof(int));
+ 					bitmap_caret += pixel_block_size;
+ 				}
+ 				buffer_caret += pixel_block_size;
+@@ -314,13 +316,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = decompression_buffer[ buffer_caret ] + 1;
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) >= image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+ 				}
+ 
+-				memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, encoded_pixels * pixel_block_size);
++				memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, encoded_pixels * pixel_block_size * sizeof(int));
+ 				bitmap_caret += (encoded_pixels * pixel_block_size);
+ 				buffer_caret += (encoded_pixels * pixel_block_size);
+ 			}
+diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt
+index c3a589c..789fb14 100644
+--- a/tests/tga/CMakeLists.txt
++++ b/tests/tga/CMakeLists.txt
+@@ -5,6 +5,7 @@ LIST(APPEND TESTS_FILES
+ 	bug00247a
+ 	bug00248
+ 	bug00248a
++	tga_read
+ )
+ 
+ ADD_GD_TESTS()
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index dff828f..a1e6af6 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -4,7 +4,8 @@ libgd_test_programs += \
+ 	tga/bug00247a \
+ 	tga/bug00248 \
+ 	tga/bug00248a \
+-	tga/tga_null
++	tga/tga_null \
++	tga/tga_read
+ 
+ EXTRA_DIST += \
+ 	tga/CMakeLists.txt \
+@@ -12,4 +13,7 @@ EXTRA_DIST += \
+ 	tga/bug00247.tga \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+-	tga/bug00248a.tga
++	tga/bug00248a.tga \
++	tga/tga_read_rgb.png \
++	tga/tga_read_rgb.tga \
++	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/tga_read.c b/tests/tga/tga_read.c
+new file mode 100644
+index 0000000..310b72f
+--- /dev/null
++++ b/tests/tga/tga_read.c
+@@ -0,0 +1,40 @@
++/**
++ * Basic test case for reading TGA files.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++static void assert_equals(char *exp, char *orig);
++
++
++int main()
++{
++    assert_equals("tga_read_rgb.png", "tga_read_rgb.tga");
++    assert_equals("tga_read_rgb.png", "tga_read_rgb_rle.tga");
++
++    return gdNumFailures();
++}
++
++
++static void assert_equals(char *exp, char *orig)
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *filename;
++
++    fp = gdTestFileOpen2("tga", orig);
++    gdTestAssertMsg(fp != NULL, "can't open %s", orig);
++
++    im = gdImageCreateFromTga(fp);
++    gdTestAssertMsg(im != NULL, "can't read %s", orig);
++    fclose(fp);
++
++    filename = gdTestFilePath2("tga", exp);
++    gdAssertImageEqualsToFile(filename, im);
++    gdFree(filename);
++
++    gdImageDestroy(im);
++}
+diff --git a/tests/tga/tga_read_rgb.png b/tests/tga/tga_read_rgb.png
+new file mode 100644
+index 0000000000000000000000000000000000000000..bc468e3d927eaeb77d2f5c3bc35b970457f60f18
+GIT binary patch
+literal 2349
+zcmZ`*c{tSX7XOaO7-6K6b&RD_MnXy$nHe#bsVG~TvfZ*vO?Jle8%ar+AySDfStFGh
+zG#*)pL0RUPJ(FedBaE?x-*o@D_deZwpZ7WMdCuo~-t)faoX_)~lW+lNCI*p(001C{
+zHOJWSbt_+Pfp_!w<m@>WzS`|-X@&uIeytaE1*v>QB*5J9HUNl9{Spw6`Sc(k6uyJC
+zHWeNNLm|3~tCo{U002|57?VrEU+1$sy;a&|;-kbZl`6E_C%>gqbDtC=57F3fUD$)k
+zSG5DTL6#NnU=7wGcCw|<f|{rZi)5q<cVW*NQPQCY0xPU0_nGG#D?wR37BO^o^261%
+z+}quQI_1ZP=gTNp-n|;#)z~^;78o=e@tRYrS#8Jc>M{W*OdYEgjJp6u9Rb7l#X%t`
+zun;^h28uEP=P3Px?|rNGF#17D%A(CJ_ar|?n^0nq!~w+Wg23867ryn!Zlb|~&7A~z
+zqkP=IPyLrOM?58>2rEq=&{*9OMU!HNWJkg`(`y(=2{WLg392OTDyiM2$iCLcv5LCG
+zjWwRq46Da$pV|V^4Gvs36k1dWF^V4c8j%3~jN{*0*$phpF|-#zi@;k@t-s?cqW&sd
+zPh{x~@zm`!5V23*L&Qb=_elN~nEEqQhrhNZiRU#|qjK>6ptaYgj*sAcuS+t-7X5aB
+zUI5f*aL0Dut+y0vde?tg7QMa^0`(plvuD^Q>)J(abQY>@6P_*YY;XJ54VC^_f7F2x
+z21ee^35}!<L@bW?<-JgJ-%sahFv68xPXghCl|CsCc-P-A{`kl_3By}Mq}YnYYmSt4
+z8h8mx?<zBgq9CzV4*#zR8t}x5Or8!9Rn6LgajJ!B)ebxEtrwC@*p4M@D51#?OEY}<
+zqJHu+sCRU2YXNxiq(DP@*(Ui?Jz;IQ@O$Lbf}e8Nwij*L&iUd$N4-Ykfp$vDx#uv?
+z#_eULpAbPvN<tVA>Ek##rQDAOW+@)2?%}XiiSi^ted1PQu{v0&?bA^r%z?7*An3_H
+zvYFv8{p8fsCguNR$#3=6O{^H&8kT9N92CeaRAj3Y_cNl-znY8JZ{MpO#OK}A<_w9J
+zWMI2Kl?xv|S-FTV(aUG_`UWTZOFJGgv2)>JR#*H2Uad(wyqbIZt?w|Dw|k<eY&&9F
+zcr!zDg7=#H^=^MC+W02GN{78K=4Kuq90c@$7f$7+h)^YFm}-?3cEdU+Ivh5RC<+Yy
+zOz(7r<tT|Z34S@glz^9lpp@OstDBGA(iwk<LQ#r@i_)^MV*Re3^qB#j7N}4etZfK>
+zt6<wtj&M2(TLgTh3AH(}4;f4j=<Iu^axvT0!8B)K0O!7g?WnhIyGH5@EtT77&?E{6
+zB5<#{PWJOxQkF}LskzI@;(qVCjE%v-h|S8;`k#h^W5wR-cadW2H2Mk+7QZhqSRd!M
+zcQ8fpx~O^(^O#2gXiWDX&u@lZT#qjPG~Xh0UobVq#~Lumf!%S9`Jhf%MH?4Re5-17
+z7BP>D>=sy59jEGoeEx_W13BnmhAs?*j6#bG1a@#16O~1>q+P2@%QN~``Ws7=WX;F9
+z`=p5I$1ig*G|iW8vslr2^8hj+A0HWDoT-@fn5I53ZWWp!r8fMghmpjdqC%E#%2HFI
+zY&A(g!Li3+$<B^y8^Hw5!sXd&k%Ev!a;~aB#joj1?2ntu9|!GAFUwyc0oe_~y<}?E
+zUh@HUbCI(x2W1rmg7ckzRL2Ew#cdujut+*-t0g)81Tu+3ZH4uP`r1d1kSooU@5ybL
+zR5_J%A5sbak)KrSf>(r|V*&yCb;Ha(&ACi9w;?kQ7q1$hwjli^);+KIJAh|K&YL#E
+z+b(`PZN>V_5?v`hu-U429K9fO%8*k8pE=jDkn5ZJK|Vgl*@&QE^;mwlCxWbq4(hyi
+zUuz)bk@5^HOk@gB`SaWZfX07Eom07js%np8Xot&?YP8R+3|jrR4c#zO{LO<?^G84O
+zoP}G`MK)LZDo_$#nWR09X>NY_mL~1^BUG})*4b;Z_zq+`Q@kzUHC&`trCiQYum;1?
+zBic+0Bl>LLYU?>!B3k!Ils}uXR*`OEr3`f<P@HZFk`0fP5`^X=BOtC?@!vUq7B4OF
+zZEw6+3eoFRE@xEw(%DfIybhJuo03Du2ldm$20Sn3hj15Lu&gPQp=N%r%hME$*j{^@
+zRTffQhH7JLB-70qVkSm$9Zt`mahHLT7O^JnNqAAJs0C^n+1uj_E-}S^?&_U=H?;D_
+z1U9UJAz|+7z|Yq(6${A~5fhc}hH5twnKukf#Dn_JnQ$J4-Z$d}*Trq>?aKr2p19c6
+zYJ}r+^s>6aD~mrp;oIUhlig4sM)Jg3=J{K;dp#BCzRu1sU3D1wJl{jA^Y#ShVT+|^
+zUyjiM&wD~v3zy}K!zWm%3cpu#(*)cmxw1+n+C7V|hcZ6h8CZLubXt&J)h$6yflV6>
+zOVv_gDb*glO9FLL8x6bqM6(F#pGhGy+jjOyt9-daMWGrJKF{XvnT#^TeYaq2MG)qw
+zJ=RV;Mwg*goOa?(wM=EH<#AS$egRj*wnm+Bu4Pb{$-O}GZSiuT1UdBDwv2Rz)b3+L
+zRA=nkaWHB7I$T~B%;KynnS0b@3YpKqt$2;qzwLf>DZ4RFCQB!=QQ`Ft&y_PThuDsA
+zckawmbFnA9Tl7+Ez%a)>>T+Nh@8UxzrZP`<pHEXVd#|2v=f_b#A@|oAzbk6Q_>|O)
+zgw?Xli!)-)xrF2z=thH-TI;|>UVYK64@asT%484CF-pjk+~~wA+Z%fZYua+sDJ<Nf
+zfO`bfl}ig_0&C7BCuBa)xZ?-mQO=bQ2N5;>Sw}~|(tM}hK+z>+^8QQhOsTxl+2AJ+
+zX8WjlS|;0WRv7s_Bk=@u$v3GL@qC?&jcNEv<o68kaz!pHOs@;#CSh|{!j&zrsfn8j
+z6|o#^6C2NO9!G&u;Q0U5hkpCs|2Z3I$nNY~x}Tl<rOB|1KiB|RQyiuYbv@>9Cook&
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/tga_read_rgb.tga b/tests/tga/tga_read_rgb.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..5f11f5a080f3424dff6ff368db6af140a5777e23
+GIT binary patch
+literal 90444
+zcmeI4Kab?b5yc6Af(;c(13`fU*%&xb;tQC_*aPhI`Y#kR+DO4FyO7x>23DD|fPu*!
+zc$3RVz$FeASlIpmlR7c>{0XS{cwI!Xhn!*0&G0z9w?L_y)m6=&?%yLhCt|YfC)vBd
+z@3Mbp-(`!RR#lbBv<6~842S_SAO^&M7!U(uKn#chF(3xSfEW-1Vn7Ut0Wly3#DEwO
+z17bi7hygJm2E>3E5CdYM&A?}$ex4m_TFdrYYCYz+9zh#Fz&|9|x2zKn^W#B#+TPQk
+zkGJqug1wSH+UqE;=D8ly$2|8{dOgm*N*~8rNAWn%b(B8lxv$dearRaEIL<nX$9b-!
+z^fAwUm0pjtuhPeH)=@mpa~-9RdG4$9dYpZgK8~}F;&GnqD1FRxU!~XM?5p%~oOKkB
+z^IXTEkMH5{66|-Z6BF}fVs88T*I)i3JJhoOSJ|O9w{_I#nWx?l)duSh)duUtlh$At
+z17Cjm-|T(t=^t5ksQGyXeY}RR66}rB$6N4TCD<$JL)!2RcC~{xmhcaW#u{p)fITEy
+zttmer=|ik~9;VU``gjIkB^qnU`Ab-pXwrv%OZ+UJZKV%gx2JNgp5i>D59woyTux<9
+z(uedh6&9yB59vetm?D=`nUnM(eN2VLDb7RskUpl!<y7V*eMlcuVR4G{kUpf3DRMcL
+zIY}SV$5dFH;yfm%k4wB~a-Co=-1}Dr-lw`wu&?y~m97o@G#T{q3H)`Uv4-!7EMeD)
+zw)K9=Z~mTThuUAV|7C~TzV%W6$E~45nY6k?xn!MZFO2s+{6m8MjdfuTKfpgE*thW<
+z{Cw2@xOHLsAGrJk{yNcELpGPN>qM)WwmHy;dAx?N66{Tw1IK#{s}k%La$6ep^HE#+
+za9lo1VAA+y4Y_=oz@+gjedzt&v$!^qahUWWUeAKpvG42Bhn^$GX6~HMCw)jC=fvyS
+zbCo`%kFl9Mr}If4(#JXRI`&+p59woU=FaJS(ueeMPP~piSLs9g7@N6sI-m3*eVh}o
+zW6yPB`q2AV`u~)Z`u~(cA78-VB^qn^p2#KaF44B$FA47vAM{(Ncz3vdANUYI_Vq~T
+zJFok7_+8Hr{@dw6AD4;m*uMzx*i#=x;yd<VQBUIaym%dZzk)u#fWJ#L*6_E}FJX6y
+zR{!R@|ExhDui;aE=k$%!$6N58@;j%mqz`GsGuYJ*`gjJP^1JEGWequh2}}9ibmmGQ
+z`krwX_ipJ!*U+x(reg27kUpdjX`!D1>7##b#EsTQ`Va%U4)il1ee|!5xY623A7Vh)
+zfqn+0kN&k0H(DF%Lk#FT(9eMM(Z4q0Mr$K|hyh&(`Wcv*KJ@;s-aDDpdnZ93Q+a<^
+z`j9>*rH}Wyw|@5N=h^$%`<z>~{m%qin`x{~&_)6OkZ858w2#x+NA1ID_95uwC47}=
+zz52*T_`_V+ZoXxF%76dsKew<oecZR}82QUk$J(XkqFq?rVsrM=+dI91F>*dfeUR^p
+zOs8;+{5;gLHn&=|ON(1<&R+VEKDzjZ2Kw$F(#J>m?+&_ubg5)Jru)Zfp6{oApOQYd
+zwa^ujKBNz5CFMK%pzr4xvxIHj*iUG$U^$H6v1y&(p%Guen9G_f*dx5vTC9wj2G56n
+z|5yYq@Of%s<Hq`6AI$y@fakh_U0A;Ni03elS1=yhthu+C<>UB*F_<5lxjeqIJnut3
+z$IoG`U%^;I&v~(rw(xbnjlQMNoBDNqtoebp40e+5=NOml8^f{p%x`^%M%@zTb9U92
+zey`caUXzcCKJMFfjC?Z2I$CbIXp=9ClcgtjY;nf67)H!$*JzV-%cp;I=eWXg*SM{G
+z<g|2%V~)!lp64;Nt>)excV35he&noN-o;q_P5nGz@Fe=cxFsxRdfmf(i(%wkbmVOi
+z<GmvulgFhoW*&QO%(TX~{yvYo+;Ngy9%9Bgxif~z9^;-Z_AjlDKIHhib%?RP2szXo
+zb1ZKaayY(coc$}-*dLD9FsrNkam>0$*aBw#8>@*ua-LwUy=ULlxgBeMVC(4mz?d=L
+z_l$AfL*EMCbKYVYeX+I**76U1IV`@fly#^3k7J@WwoB=3qAm}dkd@q$&?aw;nHAPY
+zkGSW%b<U`^)n{WM$234rTl(r4|H<k?-x@VGuhRF0{=)U=9sRs-S^X9J$Kr45=K*VE
+z?x@dK7_WdC|75w=hTj*&HZG^d4C4MiQTjTz(eKCSdA4$}-^NU9?0BsB7<EJRv5M<>
+zjM~z1wy>NiUh`*t=0grOa$~XBqwf(`bL{&Nv(L)Dt+i$hM%}T0Ywn2gyzFaqH+62u
+znjhFYg+6XEuIZ!mnU_qvoEF0_&M_9A1#2Vj?;)kd&10{Pnbz3W-{(;`L?3xqJ!<_u
+zq|pK5ox157qc4Ur$oM{eY<ASIP~Xx3bHlid(;DrJ#oyG=1J0<AOW0kav99wzjQAR6
+z`Y5~h4E?#wX&8>;RaY%z$lG}i?DabAc{6t3SU!%Lz54L^aXXxotd-Wsw#6;B%OjUM
+zD?;50zR?BR9J{qHINtkNk>fv?*DlXfkI5XH*VMTkYkuIY=KN6KHP49M!q(h-<VYWW
+zLC^-DH?WQ4)wtdAz7+ZEP_y$|;Kr`MgL4d5yYXXo?W<x{=lvjcT_Syye%-B&oGX~!
+zW14-9bW>S=?Dw6+?RztJJVw_s>il&!w;aSvSk0-$y1eBu-};Bt`kXMv2A<sC!l)bG
+zQ%nb~b#d{XpA~t{XF&S`wt&^23BL6loVw@AAFds+>%V`jj1%vpoYuag&vZk-^mW!o
+z{6l{K=$sQ6J4jooBdbp^vdU+vg?&!%Lto8v6gS<p*3sv%&2eF-hXQTt&W>B3NxTo|
+zJ$0?XuD>^IF^>ND-+x>CivCBKX=F=Z==0BJ%qu%s7{p9R-CoAQ)Ykbp4&p1v+l7tI
+ze2ZJmd-QdlGs;=m81zx!;LnQM`!EhYwMczD`tjIK-E-v+*Av$l%x)axyw+1Q)CIlg
+zpM1yqC=fG!(BE)O{-I56_<INY%evG32YWu48COQeJ6T1%gpnoM6RdT;#c>h(*uRR#
+zY-)Yn+8oQ(mKHZ3`i<p!4%SDH{&lEtt)tJeHuC&D>#-1P*4OgH`*7Y<*NSTlW~l?u
+z_^$TWzM?kP5H+#s8MCx~HSd@q%j9RD)x0AwhZ#4y8?Rv;{hN@pf@l0b9J7w+TUZ@E
+zj+<H^_ig0Zm>gprYP!Z|KdsSc$gk`Cn0;;JbB;C+{UXjy-E-v+*ORR^SdQ-lUL&6M
+zE`2O_=z-(-dq`>LH1C-49PDc6tVLb!*r{V7-Y|}SUhiYZIQE8p%=dqYHMKtO+pL3i
+zjmdEt=NMNo`wWHEBeo9lt#z~<?~%K5<8;=D_u;&!u9e>laJ+!s!q&m=;i;P(W_sz|
+zBlPomtc10+gk#qFF$;fAwz2;Oj7$x+MW|c2nmQKZxy4=HEn;Mob_2U$U;Kx7t2XYp
+zW90GN9LL7I568{8;kbmqa&-lc87nNd%d-|%1?#Ly-E-v+*Av(!|E7m#AN`)8pWK^1
+zntzY?IclF~1)z(S(?_E{e>U+xocGkVirDA1zqJQA=ChN3KDzOHqxR`m0J^w<*>l{g
+z?@XzCuKeM83jEu>fu366a~1CyYgpX3=-Vg7kFx^M1fQvL7@yhf*{XNl#rtsHQ`d?+
+z3Jt6x9e7RncENo8opuGF3A<;QHd_C`JU)Bso-2R2o@}k54}K5X^yq~5lcnX#pLPYH
+z5BttRos|2|Cf<khp1M}?+Cv8mSnjO#eI(A;@rPf5)IC@J>GY(v)!K>yF(3xSfEW-1
+zVn7Ut0Wly3#DEwO17bi7hygJm2E>3E5CdXB42S_SAO^&M7!U(uKn#chF(3xSfEW-1
+pVn7Ut0Wly3rpJK2`Txh?|LN;LKmWt?-@f?SH@|xR>#u*F{Rp+*(8>S+
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/tga_read_rgb_rle.tga b/tests/tga/tga_read_rgb_rle.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..ce845ad0c3da65205af25854d64568b1cf0921e3
+GIT binary patch
+literal 9987
+zcmeI2J!~9R5Xbk<L5NgWrh*l6K@rf2A`LFK334O|$EPT_a+TuJx!kjzIGiJ2I<P>x
+ziiRRbk%9(oq!dtCIspYA&6UugGcC>X|IOQdZ+$+;#>5ek&eFVnJ3DVa{%>aX?a5Je
+zF>-%5qwk}eQT$4wzvw%Lr!o5$L%T1%_;U0&GrMhYD|*=1u+QBMI7bBz5GWAXUI?5o
+z4)=h152)YuP~W$``}B?1quuDQ!tKvI-d*GdmoNVj?N0AU(FV5-mWdwpH55x49>GD6
+z=%BBmXlU4mV>@qJ8fX!<cQoubnZc3TbVtK}?@1Y0!9an5mD0dE28xA&sM>=CL?@={
+z0-|RLqE&j)8olUxtrw;AqBVNamHEBs60Ks5R&l9p6>VC@T4)u!Z+{g<yLY2MYn^Q1
+zd9ELFE4tU$u)n0?3plJ1J?v}PZ)msyr`8V<5?$KSu-0S-M?&o#4QoBb4;grXfdT`M
+zN=c*-Fi>D%n-xb5tYDzPz)HDn9RtO}K-2&bfLTDa$ReF=%5-@43+;@(Xqh_Lqg5;e
+zg}THltzs{<ie37oodrXq8PIa=9O>E>BBIs4hP5RP*Wqxy6Qz9`Y(v8pI6+HwtX$ra
+zy1k}`<+7Ep?x=h3^=RRT3_QR<fq_Rg0|yu=Ft9z}zzPNm46Kv})-g~l4EUq{0-{A0
+z@uf#ui57)+Y^yj$Kb#Ty+&-!K64#`N?AC_rx07^75BGbIkyuBfFo`X6d}cobiI>AG
+z_yH!{gxCD>ho1(boNM2tG;8-@MK-H=sqwzy_Dk<p<<Y;ghphqw-d=+40((iXvX>d}
+zeC*AO?;PyiJI7egrh5aA*tASEv0P|sHWdv;37nkl7;GWQvslElsh1w>E)mVkrK5Wr
+zvyT~j8_(=*6BF=71Iw<4W?fOstUs?=BFaQ*Da#xiBX|}K8QkJdG}zFPqlKLAcr83*
+zWg<d$C_)R@Zt(9GMk4VnKb+4e=emmuJZ@>Q+HzQdV{TOj;%(7%jzp+KJSs$|sS9Fk
+zi>8|_;%+MHn6)L%h}LxJYN%Lsjm=l2JEG}rgt!}vT81WTD?iXN22oo(>Q%FW$7$$!
+zt&?$T0IopDHZ|A}nmLfzok8W3vju;nlA35T-r~-!Mh%-@xp^A6E=V4LfMg^hw4o2J
+zZI)js`N&kV*g%#wDTZ~m<nWLi1ePizuWxAjE=soYvC=mb&tTOxu05X^q<~*Zj<9wL
+zP=$-ZWz~5>cOy6~E}sky$N;c`=y|Ej2+1ZQ2f9i4w?h@e2{8NMT~!94nB@itGuLH}
+zXVpo_fLn+Ny=`_6ub%qVxz9IOHOQr&m-w|E<2CfOb2=CaIW-6=RoY?8DbvigNhHcJ
+zG#i_20Ls>TP|sG<1T!>Hm<6C_+a^z4YoiJ>5de05QI0M6IheVSK%5>}CEC#MwBHBI
+ziIa1Wpa&iZ_r@?tJkJ5<afw}YS{54Q*|ADIR<0rq7ju0Ezq{lB$w1gObbznQZdZVC
+zC{fEsk6_CHMd|PuWL7zD?Gbil$1PB(y&Zkn_I|ZCmODo!ml!;5_YN=f8&f%XLJ69i
+zw+YreoXy~Iho>|{-W{nZBP!8&Q$t}P*I~(hRwZ6%$Lp+>-V88<W1vX?KTsG@4Mp7*
+zP43JO--G~U!gJBc0<A+dG0?19zUEwf+}?LWRX6~j_TKxg%r*$-xiTt}Yajv!vcmP)
+zqnTh(gvtWBmMHdlF_;5HXb)v)Q_z7o(;nJBIi5s&D7DGOkh+Oa-OSuJgOmf2R1I-V
+zRL&L6j_DV<hr<B?9Mn_S!{H7Uhx4N2TcLZ}5FFv{ZJA>rG8_ARaUB|->lMt--ZnEI
+zTJ7{U4;S{j2Ay9PTlySLkZpPkSyjD9xB@11Gqz?H&}bm6INZyXa|<usjtD%sjy+Z`
+zO^{AKuWKHIUn2Ss=N8*9c5f<jyF%cp-^Zcb5%Fp{gGhMmxXnNb1>}y*$KYeSt=BT^
+z9)n8f69who6DC3I4i6#*smWsw#8aACPLFDXvaYploY`rTzv^v6%`=fZ=~tM<Gx7U2
+zGVu^u%W!94&zt&L+f3G5W^S(`9GhA$F^gxQaDFP%)PFP84q_$@7HzQb60>~+#d%*t
+zf%)V_G>Dlk3}01X6V9YA0}KH#x+MuyPXYm7$4BlC*YhI}#g|)Uh0-v*i7ggcv&@^C
+zjYO%ac80KpJfmhZkwXX$pH_*;t&cQIT_(xF6ht!Iic3UdT(%7ihfT|wtXWA&V1Sf;
+zU3WEU`G(*m{rfc5Lu-SUf;0gW_gTQ5!wKEEk(Qj)=S2;}8FVa^9uYEg=U`?TJS&;e
+zZ|IGrGhpnT4H$<N0L>R>%fn7eg+%K9in1ezX3K%Y`r6i<mRK!fyE0L3T&%#2e?}WI
+zcSMQE6&v2hGddfHYR&MD28%5H1s1ZQZU%;X@Wf!oTq<&1f;-%4`%tL#0yUz{`gTy@
+x8%~Vp2_Ce5$E=Cyg!2^tf$X%_aF4$a-uv+CN7vrJ_RjTJKYsJtTUTF;{sH~|7$pDz
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
index c5aff66..5621706 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
@@ -13,7 +13,14 @@
 DEPENDS = "freetype libpng jpeg zlib tiff"
 
 SRC_URI = "git://github.com/libgd/libgd.git;branch=GD-2.2 \
-           file://fix-gcc-unused-functions.patch"
+           file://fix-gcc-unused-functions.patch \
+           file://CVE-2016-10166.patch \
+           file://CVE-2016-10167.patch \
+           file://CVE-2016-10168.patch \
+           file://.gitignore-the-new-test-case.patch \
+           file://Fix-290-TGA-RLE-decoding-is-broken.patch;apply=no \
+           file://CVE-2016-6906-1.patch;apply=no \
+           file://CVE-2016-6906-2.patch;apply=no"
 
 SRCREV = "46ceef5970bf3a847ff61d1bdde7501d66c11d0c"
 
@@ -32,6 +39,19 @@
 
 EXTRA_OEMAKE = 'LDFLAGS="${LDFLAGS}"'
 
+do_git_apply () {
+       cd ${S}
+       if [ ! -f tests/tga/tga_read_rgb.png ]; then
+               git apply ${S}/../Fix-290-TGA-RLE-decoding-is-broken.patch
+               git apply ${S}/../CVE-2016-6906-1.patch
+               git apply ${S}/../CVE-2016-6906-2.patch
+       fi
+}
+
+do_patch_append() {
+    bb.build.exec_func('do_git_apply', d)
+}
+
 do_install_append() {
     # cleanup buildpaths from gdlib.pc
     sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/gdlib.pc
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb
similarity index 62%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb
index da82599..0e85b3f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb
@@ -5,17 +5,17 @@
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df"
 
-SRC_URI = "https://github.com/gflags/gflags/archive/v${PV}.tar.gz"
-SRC_URI[md5sum] = "ac432de923f9de1e9780b5254884599f"
-SRC_URI[sha256sum] = "d8331bd0f7367c8afd5fcb5f5e85e96868a00fd24b7276fa5fcee1e5575c2662"
-S = "${WORKDIR}/${PN}-${PV}/"
+SRC_URI = "git://github.com/gflags/gflags.git"
+SRCREV = "f8a0efe03aa69b3336d8e228b37d4ccb17324b88"
+
+S = "${WORKDIR}/git"
 
 FILES_${PN}-dev += "${libdir}/cmake"
 
 inherit cmake
 
-EXTRA_OECMAKE="-DBUILD_SHARED_LIBS=ON"
+EXTRA_OECMAKE="-DBUILD_SHARED_LIBS=ON -DREGISTER_INSTALL_PREFIX=OFF -DLIB_INSTALL_DIR=${baselib}"
 
 PACKAGES =+ "${PN}-bash-completion"
 FILES_${PN}-bash-completion += "${bindir}/gflags_completions.sh"
-RDEPENDS_${PN}-bash-completion = "bash-completion"
+RDEPENDS_${PN}-bash-completion = "bash bash-completion"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
index 5b2ed49..c7c7ae8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
@@ -12,8 +12,11 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=e4cf3810f33a067ea7ccd2cd889fed21"
 SRCREV = "b6b3ed1fa4c6de12908a9f01d1689f156c3cd441"
+PV = "0.1.496+git${SRCPV}"
+
 SRC_URI = "git://git.sv.gnu.org/gnulib;protocol=git \
 "
+
 S = "${WORKDIR}/git"
 
 do_install () {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
new file mode 100644
index 0000000..27f855d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
@@ -0,0 +1,28 @@
+Subject: Fix build failure for ppc
+
+Upstream-Status: Pending
+
+Fix the following build failure.
+
+  error: 'siginfo_t' does not name a type
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/stacktrace_powerpc-linux-inl.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
+index 5d16fa1..a9bf775 100644
+--- a/src/stacktrace_powerpc-linux-inl.h
++++ b/src/stacktrace_powerpc-linux-inl.h
+@@ -44,6 +44,7 @@
+ 
+ #include <stdint.h>   // for uintptr_t
+ #include <stdlib.h>   // for NULL
++#include <signal.h>   // for siginfo_t
+ #include <gperftools/stacktrace.h>
+ #include <base/vdso_support.h>
+ 
+-- 
+2.8.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
new file mode 100644
index 0000000..e582c0d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
@@ -0,0 +1,33 @@
+From ea9f64eb2cdf3be6c4dc65fa1472d854616e43ca Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 13:38:46 -0800
+Subject: [PATCH] Support Atomic ops on clang
+
+clang pretends to be gcc 4.2 which is a lie
+it actually supports a lot more features then
+gcc 4.2, here it depends on gcc 4.7 to enable
+the atomics and fails for clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/base/atomicops.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/base/atomicops.h b/src/base/atomicops.h
+index be038f3..f1a21ff 100644
+--- a/src/base/atomicops.h
++++ b/src/base/atomicops.h
+@@ -118,7 +118,7 @@
+ #include "base/atomicops-internals-linuxppc.h"
+ #elif defined(__GNUC__) && defined(__mips__)
+ #include "base/atomicops-internals-mips.h"
+-#elif defined(__GNUC__) && GCC_VERSION >= 40700
++#elif defined(__GNUC__) && GCC_VERSION >= 40700 || defined(__clang__)
+ #include "base/atomicops-internals-gcc.h"
+ #else
+ #error You need to implement atomic operations for this architecture
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch
new file mode 100644
index 0000000..5bd0b6f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch
@@ -0,0 +1,36 @@
+From 12ac0dc6742e1bcdfaf1842186c9002f0820a5e8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Jul 2017 13:21:21 -0700
+Subject: [PATCH] Use ucontext_t instead of struct ucontext
+
+Newer glibc has dropped the ucontext tag from exposing
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/stacktrace_powerpc-linux-inl.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
+index a9bf775..47ff2d7 100644
+--- a/src/stacktrace_powerpc-linux-inl.h
++++ b/src/stacktrace_powerpc-linux-inl.h
+@@ -53,7 +53,6 @@
+ #elif defined(HAVE_UCONTEXT_H)
+ #include <ucontext.h>  // for ucontext_t
+ #endif
+-typedef ucontext ucontext_t;
+ 
+ // PowerPC64 Little Endian follows BE wrt. backchain, condition register,
+ // and LR save area, so no need to adjust the reading struct.
+@@ -202,7 +201,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
+         struct rt_signal_frame_32 {
+           char dummy[64 + 16];
+           siginfo_t info;
+-          struct ucontext uc;
++          ucontext_t uc;
+           // We don't care about the rest, since IP value is at 'uc' field.A
+         } *sigframe = reinterpret_cast<rt_signal_frame_32*>(current);
+         result[n] = (void*) sigframe->uc.uc_mcontext.uc_regs->gregs[PT_NIP];
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
index 2e4479c..43780a5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
@@ -4,7 +4,11 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
 DEPENDS = "libunwind"
 
-SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz \
+           file://0001-Support-Atomic-ops-on-clang.patch \
+           file://0001-Fix-build-failure-for-ppc.patch \
+           file://0001-Use-ucontext_t-instead-of-struct-ucontext.patch \
+           "
 
 SRC_URI[md5sum] = "aa1eaf95dbe2c9828d0bd3a00f770f50"
 SRC_URI[sha256sum] = "6fa2748f1acdf44d750253e160cf6e2e72571329b42e563b455bde09e9e85173"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
deleted file mode 100644
index e43bdcb..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Upstream-Status: pending
-
---- gpm-1.99.7.orig/src/daemon/open_console.c	2008-07-24 12:33:05.000000000 +0200
-+++ gpm-1.99.7/src/daemon/open_console.c	2013-01-10 12:39:47.975461947 +0100
-@@ -23,6 +23,7 @@
- #include <fcntl.h>              /* open and co.  */
- #include <sys/stat.h>           /* stat() */
- #include <sys/ioctl.h>          /* ioctl() */
-+#include <sys/types.h>          /* major() */
- 
- /* Linux specific (to be outsourced in gpm2 */
- #include <linux/serial.h>       /* for serial console check */
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
deleted file mode 100644
index d2d6cb8..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
+++ /dev/null
@@ -1,326 +0,0 @@
-Remove nested functions, they are not available in all compilers
-e.g. clang will not support them.
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: gpm-1.99.7/src/drivers/summa/i.c
-===================================================================
---- gpm-1.99.7.orig/src/drivers/summa/i.c
-+++ gpm-1.99.7/src/drivers/summa/i.c
-@@ -36,6 +36,28 @@ extern int summamaxy;
- 
- extern signed char summaid;
- 
-+static void resetsumma(int fd)
-+{
-+   write(fd, 0, 1);          /* Reset */
-+   usleep(400000);           /* wait */
-+}
-+
-+static int waitsumma(int fd)
-+{
-+   struct timeval timeout;
-+
-+   fd_set readfds;
-+
-+   int err;
-+
-+   FD_ZERO(&readfds);
-+   FD_SET(fd, &readfds);
-+   timeout.tv_sec = 0;
-+   timeout.tv_usec = 200000;
-+   err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
-+   return (err);
-+}
-+
- Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
-                   char **argv)
- {
-@@ -43,24 +65,6 @@ Gpm_Type *I_summa(int fd, unsigned short
-    flags = argc = 0;            /* FIXME: 1.99.13 */
-    argv = NULL;
- 
--   void resetsumma() {
--      write(fd, 0, 1);          /* Reset */
--      usleep(400000);           /* wait */
--   }
--   int waitsumma() {
--      struct timeval timeout;
--
--      fd_set readfds;
--
--      int err;
--
--      FD_ZERO(&readfds);
--      FD_SET(fd, &readfds);
--      timeout.tv_sec = 0;
--      timeout.tv_usec = 200000;
--      err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
--      return (err);
--   }
-    int err;
- 
-    char buffer[255];
-@@ -91,7 +95,7 @@ Gpm_Type *I_summa(int fd, unsigned short
-     */
-    setspeed(fd, 1200, 9600, 1,
-             B9600 | CS8 | CREAD | CLOCAL | HUPCL | PARENB | PARODD);
--   resetsumma();
-+   resetsumma(fd);
- 
-    write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
- 
-@@ -103,7 +107,7 @@ Gpm_Type *I_summa(int fd, unsigned short
-        * read the Summa Firm-ID 
-        */
-       write(fd, SS_FIRMID, strlen(SS_FIRMID));
--      err = waitsumma();
-+      err = waitsumma(fd);
-       if(!((err == -1) || (!err))) {
-          summaid = 10;          /* Original Summagraphics */
-          read(fd, buffer, 255); /* Read Firm-ID */
-@@ -111,14 +115,14 @@ Gpm_Type *I_summa(int fd, unsigned short
-    }
- 
-    if(summaid < 0) {            /* Genius-test */
--      resetsumma();
-+      resetsumma(fd);
-       write(fd, GEN_MMSERIES, 1);
-       write(fd, &GEN_MODELL, 1);        /* Read modell */
--      err = waitsumma();
-+      err = waitsumma(fd);
-       if(!((err == -1) || (!err))) {    /* read Genius-ID */
--         err = waitsumma();
-+         err = waitsumma(fd);
-          if(!((err == -1) || (!err))) {
--            err = waitsumma();
-+            err = waitsumma(fd);
-             if(!((err == -1) || (!err))) {
-                read(fd, &config, 1);
-                summaid = (config[0] & 224) >> 5;        /* genius tablet-id
-@@ -135,14 +139,14 @@ Gpm_Type *I_summa(int fd, unsigned short
-     * unknown tablet ?
-     */
-    if((summaid < 0) || (summaid == 11)) {
--      resetsumma();
-+      resetsumma(fd);
-       write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3);
-    }
- 
-    /*
-     * read tablet size 
-     */
--   err = waitsumma();
-+   err = waitsumma(fd);
-    if(!((err == -1) || (!err)))
-       read(fd, buffer, sizeof(buffer));
-    write(fd, SS_READCONFIG, 1);
-Index: gpm-1.99.7/src/drivers/wacom/i.c
-===================================================================
---- gpm-1.99.7.orig/src/drivers/wacom/i.c
-+++ gpm-1.99.7/src/drivers/wacom/i.c
-@@ -30,10 +30,6 @@
- #include "message.h"            /* gpm_report */
- #include "wacom.h"              /* wacom */
- 
--Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
--                  char **argv)
--{
--
- /* wacom graphire tablet */
- #define UD_RESETBAUD     "\r$"  /* reset baud rate to default (wacom V) */
-    /*
-@@ -45,83 +41,91 @@ Gpm_Type *I_wacom(int fd, unsigned short
- #define UD_COORD         "~C\r" /* Request max coordinates */
- #define UD_STOP          "\nSP\r"       /* stop sending coordinates */
- 
--   flags = 0;                   /* FIXME: 1.99.13 */
- 
--   void reset_wacom() {
--      /*
--       * Init Wacom communication; this is modified from xf86Wacom.so module 
--       */
--      /*
--       * Set speed to 19200 
--       */
--      setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
--      /*
--       * Send Reset Baudrate Command 
--       */
--      write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
--      usleep(250000);
--      /*
--       * Send Reset Command 
--       */
--      write(fd, UD_RESET, strlen(UD_RESET));
--      usleep(75000);
--      /*
--       * Set speed to 9600bps 
--       */
--      setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
--      /*
--       * Send Reset Command 
--       */
--      write(fd, UD_RESET, strlen(UD_RESET));
--      usleep(250000);
--      write(fd, UD_STOP, strlen(UD_STOP));
--      usleep(100000);
--   }
-+static void reset_wacom(int fd)
-+{
-+   /*
-+    * Init Wacom communication; this is modified from xf86Wacom.so module 
-+    */
-+   /*
-+    * Set speed to 19200 
-+    */
-+   setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
-+   /*
-+    * Send Reset Baudrate Command 
-+    */
-+   write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
-+   usleep(250000);
-+   /*
-+    * Send Reset Command 
-+    */
-+   write(fd, UD_RESET, strlen(UD_RESET));
-+   usleep(75000);
-+   /*
-+    * Set speed to 9600bps 
-+    */
-+   setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
-+   /*
-+    * Send Reset Command 
-+    */
-+   write(fd, UD_RESET, strlen(UD_RESET));
-+   usleep(250000);
-+   write(fd, UD_STOP, strlen(UD_STOP));
-+   usleep(100000);
-+}
- 
--   int wait_wacom() {
--      /*
--       *  Wait up to 200 ms for Data from Tablet.
--       *  Do not read that data.
--       *  Give back 0 on timeout condition, -1 on error and 1 for DataPresent
--       */
--      struct timeval timeout;
--
--      fd_set readfds;
--
--      int err;
--
--      FD_ZERO(&readfds);
--      FD_SET(fd, &readfds);
--      timeout.tv_sec = 0;
--      timeout.tv_usec = 200000;
--      err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
--      return ((err > 0) ? 1 : err);
--   }
-+static int wait_wacom(int fd)
-+{
-+   /*
-+    *  Wait up to 200 ms for Data from Tablet.
-+    *  Do not read that data.
-+    *  Give back 0 on timeout condition, -1 on error and 1 for DataPresent
-+    */
-+   struct timeval timeout;
- 
--   char buffer[50], *p;
-+   fd_set readfds;
- 
--   int RequestData(char *cmd) {
--      int err;
-+   int err;
- 
--      /*
--       * Send cmd if not null, and get back answer from tablet.
--       * Get Data to buffer until full or timeout.
--       * Give back 0 for timeout and !0 for buffer full
--       */
--      if(cmd)
--         write(fd, cmd, strlen(cmd));
--      memset(buffer, 0, sizeof(buffer));
--      p = buffer;
--      err = wait_wacom();
--      while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
--         p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
--         err = wait_wacom();
--      }
--      /*
--       * return 1 for buffer full 
--       */
--      return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
-+   FD_ZERO(&readfds);
-+   FD_SET(fd, &readfds);
-+   timeout.tv_sec = 0;
-+   timeout.tv_usec = 200000;
-+   err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
-+   return ((err > 0) ? 1 : err);
-+}
-+
-+static int RequestData(int fd, char *cmd, char *buffer)
-+{
-+   int err;
-+   char *p;
-+   /*
-+    * Send cmd if not null, and get back answer from tablet.
-+    * Get Data to buffer until full or timeout.
-+    * Give back 0 for timeout and !0 for buffer full
-+    */
-+   if(cmd)
-+      write(fd, cmd, strlen(cmd));
-+   memset(buffer, 0, sizeof(buffer));
-+   p = buffer;
-+   err = wait_wacom(fd);
-+   while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
-+      p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
-+      err = wait_wacom(fd);
-    }
-+   /*
-+    * return 1 for buffer full 
-+    */
-+   return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
-+}
-+
-+Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
-+                  char **argv)
-+{
-+
-+   flags = 0;                   /* FIXME: 1.99.13 */
-+
-+   char buffer[50];
- 
-    /*
-     * We do both modes, relative and absolute, with the same function.
-@@ -143,17 +147,17 @@ Gpm_Type *I_wacom(int fd, unsigned short
-    };
-    parse_argv(optioninfo, argc, argv);
-    type->absolute = WacomAbsoluteWanted;
--   reset_wacom();
-+   reset_wacom(fd);
- 
-    /*
-     * "Flush" input queque 
-     */
--   while(RequestData(NULL)) ;
-+   while(RequestData(fd, NULL, buffer)) ;
- 
-    /*
-     * read WACOM-ID 
-     */
--   RequestData(UD_FIRMID);
-+   RequestData(fd, UD_FIRMID, buffer);
- 
-    /*
-     * Search for matching modell 
-@@ -180,7 +184,7 @@ Gpm_Type *I_wacom(int fd, unsigned short
-     * read Wacom max size 
-     */
-    if(WacomModell != (-1) && (!wcmodell[WacomModell].maxX)) {
--      RequestData(UD_COORD);
-+      RequestData(fd, UD_COORD, buffer);
-       sscanf(buffer + 2, "%d,%d", &wmaxx, &wmaxy);
-       wmaxx = (wmaxx - wcmodell[WacomModell].border);
-       wmaxy = (wmaxy - wcmodell[WacomModell].border);
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in
new file mode 100644
index 0000000..ee6c040
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Virtual console mouse server
+
+[Service]
+Type=forking
+ExecStart=@bindir@/gpm -m /dev/input/mice -t imps2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/init b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/init
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/init
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/init
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch
similarity index 93%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch
index f10217a..3faef84 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch
@@ -11,7 +11,7 @@
  # user-overridable flags, but it's also all the implicit rule looks at.
  # missing ?
  
--SUBDIRS = src doc contrib gpm2
+-SUBDIRS = src doc contrib
 +SUBDIRS = src
  
  
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/processcreds.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/processcreds.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
deleted file mode 100644
index bbb8c28..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
-for the console and xterm, with sample clients included \
-(emacs, etc)."
-SECTION = "console/utils"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://gpm2/core/main.c;endline=19;md5=66d3c205c4e7ee5704b2ee351dfed72f"
-
-PR = "r2"
-
-DEPENDS = "ncurses"
-
-SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
-           file://no-docs.patch \
-           file://processcreds.patch \
-           file://eglibc-2.17.patch \
-           file://remove_nested_functions.patch \
-           file://init"
-
-inherit autotools-brokensep update-rc.d
-
-INITSCRIPT_NAME = "gpm"
-INITSCRIPT_PARAMS = "defaults"
-
-#export LIBS = "-lm"
-
-# all fields are /* FIXME: gpm 1.99.13 */
-# gpm-1.99.7/src/lib/libhigh.c:171:43: error: parameter 'clientdata' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/lib/report-lib.c:28:21: error: parameter 'line' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/lib/report-lib.c:28:33: error: parameter 'file' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/empty/i.c:26:23: error: parameter 'fd' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/empty/i.c:26:42: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/etouch/i.c:34:43: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/msc/r.c:32:12: error: variable 'dy' set but not used [-Werror=unused-but-set-variable]
-# gpm-1.99.7/src/drivers/msc/r.c:32:8: error: variable 'dx' set but not used [-Werror=unused-but-set-variable]
-# cc1: all warnings being treated as errors
-CFLAGS += "-Wno-extra -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable"
-
-# twiddler is WIP in 1.99.7 and probably not worth fixing (a lot of changes in gpm-2-dev after 1.99.7
-# gpm-1.99.7/src/drivers/twid/twiddler.c:503:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
-# /gpm-1.99.7/src/mice.c:221:5: error: (near initialization for 'mice[32].init') [-Werror]
-CFLAGS += "-Wno-error=int-to-pointer-cast -Wno-error"
-
-do_install () {
-    oe_runmake 'DESTDIR=${D}' install
-    install -m 0644 src/headers/gpm.h ${D}${includedir}
-    install -d ${D}/${sysconfdir}/init.d
-    install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
-    cd ${D}${libdir} && ln -sf libgpm.so.1.19.0 libgpm.so.1
-}
-SRC_URI[md5sum] = "9fdddf5f53cb11d40bb2bb671d3ac544"
-SRC_URI[sha256sum] = "6071378b24494e36ca3ef6377606e7e565040413c86704753a162d2180af32ee"
-
-FILES_${PN} += "${datadir}/emacs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb
new file mode 100644
index 0000000..69f12d9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb
@@ -0,0 +1,45 @@
+DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
+for the console and xterm, with sample clients included \
+(emacs, etc)."
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+PV = "1.99.7+git${SRCREV}"
+PR = "r2"
+SRCREV = "1fd19417b8a4dd9945347e98dfa97e4cfd798d77"
+
+DEPENDS = "ncurses"
+
+SRC_URI = "git://github.com/telmich/gpm;protocol=git \
+           file://no-docs.patch \
+           file://processcreds.patch \
+           file://gpm.service.in \
+           file://init"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep update-rc.d systemd
+
+INITSCRIPT_NAME = "gpm"
+INITSCRIPT_PARAMS = "defaults"
+
+do_configure_prepend() {
+    (cd ${S};./autogen.sh;cd -)
+}
+
+do_install_append () {
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_system_unitdir}
+        sed 's:@bindir@:${bindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
+    fi
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+        install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
+    fi
+    install -D -m 0644 ${S}/src/headers/gpm.h ${D}${includedir}/gpm.h
+    ln -s libgpm.so.2 ${D}${libdir}/libgpm.so
+}
+
+SYSTEMD_SERVICE_${PN} = "gpm.service"
+
+FILES_${PN} += "${datadir}/emacs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb
deleted file mode 100644
index 9e6f774..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "A spell checker and morphological analyzer library"
-HOMEPAGE = "http://hunspell.sourceforge.net/"
-LICENSE = "LGPLv2.1 | GPLv2 | MPLv1.1"
-LIC_FILES_CHKSUM = " \
-    file://COPYING;md5=ed3a37b3ba6d6be3e08ab45987cf1b88 \
-    file://COPYING.LGPL;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
-    file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
-"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/Hunspell/${PV}/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "4967da60b23413604c9e563beacc63b4"
-SRC_URI[sha256sum] = "a7b2c0de0e2ce17426821dc1ac8eb115029959b3ada9d80a81739fa19373246c"
-
-inherit autotools pkgconfig gettext
-
-RDEPENDS_${PN} = "perl"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb
new file mode 100644
index 0000000..125729f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "A spell checker and morphological analyzer library"
+HOMEPAGE = "http://hunspell.github.io/"
+LICENSE = "GPLv3 | LGPLv3"
+LIC_FILES_CHKSUM = " \
+    file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/archive/v${PV}.tar.gz"
+SRC_URI[md5sum] = "0df1c18c1284f8625af5ae5a8d5c4cef"
+SRC_URI[sha256sum] = "30f593733c50b794016bb03d31fd2a2071e4610c6fa4708e33edad2335102c49"
+
+inherit autotools pkgconfig gettext
+
+RDEPENDS_${PN} = "perl"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
index f1276f9..3dc22c5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
@@ -9,7 +9,7 @@
 PR = "r1"
 
 # http://errors.yoctoproject.org/Errors/Details/25825/
-PNBLACKLIST[iksemel] ?= "Not compatible with gnutls version 3.4 currently in oe-core"
+PNBLACKLIST[iksemel] ?= "Not compatible with gnutls version 3.4 currently in oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://iksemel.googlecode.com/files/${BP}.tar.gz;name=archive \
            file://r25.diff"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
index cfaa7c3..960cb00 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
@@ -23,7 +23,7 @@
 EXTRA_OECONF = "--program-prefix= --program-suffix=.im7 --without-perl --disable-openmp --without-xml --disable-opencl"
 
 CACHED_CONFIGUREVARS = "ac_cv_sys_file_offset_bits=yes"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[graphviz] = "--with-gvc,--without-gvc,graphviz"
 PACKAGECONFIG[jp2] = "--with-jp2,,jasper"
 PACKAGECONFIG[lzma] = "--with-lzma,--without-lzma,xz"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb
new file mode 100644
index 0000000..9f73d27
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for IPMI control"
+DESCRIPTION = "This package contains a utility for interfacing with devices that support \
+the Intelligent Platform Management Interface specification. IPMI is \
+an open standard for machine health, inventory, and remote power control. \
+\
+This utility can communicate with IPMI-enabled devices through either a \
+kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in \
+the IPMI specification. IPMIv2 adds support for encrypted LAN \
+communications and remote Serial-over-LAN functionality. \
+\
+It provides commands for reading the Sensor Data Repository (SDR) and \
+displaying sensor values, displaying the contents of the System Event \
+Log (SEL), printing Field Replaceable Unit (FRU) information, reading and \
+setting LAN configuration, and chassis power control. \
+"
+
+HOMEPAGE = "http://ipmitool.sourceforge.net/"
+SECTION = "kernel/userland"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184"
+
+DEPENDS = "openssl readline ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ipmitool/ipmitool-${PV}.tar.bz2"
+SRC_URI[md5sum] = "bab7ea104c7b85529c3ef65c54427aa3"
+SRC_URI[sha256sum] = "0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01"
+
+inherit autotools
+
+# --disable-dependency-tracking speeds up the build
+# --enable-file-security adds some security checks
+# --disable-intf-free disables FreeIPMI support - we don't want to depend on
+#   FreeIPMI libraries, FreeIPMI has its own ipmitoool-like utility.
+#
+EXTRA_OECONF = "--disable-dependency-tracking --enable-file-security --disable-intf-free"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
index bdb3d47..ee0766e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
@@ -15,6 +15,8 @@
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=5f9372493401f309e6149dd2ce0a044b"
 
+DEPENDS += "openssl"
+
 PARALLEL_MAKE = ""
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/ipmiutil/ipmiutil-${PV}.tar.gz \
@@ -26,7 +28,7 @@
 inherit autotools-brokensep pkgconfig systemd
 
 PACKAGECONFIG ?= "lanplus gpl"
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--enable-systemd=${datadir}/${BPN}, --enable-systemd=no"
 PACKAGECONFIG[sha256] = "--enable-sha256, --enable-sha256=no, openssl-native, openssl"
 PACKAGECONFIG[lanplus] = "--enable-lanplus, --enable-lanplus=no, openssl-native, openssl"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
index 114bd84..2f9ac33 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
@@ -23,6 +23,5 @@
 
 do_install() {
     oe_runmake install PREFIX=${D}
-    sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/*
 }
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch
new file mode 100644
index 0000000..8c867ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch
@@ -0,0 +1,41 @@
+From 75c1d3b8667328d874590a5321eb244256b7d932 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Wed, 18 Jan 2017 07:35:58 +0000
+Subject: [PATCH] Makefile.am: add CFLAGS and LDFLAGS definiton
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* When build libatasmart, we need first build strpool in host
+  env. To build strpool, the compiler is host compiler, but
+  the CFLAGS and LDFLAGS are for cross-compiler, so unify them
+  to fix below error.
+  | make -C strpool strpool
+  | make[1]: Entering directory '../libatasmart/0.19-r0/build/strpool'
+  | gcc  -DHAVE_CONFIG_H -I. -I../../git/strpool -I..    -isystem../build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -O2 -pipe -g -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -c -o strpool.o `test -f '../strpool.c' || echo '../../git/strpool/'`../strpool.c
+  | gcc: error: unrecognized command line option ‘-fstack-protector-strong’
+  | make[1]: *** [Makefile:404: strpool.o] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ strpool/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/strpool/Makefile.am b/strpool/Makefile.am
+index b041cea..013fcd3 100644
+--- a/strpool/Makefile.am
++++ b/strpool/Makefile.am
+@@ -17,6 +17,8 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ CC = @CC_FOR_BUILD@
++CFLAGS = @BUILD_CFLAGS@
++LDFLAGS = @BUILD_LDFLAGS@
+ AM_CFLAGS = @BUILD_CFLAGS@
+ AM_LDFLAGS = @BUILD_LDFLAGS@
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
index 16657b4..4cfb732 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
@@ -5,7 +5,9 @@
 DEPENDS = "udev"
 
 SRCREV = "de6258940960443038b4c1651dfda3620075e870"
-SRC_URI = "git://git.0pointer.de/libatasmart.git"
+SRC_URI = "git://git.0pointer.de/libatasmart.git \
+           file://0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch \
+"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
index f473775..72c93ab 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
@@ -22,9 +22,8 @@
     --disable-lynx \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES','alsa','alsa','',d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES','pulseaudio','pulseaudio','',d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES','x11','gtk gtk3','',d)} \
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk gtk3', '', d)} \
 "
 PACKAGECONFIG[alsa] = "--enable-alsa, --disable-alsa, alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse, --disable-pulse, pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
index ec869c4..8d2c505 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
@@ -5,4 +5,4 @@
 SRC_URI[sha256sum] = "4ab9944398ce769c0deeb64d2f73555c67bc25ccd2ade1ccf552226c7b2acf72"
 
 # libdbi-drivers-0.8.3-1/drivers/mysql/dbd_mysql.c:232:5: error: conflicting types for 'dbd_goto_row'
-PNBLACKLIST[libdbi-drivers] ?= "BROKEN: fails to build with gcc-5"
+PNBLACKLIST[libdbi-drivers] ?= "BROKEN: fails to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
index 1091bb0..5cadf16 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
@@ -9,7 +9,7 @@
 PR = "r1"
 
 # http://errors.yoctoproject.org/Errors/Details/25823/
-PNBLACKLIST[libetpan] ?= "Not compatible with gnutls version 3.4 currently in oe-core"
+PNBLACKLIST[libetpan] ?= "Not compatible with gnutls version 3.4 currently in oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/libetpan/libetpan-${PV}.tar.gz \
            file://libetpan-autoreconf.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
index 5eee0db..199e5a8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
@@ -24,7 +24,7 @@
 
 inherit cmake binconfig pkgconfig
 
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
 
 FILES_${PN}-dev += "${libdir}/cmake"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb
similarity index 90%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb
index 092a674..8f580f9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb
@@ -6,7 +6,7 @@
 DEPENDS = "curl openssl zlib libssh2"
 
 SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.24"
-SRCREV = "211e117a0590583a720c53172406f34186c543bd"
+SRCREV = "4cf1ec7cff28da8838a2f0a9fb330e312ea3f963"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb
new file mode 100644
index 0000000..d66ac58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Library for interfacing with IIO devices"
+HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"
+
+SRCREV = "08f947d5e40600259bb698c3b95538e9f2bfecc2"
+PV = "0.8+git${SRCPV}"
+
+SRC_URI = "git://github.com/analogdevicesinc/libiio.git"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "flex-native bison-native avahi libaio libusb1 libxml2"
+
+inherit cmake pythonnative
+
+PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-python"
+
+RDEPENDS_${PN}-python = "${PN} python-ctypes python-stringold"
+
+FILES_${PN}-iiod = "${sbindir}/iiod"
+FILES_${PN}-tests = "${bindir}"
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch
new file mode 100644
index 0000000..a02bbd4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch
@@ -0,0 +1,49 @@
+From: jose.bollo@iot.bzh
+Date: Thu, 4 May 2017 21:47:38 +0200
+Subject: [PATCH] Check response existence on upgrade
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a connection upgrade is requested and when the
+request sent an error reply, the response is most of
+the time already sent when the test on
+connection->response->upgrade_handler is made, leading
+to dereferencing NULL.
+
+Two possibilities exist:
+
+  NULL == connection->response || NULL == connection->response->upgrade_handler
+
+or
+
+  NULL != connection->response && NULL == connection->response->upgrade_handler
+
+The first is prefered because it is probably safer to close the connection
+in that case.
+
+Upstream-Status: Accepted [https://gnunet.org/git/libmicrohttpd.git/commit/?id=b4216c60fdb5b48f6cfec416301fc63a1167e6cd]
+
+Change-Id: Ie6e7fc165f7fe3635ade0952bb34a0b937d38716
+Signed-off-by: José Bollo <jobol@nonadev.net>
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ src/microhttpd/connection.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
+index a495524..d39c110 100644
+--- a/src/microhttpd/connection.c
++++ b/src/microhttpd/connection.c
+@@ -882,7 +882,7 @@ keepalive_possible (struct MHD_Connection *connection)
+ #ifdef UPGRADE_SUPPORT
+     if ( (MHD_str_equal_caseless_ (end,
+                                    "upgrade")) &&
+-         (NULL == connection->response->upgrade_handler) )
++         (NULL == connection->response || NULL == connection->response->upgrade_handler) )
+       return MHD_NO;
+ #endif /* UPGRADE_SUPPORT */
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb
similarity index 66%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb
index 421b78e..45f2460 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb
@@ -6,16 +6,19 @@
 DEPENDS = "libgcrypt gnutls file"
 
 SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "4a3f793d59f663a2b0fc62d44668fb66"
-SRC_URI[sha256sum] = "d1b6385068abded29b6470e383287aa7705de05ae3c08ad0bf5747ac4dc6ebd7"
+SRC_URI[md5sum] = "5a425e993a0f5295aecb5d6607a1c242"
+SRC_URI[sha256sum] = "9b15ec2d381f44936323adfd4f989fa35add517cccbbfa581896b02a393c2cc4"
 
-inherit autotools lib_package pkgconfig
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+SRC_URI += " file://Check-response-existence-on-upgrade.patch"
+
+inherit autotools lib_package pkgconfig gettext
 
 EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
 
 PACKAGECONFIG ?= "curl"
 PACKAGECONFIG_append_class-target = "\
-        ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+        ${@bb.utils.filter('DISTRO_FEATURES', 'largefile', d)} \
 "
 PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
 PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch
new file mode 100644
index 0000000..a43b4b1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch
@@ -0,0 +1,28 @@
+From f1b9992caf9910f9f7afae401045e42572cc84ff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Apr 2017 08:50:35 -0700
+Subject: [PATCH] signal.c: SIGCLD and SIGCHILD are same on sytem V systems
+
+Musl drops the SIGCLD legacy
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ nih/signal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nih/signal.c b/nih/signal.c
+index a241df9..691c8e6 100644
+--- a/nih/signal.c
++++ b/nih/signal.c
+@@ -87,7 +87,7 @@ static const SignalName signal_names[] = {
+ 	{ SIGSTKFLT, "STKFLT" },
+ #endif
+ 	{ SIGCHLD,   "CHLD"   },
+-	{ SIGCLD,    "CLD"    },
++	{ SIGCHLD,    "CLD"   },
+ 	{ SIGCONT,   "CONT"   },
+ 	{ SIGSTOP,   "STOP"   },
+ 	{ SIGTSTP,   "TSTP"   },
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
index 40aa896..02fe805 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
@@ -23,8 +23,9 @@
 DEPENDS_class-native = "dbus-native"
 
 SRC_URI = "https://launchpad.net/${BPN}/1.0/${PV}/+download/${BP}.tar.gz \
-    file://libnih_1.0.3-4ubuntu16.patch \
-"
+           file://libnih_1.0.3-4ubuntu16.patch \
+           file://0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch \
+           "
 
 SRC_URI[md5sum] = "db7990ce55e01daffe19006524a1ccb0"
 SRC_URI[sha256sum] = "897572df7565c0a90a81532671e23c63f99b4efde2eecbbf11e7857fbc61f405"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch
new file mode 100644
index 0000000..05d3bf6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch
@@ -0,0 +1,20 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -51,7 +51,7 @@ noinst_PROGRAMS = test-oop
+ 
+ test_oop_SOURCES = test-oop.c
+ test_oop_CFLAGS = $(GLIB2_CFLAGS) $(GLIB_INCLUDES) $(TCL_INCLUDES) $(WWW_INCLUDES)
+-test_oop_LDADD = $(lib_LTLIBRARIES)
++test_oop_LDADD = $(lib_LTLIBRARIES) $(GLIB2_LIBS) $(ADNS_LIBS) $(TCL_LIBS) $(READLINE_LIBS)
+ 
+ release: dist
+ 	gzip -dc $(PACKAGE)-$(VERSION).tar.gz | bzip2 -9 \
+--- a/liboop-glib2.pc.in
++++ b/liboop-glib2.pc.in
+@@ -7,5 +7,5 @@ Name: liboop-glib2
+ Description: Event loop management library (GLIB2 support)
+ Version: @VERSION@
+ Requires: liboop = @VERSION@ glib-2.0
+-Libs: -L${libdir} -loop-glib2
++Libs: -L${libdir} -loop-glib2 @GLIB2_LIBS@
+ Cflags: -D_REENTRANT -I${includedir}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch
new file mode 100644
index 0000000..0a02420
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch
@@ -0,0 +1,11 @@
+--- a/test-oop.c
++++ b/test-oop.c
+@@ -180,7 +180,7 @@ static void *stop_readline(oop_source *s
+ static void add_readline(oop_source *src) {
+ 	rl_callback_handler_install(
+ 		(char *) "> ", /* readline isn't const-correct */
+-		(VFunction *) on_readline);
++		(rl_vcpfunc_t *) on_readline);
+ 	oop_readline_register(src);
+ 	src->on_signal(src,SIGQUIT,stop_readline,NULL);
+ }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch
new file mode 100644
index 0000000..1880a24
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch
@@ -0,0 +1,40 @@
+From: Ian Jackson <ijackson@chiark.greenend.org.uk>
+Applied-Upstream: no
+Bug-Debian: http://bugs.debian.org/579604
+Subject: oop-read.h bugfixes
+
+Some years ago I contributed a feature for reading lines and records
+to liboop: oop-read.h and read.c.  Since it took a while for that
+feature to make it into distributed versions, for a long time I've
+been using my own copy of the source file.  It seems that I fixed a
+couple of bugs in my copy which are still in the Debian package.  I
+can't find any record of me having told anyone about them and now I
+find that 1.0-6 still has the bugs.
+
+There are two fixes:
+ * Initialise "rd->discard" properly
+ * Avoid rd->neednotcheck becoming negative
+
+--- a/read.c
++++ b/read.c
+@@ -114,6 +114,7 @@ oop_read *oop_rd_new(oop_source *oop, oo
+   rd->allocbuf= 0;
+   rd->used= 0;
+   rd->alloc= buf ? bufsz : 0;
++  rd->discard= 0;
+   rd->neednotcheck= 0;
+   rd->displacedchar= -1;
+   rd->style= *OOP_RD_STYLE_IMMED;
+@@ -235,7 +236,11 @@ static void *on_process(oop_source *oop,
+   
+   if (rd->discard) {
+     rd->used -= rd->discard;
+-    rd->neednotcheck -= rd->discard;
++    if (rd->neednotcheck > rd->discard) {
++      rd->neednotcheck -= rd->discard;
++    } else {
++      rd->neednotcheck= 0;
++    }
+     memmove(buf, buf + rd->discard, rd->used);
+     rd->discard= 0;
+   }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch
new file mode 100644
index 0000000..e738be5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -19935,7 +19935,7 @@
+ fi
+ 
+ if test xno != x$with_tcl; then
+-  for version in 8.4 8.3 8.2 8.1 8.0 ; do
++  for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
+     CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
+     as_ac_Lib=`echo "ac_cv_lib_tcl$version''_Tcl_Main" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for Tcl_Main in -ltcl$version" >&5
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,7 +71,7 @@
+ fi
+ 
+ if test xno != x$with_tcl; then
+-  for version in 8.4 8.3 8.2 8.1 8.0 ; do
++  for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
+     CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
+     AC_CHECK_LIB(tcl$version,Tcl_Main,[
+     AC_CHECK_HEADER(tcl.h,[
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb
new file mode 100644
index 0000000..82818c2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Liboop is a low-level event loop management library for POSIX-based operating systems"
+HOMEPAGE = "http://liboop.org/"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8b54f38ccbd44feb80ab90e01af8b700"
+
+SRC_URI = "http://ftp.debian.org/debian/pool/main/libo/liboop/liboop_${PV}.orig.tar.gz \
+           file://read_bugfixes.patch \
+           file://explicit_linking.patch \
+           file://tcl_dev.patch \
+           file://new-readline-typedef.patch \
+"
+
+SRC_URI[md5sum] = "36cb971047d3af02369446f5e0b315a2"
+SRC_URI[sha256sum] = "34d83c6e0f09ee15cb2bc3131e219747c3b612bb57cf7d25318ab90da9a2d97c"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+PACKAGECONFIG[glib] = "--with-glib,--without-glib,glib-2.0 libpcre"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl"
+
+EXTRA_OECONF += "--without-adns -without-libwww"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb
similarity index 71%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb
index 811829e..3377807 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb
@@ -5,7 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499"
 
 SRC_URI = "https://www.kernel.org/pub/linux/libs/ieee1394/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "d06cccb776b240b6ab5efdee33b87af2"
-SRC_URI[sha256sum] = "a83cff16fb8885831bc29d7d17f3c570dc39251d89e20795c08e87720de0ba70"
+SRC_URI[md5sum] = "45031ab15ca93e50c19886a38bc1814a"
+SRC_URI[sha256sum] = "ddc4e32721cdfe680d964aaede68ac606a20cd17dd2ba70e2d7e0692086ab57c"
 
 inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch
new file mode 100644
index 0000000..2d5bd6d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch
@@ -0,0 +1,13 @@
+Index: SDL2_ttf-2.0.14/Makefile.am
+===================================================================
+--- SDL2_ttf-2.0.14.orig/Makefile.am
++++ SDL2_ttf-2.0.14/Makefile.am
+@@ -1,6 +1,8 @@
+ # Makefile.am for the SDL truetype font loading library and viewer
+ lib_LTLIBRARIES = libSDL2_ttf.la
+ 
++AUTOMAKE_OPTIONS = foreign
++
+ libSDL2_ttfincludedir = $(includedir)/SDL2
+ libSDL2_ttfinclude_HEADERS =	\
+ 	SDL_ttf.h
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
index 0249abe..d8b378f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
@@ -12,7 +12,9 @@
 
 S = "${WORKDIR}/SDL_ttf-${PV}"
 
-inherit autotools
+inherit autotools pkgconfig
+
+LDFLAGS += "-lm"
 
 do_configure_prepend() {
     # make autoreconf happy
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
index af5a55c..4601593 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
@@ -1,23 +1,25 @@
 SUMMARY = "Simple DirectMedia Layer truetype font library"
 SECTION = "libs"
-DEPENDS = "virtual/libsdl2 freetype"
+DEPENDS = "virtual/libsdl2 freetype virtual/libgl"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=cb33e7c4df9fbde389f149ad6bc93ce5"
 
 SRC_URI = " \
     http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${PV}.tar.gz \
     file://use.pkg-config.for.freetype2.patch \
+    file://automake_foreign.patch \
 "
 SRC_URI[md5sum] = "e53c05e1e7f1382c316afd6c763388b1"
 SRC_URI[sha256sum] = "34db5e20bcf64e7071fe9ae25acaa7d72bdc4f11ab3ce59acc768ab62fe39276"
 
 S = "${WORKDIR}/SDL2_ttf-${PV}"
 
-inherit autotools
+inherit autotools pkgconfig distro_features_check
+
+# links to libGL.so
+REQUIRED_DISTRO_FEATURES += "x11 opengl"
 
 do_configure_prepend() {
-    touch ${S}/NEWS ${S}/README ${S}/AUTHORS ${S}/ChangeLog
-
     # Removing these files fixes a libtool version mismatch.
     MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
 
@@ -25,3 +27,4 @@
         rm -f ${S}/acinclude/$i
     done
 }
+ASNEEDED = ""
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
index 22d3155..cbcbe96 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
@@ -8,3 +8,5 @@
 SRC_URI[sha256sum] = "a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765"
 
 inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
index c0b8913..79e7dc5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
@@ -16,7 +16,7 @@
     -DWITH_PCAP=1 \
     -DWITH_SFTP=1 \
     -DWITH_ZLIB=1 \
-    -DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')} \
+    -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
     "
 
 PACKAGECONFIG ??=""
@@ -31,3 +31,4 @@
 }
 
 FILES_${PN}-dev += "${libdir}/cmake"
+TOOLCHAIN = "gcc"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
index 155d3d4..c62dab1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
@@ -23,4 +23,4 @@
 PACKAGECONFIG[openssl] = "--with-openssl --with-libssl-prefix=${STAGING_LIBDIR},--without-openssl,openssl"
 PACKAGECONFIG[gcrypt] = "--with-libgcrypt --with-libgcrypt-prefix=${STAGING_EXECPREFIXDIR},--without-libgcrypt,libgcrypt"
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
index 4460be2..138df9f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
@@ -42,4 +42,4 @@
     install -m 0644 ${S}/tinyxml.h ${D}${includedir}
 }
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb
similarity index 88%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb
index af0b785..3a66598 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb
@@ -6,7 +6,7 @@
 
 SRC_URI = "git://github.com/leethomason/tinyxml2.git"
 
-SRCREV = "1977a7258cc66fd4da7f1e9da05a4933646a7803"
+SRCREV = "74d44acb176f8510abf28ee0a70961eb26631988"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
index 0282ba5..8c84cb3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
@@ -11,7 +11,9 @@
 PV = "1.1.6-alt2+git${SRCPV}"
 
 SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \
-    file://0001-Fix-macro-error.patch"
+           file://0001-Fix-macro-error.patch \
+           file://libutempter-remove-glibc-assumption.patch \
+          "
 
 S = "${WORKDIR}/git/${BPN}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
new file mode 100644
index 0000000..6ed9335
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
@@ -0,0 +1,81 @@
+diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c
+--- libutempter-1.1.6.orig/utempter.c	2010-11-04 13:14:53.000000000 -0400
++++ libutempter-1.1.6/utempter.c	2014-06-20 16:37:09.762403323 -0400
+@@ -34,13 +34,7 @@
+ #include <sys/stat.h>
+ #include <utmp.h>
+ 
+-#ifdef __GLIBC__
+ # include <pty.h>
+-#elif defined(__FreeBSD__)
+-# include <libutil.h>
+-#else
+-# error Unsupported platform
+-#endif /* __GLIBC__ || __FreeBSD__ */
+ 
+ #define	DEV_PREFIX	"/dev/"
+ #define	DEV_PREFIX_LEN	(sizeof(DEV_PREFIX)-1)
+@@ -106,17 +100,12 @@
+ 
+ static int
+ write_uwtmp_record(const char *user, const char *term, const char *host,
+-#ifdef __GLIBC__
+ 		   pid_t pid,
+-#endif
+ 		   int add)
+ {
+ 	struct utmp ut;
+ 	struct timeval tv;
+-
+-#ifdef __GLIBC__
+ 	size_t offset;
+-#endif
+ 
+ 	memset(&ut, 0, sizeof(ut));
+ 
+@@ -128,8 +117,6 @@
+ 	if (host)
+ 		strncpy(ut.ut_host, host, sizeof(ut.ut_host));
+ 
+-#ifdef __GLIBC__
+-
+ 	offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 :
+ 			strlen(term) - sizeof(ut.ut_id);
+ 	strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
+@@ -156,27 +143,6 @@
+ 
+ 	(void) updwtmp(_PATH_WTMP, &ut);
+ 
+-#elif defined(__FreeBSD__)
+-
+-	ut.ut_time = tv.tv_sec;
+-
+-	if (add)
+-	{
+-		login(&ut);
+-	} else
+-	{
+-		if (logout(term) != 1)
+-		{
+-#ifdef	UTEMPTER_DEBUG
+-			fprintf(stderr, "utempter: logout: %s\n",
+-				strerror(errno));
+-#endif
+-			exit(EXIT_FAILURE);
+-		}
+-	}
+-
+-#endif /* __GLIBC__ || __FreeBSD__ */
+-
+ #ifdef	UTEMPTER_DEBUG
+ 	fprintf(stderr,
+ 		"utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
+@@ -255,8 +221,6 @@
+ 	validate_device(device);
+ 
+ 	return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
+-#ifdef __GLIBC__
+ 				  pid,
+-#endif
+ 				  add);
+ }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch
new file mode 100644
index 0000000..9ff9d70
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch
@@ -0,0 +1,26 @@
+From 97f0b7b25474fab25f5757f7c50a77e20be5d05b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
+Date: Mon, 7 Sep 2015 15:00:48 +0200
+Subject: [PATCH] Use the API properly in the example (format security error
+ fixed).
+
+---
+ examples/helloworld1/mylog.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/helloworld1/mylog.h b/examples/helloworld1/mylog.h
+index 280f3dc..57e5369 100644
+--- a/examples/helloworld1/mylog.h
++++ b/examples/helloworld1/mylog.h
+@@ -39,7 +39,7 @@ static LOG4C_INLINE int mylog_fini(){
+ 
+ static LOG4C_INLINE void mylog_msg(char *catName,int a_priority, char *msg){
+ #ifndef WITHOUT_LOG4C
+-	log4c_category_log(log4c_category_get(catName), a_priority, msg);
++	log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg);
+ #else
+ 	printf(msg);
+ #endif
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
index 3286b08..ef7ad84 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
@@ -4,7 +4,9 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
-           file://fix_configure_with-expat.patch"
+           file://fix_configure_with-expat.patch \
+           file://0001-Use-the-API-properly-in-the-example-format-security-.patch \
+          "
 
 SRC_URI[md5sum] = "0d94919136e1d16b68427562e74cb3dd"
 SRC_URI[sha256sum] = "5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea"
@@ -15,3 +17,5 @@
 BINCONFIG = "${bindir}/log4c-config"
 
 inherit autotools binconfig-disabled
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb
similarity index 68%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb
index c7bf288..dc52c9f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb
@@ -3,12 +3,12 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
 
-SRC_URI[md5sum] = "1e173df8ee97205f412ff84aa93b8fbe"
-SRC_URI[sha256sum] = "35abf332630a6809c969276b1d60b90c81a95daf24c86cfd7866ffef72f9bed0"
-
-SRC_URI = "http://downloads.sourceforge.net/${BPN}/${BP}.tar.gz \
+RC = "rc5"
+SRC_URI = "http://downloads.sourceforge.net/${BPN}/${BP}${RC}.tar.gz \
            file://fix-pc.patch;striplevel=2 \
           "
+SRC_URI[md5sum] = "58b4591a2f3e7ef3d5e3e7cfb3a81a62"
+SRC_URI[sha256sum] = "a611d99a20af6676c60219762771c0bfac90f4879bbde70038ece75338b588ec"
 
 S = "${WORKDIR}/${BPN}"
 
@@ -19,5 +19,4 @@
     --enable-dot=no \
     --enable-html-docs=no \
     --enable-latex-docs=no \
-    LDFLAGS=-pthread \
 "
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
new file mode 100644
index 0000000..e86ab25
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
@@ -0,0 +1,182 @@
+From 916ea0c70fd063ab7b81f16fd917a75dc02edf4f Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 17 Mar 2017 03:18:28 +0100
+Subject: [PATCH] Avoid bashisms in init scripts
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ scripts/blk_availability_init_red_hat.in      | 4 ++--
+ scripts/clvmd_init_red_hat.in                 | 6 +++---
+ scripts/cmirrord_init_red_hat.in              | 4 ++--
+ scripts/lvm2_cluster_activation_red_hat.sh.in | 4 ++--
+ scripts/lvm2_lvmetad_init_red_hat.in          | 4 ++--
+ scripts/lvm2_lvmpolld_init_red_hat.in         | 4 ++--
+ scripts/lvm2_monitoring_init_red_hat.in       | 4 ++--
+ scripts/lvm2_monitoring_init_rhel4            | 4 ++--
+ 8 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/scripts/blk_availability_init_red_hat.in b/scripts/blk_availability_init_red_hat.in
+index a84ffe7..6b855b7 100644
+--- a/scripts/blk_availability_init_red_hat.in
++++ b/scripts/blk_availability_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -53,6 +53,6 @@ case "$1" in
+   status)
+ 	;;
+   *)
+-	echo $"Usage: $0 {start|stop|status}"
++	echo "Usage: $0 {start|stop|status}"
+ 	;;
+ esac
+diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
+index d7f3392..abc8011 100644
+--- a/scripts/clvmd_init_red_hat.in
++++ b/scripts/clvmd_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # clvmd - Clustered LVM Daemon init script
+ #
+@@ -161,7 +161,7 @@ restart() {
+ 	fi
+ }
+ 
+-[ "$EUID" != "0" ] && {
++[ "$(id -u)" != "0" ] && {
+ 	echo "clvmd init script can only be executed as root user"
+ 	exit 4
+ }
+@@ -206,7 +206,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++	echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ 	rtrn=2
+ 	;;
+ esac
+diff --git a/scripts/cmirrord_init_red_hat.in b/scripts/cmirrord_init_red_hat.in
+index d4b7e37..d442cbc 100755
+--- a/scripts/cmirrord_init_red_hat.in
++++ b/scripts/cmirrord_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # chkconfig: - 22 78
+ # description: Starts and stops cmirrord
+@@ -101,7 +101,7 @@ case "$1" in
+ 		;;
+ 
+ 	*)
+-		echo $"Usage: $0 {start|stop|restart|status}"
++		echo "Usage: $0 {start|stop|restart|status}"
+ 		;;
+ esac
+ 
+diff --git a/scripts/lvm2_cluster_activation_red_hat.sh.in b/scripts/lvm2_cluster_activation_red_hat.sh.in
+index abea026..d8cba2e 100644
+--- a/scripts/lvm2_cluster_activation_red_hat.sh.in
++++ b/scripts/lvm2_cluster_activation_red_hat.sh.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ sbindir=@sbindir@
+ 
+@@ -54,7 +54,7 @@ case "$1" in
+ 	rtrn=$?
+ 	;;
+   *)
+-	echo $"Usage: $0 {activate|deactivate}"
++	echo "Usage: $0 {activate|deactivate}"
+ 	rtrn=3
+ 	;;
+ esac
+diff --git a/scripts/lvm2_lvmetad_init_red_hat.in b/scripts/lvm2_lvmetad_init_red_hat.in
+index b2f5d50..96269a9 100644
+--- a/scripts/lvm2_lvmetad_init_red_hat.in
++++ b/scripts/lvm2_lvmetad_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -105,7 +105,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_lvmpolld_init_red_hat.in b/scripts/lvm2_lvmpolld_init_red_hat.in
+index c521955..cdbaece 100644
+--- a/scripts/lvm2_lvmpolld_init_red_hat.in
++++ b/scripts/lvm2_lvmpolld_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+ #
+@@ -107,7 +107,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_monitoring_init_red_hat.in b/scripts/lvm2_monitoring_init_red_hat.in
+index de7ff0d..9ff6bb7 100644
+--- a/scripts/lvm2_monitoring_init_red_hat.in
++++ b/scripts/lvm2_monitoring_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
+ #
+@@ -128,7 +128,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++	echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_monitoring_init_rhel4 b/scripts/lvm2_monitoring_init_rhel4
+index 8eb06c5..2e8d0f7 100644
+--- a/scripts/lvm2_monitoring_init_rhel4
++++ b/scripts/lvm2_monitoring_init_rhel4
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ #
+@@ -93,7 +93,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++	echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ 	;;
+ esac
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
new file mode 100644
index 0000000..5d72402
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
@@ -0,0 +1,79 @@
+From e3103459416616d3b8508e7176e897b0ae6c90f2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:49:40 +0000
+Subject: [PATCH] implement libc specific reopen_stream
+
+musl defines stdin/stdio/stderr as constant types which means
+we can not assign to them as we are doing here but works ok with glibc
+therefore abstract out the _reopen_stream definition depending upon if
+we are using glibc or otherwise
+
+Origin:
+http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+---
+ lib/log/log.c      | 6 ++++++
+ tools/lvmcmdline.c | 6 +++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index c933154..3581084 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -161,6 +161,7 @@ static void _check_and_replace_standard_log_streams(FILE *old_stream, FILE *new_
+  * Close and reopen standard stream on file descriptor fd.
+  */
+ int reopen_standard_stream(FILE **stream, const char *mode)
++#ifdef __GLIBC__
+ {
+ 	int fd, fd_copy, new_fd;
+ 	const char *name;
+@@ -207,6 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ 	*stream = new_stream;
+ 	return 1;
+ }
++#else
++{
++	return (freopen(NULL, mode, *stream) != NULL);
++}
++#endif
+ 
+ void init_log_fn(lvm2_log_fn_t log_fn)
+ {
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index 9a4deb7..f1f18e6 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -1818,7 +1818,7 @@ static int _check_standard_fds(void)
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++	    !freopen(_PATH_DEVNULL, "r", stdin)) {
+ 		if (err)
+ 			perror("stdin stream open");
+ 		else
+@@ -1828,7 +1828,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDOUT_FILENO) &&
+-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stdout)) {
+ 		if (err)
+ 			perror("stdout stream open");
+ 		/* else no stdout */
+@@ -1836,7 +1836,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDERR_FILENO) &&
+-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stderr)) {
+ 		printf("stderr stream open: %s\n",
+ 		       strerror(errno));
+ 		return 0;
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
new file mode 100644
index 0000000..95dcede
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
@@ -0,0 +1,30 @@
+From 3ae9c0b607ec33fb07f32a41e9d28cc9068dd39a Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:52:44 +0000
+Subject: [PATCH] Guard use of mallinfo() with __GLIBC__
+
+This API is glibc-only
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+---
+ lib/mm/memlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
+index da90144..f34f890 100644
+--- a/lib/mm/memlock.c
++++ b/lib/mm/memlock.c
+@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, size_t size)
+ 
+ static void _allocate_memory(void)
+ {
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ 	void *stack_mem;
+ 	struct rlimit limit;
+ 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
similarity index 64%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
index 2a3b843..9ab1c06 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
@@ -1,19 +1,20 @@
-From 9b793d5b4adc5d8b3684e7f66943e236eae7c2db Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:52:59 +0000
-Subject: [PATCH 4/4] include fcntl.h for O_* defines and fcntl() signature
+From b1ad91a059d99afd1ce25823b7c0a8d3ac63d2fd Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:55:49 +0000
+Subject: [PATCH 3/4] include fcntl.h for O_* defines and fcntl() signature
 
 On glibc _somehow_ this header gets pulled in indirectly
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
 Upstream-Status: Pending
-
+---
  libdaemon/server/daemon-server.c | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
-index d9d60d1..433d100 100644
+index 6af6de9..a9590e7 100644
 --- a/libdaemon/server/daemon-server.c
 +++ b/libdaemon/server/daemon-server.c
 @@ -18,6 +18,7 @@
@@ -25,5 +26,5 @@
  #include <errno.h>
  #include <pthread.h>
 -- 
-2.7.0
+2.9.3
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
similarity index 70%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
index 8db320d..aaeaa72 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
@@ -1,7 +1,7 @@
-From 72866782f83c8cf85b10017df461128af90cae6e Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 30 Aug 2016 22:33:47 -0400
-Subject: [PATCH] tweak MODPROBE_CMD for cross compile
+From 0012ea63f6070a5d41fa380970f9c30b953237d2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:59:40 +0000
+Subject: [PATCH 4/4] tweak MODPROBE_CMD for cross compile
 
 Lvm uses variable MODPROBE_CMD at runtime, so build time detection of modprobe
 is incorrect.
@@ -16,23 +16,23 @@
 Upstream-Status: Inappropriate [oe specific]
 
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
- configure.in | 2 --
- 1 file changed, 2 deletions(-)
+ configure.in | 1 -
+ 1 file changed, 1 deletion(-)
 
 diff --git a/configure.in b/configure.in
-index 8e04782..77681b0 100644
+index cc77aab..a3579f2 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -1779,8 +1779,6 @@ if test "$UDEV_SYNC" = yes; then
+@@ -1853,7 +1853,6 @@ if test "$UDEV_SYNC" = yes; then
  fi
  
  ################################################################################
 -AC_PATH_TOOL(MODPROBE_CMD, modprobe)
--
+ 
  if test -n "$MODPROBE_CMD"; then
  	AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
- fi
 -- 
-2.8.1
+2.9.3
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf
rename to import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
new file mode 100644
index 0000000..462e8fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
@@ -0,0 +1,31 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+PACKAGECONFIG = ""
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-pkgconfig \
+                --with-usrlibdir=${libdir} \
+"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install_append() {
+    # Remove things unrelated to libdevmapper
+    rm -rf ${D}${sysconfdir}
+    for i in `ls ${D}${sbindir}/*`; do
+	if [ $i != ${D}${sbindir}/dmsetup ]; then
+	    rm $i
+	fi
+    done
+    # Remove docs
+    rm -rf ${D}${datadir}
+}
+
+RRECOMMENDS_${PN} += "lvm2-udevrules"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
index 74b7211..cb5a9e0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -1,80 +1,33 @@
 SECTION = "utils"
 DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux."
-DEPENDS = "udev"
 LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
                     file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24"
 
+DEPENDS += "util-linux"
+
 SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \
            file://lvm.conf \
-           file://0001-implement-libc-specific-_reopen_stream.patch \
-           file://0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch \
-           file://0003-Guard-use-of-mallinfo-with-__GLIBC__.patch \
-           file://0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
-           file://0005-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-implement-libc-specific-reopen_stream.patch \
+           file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
+           file://0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
+           file://0004-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-Avoid-bashisms-in-init-scripts.patch \
            "
-
 S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-                   thin-provisioning-tools \
-                   odirect \
-"
+# odirect is always enabled because there currently is a bug in
+# lib/device/dev-io.c which prevents compiling without it. It is
+# better to stick to configurations that were actually tested by
+# upstream...
+PACKAGECONFIG_append = " odirect"
 
+PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
+PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
+PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
 PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline"
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
 PACKAGECONFIG[thin-provisioning-tools] = "--with-thin=internal,--with-thin=none,,thin-provisioning-tools"
-PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-realtime \
-                --enable-applib \
-                --enable-cmdlib \
-                --enable-udev_sync \
-                --enable-udev_rules \
-                --enable-pkgconfig \
-                --enable-dmeventd \
-                --enable-lvmetad \
-                --with-udev-prefix= \
-                --with-usrlibdir=${libdir} \
-                --with-systemdsystemunitdir=${systemd_system_unitdir} \
-                --disable-thin_check_needs_check \
-                --with-thin-check=${sbindir}/thin_check \
-                --with-thin-dump=${sbindir}/thin_dump \
-                --with-thin-repair=${sbindir}/thin_repair \
-                --with-thin-restore=${sbindir}/thin_restore \
-"
-
-CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
-
-do_install_append() {
-    # Install machine specific configuration file
-    install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
-    sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        oe_runmake 'DESTDIR=${D}' install install_systemd_units
-        sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
-    else
-        oe_runmake 'DESTDIR=${D}' install install_initscripts
-        mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
-        rm -rf ${D}${sysconfdir}/rc.d
-    fi
-}
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "lvm2-monitor.service dm-event.socket dm-event.service lvm2-lvmetad.socket \
-                         lvm2-pvscan@.service blk-availability.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-FILES_${PN} += "${libdir}/device-mapper/*.so ${base_libdir}/udev"
-FILES_${PN}-dbg += "${libdir}/device-mapper/.debug"
-
-RDEPENDS_${PN} = "bash"
-
-CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
deleted file mode 100644
index f0b4e71..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 089c9c701a1b68b721f479dfc0c58c35b9dd4175 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:39:53 +0000
-Subject: [PATCH 1/4] implement libc specific _reopen_stream
-
-musl defines stdin/stdio/stderr as constant types which means
-we can not assign to them as we are doing here but works ok with glibc
-therefore abstract out the _reopen_stream definition depending upon if
-we are using glibc or otherwise
-
-Origin:
-http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- lib/commands/toolcontext.c | 22 +++++++++++-----------
- tools/lvmcmdline.c         |  6 +++---
- 2 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
-index a2f21b8..7f796e4 100644
---- a/lib/commands/toolcontext.c
-+++ b/lib/commands/toolcontext.c
-@@ -1637,7 +1637,10 @@ static void _init_globals(struct cmd_context *cmd)
- /*
-  * Close and reopen stream on file descriptor fd.
-  */
--static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
-+#ifdef __GLIBC__
-+#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
-+
-+static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
- {
- 	int fd_copy, new_fd;
- 
-@@ -1664,6 +1667,9 @@ static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *na
- 
- 	return 1;
- }
-+#else
-+#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
-+#endif
- 
- static int _init_lvmetad(struct cmd_context *cmd)
- {
-@@ -1741,7 +1747,6 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 				       unsigned set_filters)
- {
- 	struct cmd_context *cmd;
--	FILE *new_stream;
- 	int flags;
- 
- #ifdef M_MMAP_MAX
-@@ -1791,9 +1796,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 		if (is_valid_fd(STDIN_FILENO) &&
- 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_WRONLY) {
--			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
-+			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
- 				goto_out;
--			stdin = new_stream;
- 			if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
- 				log_sys_error("setvbuf", "");
- 				goto out;
-@@ -1803,9 +1807,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 		if (is_valid_fd(STDOUT_FILENO) &&
- 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_RDONLY) {
--			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
-+			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
- 				goto_out;
--			stdout = new_stream;
- 			if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
- 				     _IOLBF, linebuffer_size)) {
- 				log_sys_error("setvbuf", "");
-@@ -2131,7 +2134,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
- void destroy_toolcontext(struct cmd_context *cmd)
- {
- 	struct dm_config_tree *cft_cmdline;
--	FILE *new_stream;
- 	int flags;
- 
- 	if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
-@@ -2167,8 +2169,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- 		if (is_valid_fd(STDIN_FILENO) &&
- 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_WRONLY) {
--			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
--				stdin = new_stream;
-+			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
- 				setlinebuf(stdin);
- 			} else
- 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
-@@ -2177,8 +2178,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- 		if (is_valid_fd(STDOUT_FILENO) &&
- 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_RDONLY) {
--			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
--				stdout = new_stream;
-+			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
- 				setlinebuf(stdout);
- 			} else
- 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
-diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
-index 6577977..a33258a 100644
---- a/tools/lvmcmdline.c
-+++ b/tools/lvmcmdline.c
-@@ -1744,7 +1744,7 @@ static int _check_standard_fds(void)
- 	int err = is_valid_fd(STDERR_FILENO);
- 
- 	if (!is_valid_fd(STDIN_FILENO) &&
--	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
-+	    !freopen(_PATH_DEVNULL, "r", stdin)) {
- 		if (err)
- 			perror("stdin stream open");
- 		else
-@@ -1754,7 +1754,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDOUT_FILENO) &&
--	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
-+	    !freopen(_PATH_DEVNULL, "w", stdout)) {
- 		if (err)
- 			perror("stdout stream open");
- 		/* else no stdout */
-@@ -1762,7 +1762,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDERR_FILENO) &&
--	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
-+	    !freopen(_PATH_DEVNULL, "w", stderr)) {
- 		printf("stderr stream open: %s\n",
- 		       strerror(errno));
- 		return 0;
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
deleted file mode 100644
index 969a152..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c8a1b669cbff3eee367fd4db3389e337bc4c98ba Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:46:26 +0000
-Subject: [PATCH 2/4] use PTHREAD_MUTEX_RECURSIVE instead of
- PTHREAD_MUTEX_RECURSIVE_NP
-
-PTHREAD_MUTEX_RECURSIVE_NP was used for compatibility with old glibc.
-Although due to the_GNU_SOURCES define the portable,
-PTHREAD_MUTEX_RECURSIVE will be available for Linuxes since at least
-1998. Simplify things giving us compatibility with musl which
-apparently does not provide the non-portable define.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- daemons/lvmetad/lvmetad-core.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
-index 7af9bde..63707c2 100644
---- a/daemons/lvmetad/lvmetad-core.c
-+++ b/daemons/lvmetad/lvmetad-core.c
-@@ -300,7 +300,7 @@ static struct dm_config_tree *lock_vg(lvmetad_state *s, const char *id) {
- 	if (!(vg = dm_hash_lookup(s->lock.vg, id))) {
- 		if (!(vg = malloc(sizeof(pthread_mutex_t))) ||
- 		    pthread_mutexattr_init(&rec) ||
--		    pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) ||
-+		    pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) ||
- 		    pthread_mutex_init(vg, &rec))
- 			goto bad;
- 		if (!dm_hash_insert(s->lock.vg, id, vg)) {
-@@ -2890,7 +2890,7 @@ static int init(daemon_state *s)
- 	ls->log = s->log;
- 
- 	pthread_mutexattr_init(&rec);
--	pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP);
-+	pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE);
- 	pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec);
- 	pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec);
- 	pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL);
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch
deleted file mode 100644
index 3d71767..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From e018d055603389b22cbc3bd68b1525f3048ebee7 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:50:26 +0000
-Subject: [PATCH 3/4] Guard use of mallinfo() with __GLIBC__
-
-This API is glibc-only
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- lib/mm/memlock.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
-index 969f1d7..405a7c0 100644
---- a/lib/mm/memlock.c
-+++ b/lib/mm/memlock.c
-@@ -145,7 +145,7 @@ static void _touch_memory(void *mem, size_t size)
- 
- static void _allocate_memory(void)
- {
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- 	void *stack_mem;
- 	struct rlimit limit;
- 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
deleted file mode 100644
index 13a866e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require lvm2.inc
-
-SRC_URI[md5sum] = "c660e02ad4586a1d297b6befbe85556d"
-SRC_URI[sha256sum] = "93878a4ba4f70d9f2d0d919eb85bc51652a58776b5428ec8e7e32769d332f596"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
new file mode 100644
index 0000000..7939f05
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
@@ -0,0 +1,81 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    thin-provisioning-tools \
+    udev \
+"
+
+PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-realtime \
+                --enable-applib \
+                --enable-cmdlib \
+                --enable-pkgconfig \
+                --with-usrlibdir=${libdir} \
+                --with-systemdsystemunitdir=${systemd_system_unitdir} \
+                --disable-thin_check_needs_check \
+                --with-thin-check=${sbindir}/thin_check \
+                --with-thin-dump=${sbindir}/thin_dump \
+                --with-thin-repair=${sbindir}/thin_repair \
+                --with-thin-restore=${sbindir}/thin_restore \
+"
+
+CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
+
+do_install_append() {
+    # Install machine specific configuration file
+    install -d ${D}${sysconfdir}/lvm
+    install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
+    sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        oe_runmake 'DESTDIR=${D}' install install_systemd_units
+        sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
+    else
+        oe_runmake 'DESTDIR=${D}' install install_initscripts
+        mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
+        rm -rf ${D}${sysconfdir}/rc.d
+    fi
+    # Remove things related to libdevmapper
+    rm -f ${D}${sbindir}/dmsetup
+    rm -f ${D}${libdir}/libdevmapper.so.*
+    rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
+}
+
+PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
+                         ${@bb.utils.contains('PACKAGECONFIG', 'lvmetad', 'lvm2-lvmetad.socket lvm2-pvscan@.service', '', d)} \
+                         blk-availability.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+FILES_${PN} += "${libdir}/device-mapper/*.so"
+FILES_${PN}-scripts = " \
+    ${sbindir}/blkdeactivate \
+    ${sbindir}/fsadm \
+    ${sbindir}/lvmconf \
+    ${sbindir}/lvmdump \
+"
+# Specified explicitly for the udev rules, just in case that it does not get picked
+# up automatically:
+FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
+RDEPENDS_${PN}_append_class-target = " libdevmapper"
+
+RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash"
+RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
+
+CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
index af0b6ae..a5d9962 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
@@ -38,4 +38,4 @@
     fi
 }
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch
deleted file mode 100644
index bea2f62..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 8f57d35747a3b3fabc33466563077373090f869c Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Tue, 2 Sep 2014 07:05:15 -0700
-Subject: [PATCH] cache-error-trigger: remove bashism
-
-Use "$(cat $F)" to instead of "$(< $F)" to debash.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- triggers/cache-error-trigger |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/triggers/cache-error-trigger b/triggers/cache-error-trigger
-index e32bfd6..785526f 100755
---- a/triggers/cache-error-trigger
-+++ b/triggers/cache-error-trigger
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/bin/sh
- # cache error trigger. This shell script is executed by mcelog in daemon mode
- # when a CPU reports excessive corrected cache errors. This could be a indication
- # for future uncorrected errors.
-@@ -28,7 +28,7 @@ for i in $AFFECTED_CPUS ; do
- 	logger -s -p daemon.crit -t mcelog "Offlining CPU $i due to cache error threshold"
- 	F=$(printf "/sys/devices/system/cpu/cpu%d/online" $i)
- 	echo 0 > $F
--	if [ "$(< $F)" != "0" ] ; then
-+	if [ "$(cat $F)" != "0" ] ; then
- 		logger -s -p daemon.warn -t mcelog "Offlining CPU $i failed"
- 		EXIT=1
- 	fi
--- 
-1.7.9.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb
similarity index 86%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb
index 9aebbd5..84633a7 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb
@@ -6,14 +6,13 @@
 SECTION = "System Environment/Base"
 
 SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http; \
-    file://mcelog-debash.patch \
     file://run-ptest \
 "
 
-SRCREV = "008c73e6de3a4bf969d1627e695d4efc807aed92"
+SRCREV = "2cfdf29b2ef98ccd5ed42cdde8bbe437e0d6412f"
 
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://README;md5=3d12dd2a10bdd22379cc4c0fc6949a88"
+LIC_FILES_CHKSUM = "file://README.md;md5=279840fabb191e6cd9150492d31b0e20"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch
deleted file mode 100644
index 16137da..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -uwr mg-20110905/configure mg-20110905-changed/configure
---- mg-20110905/configure	2011-09-05 13:36:16.000000000 -0500
-+++ mg-20110905-changed/configure	2014-08-14 10:46:14.168715425 -0500
-@@ -163,32 +163,6 @@
-     echo 'Fails.'
- fi
- 
--
--if [ ! -r /usr/include/term.h ]; then
--    note 'term.h'
--    if [ -r /usr/include/ncurses/term.h ]; then
--	echo "Found in /usr/include/ncurses"
--	extraflags="$extraflags -I/usr/include/ncurses"
--    else
--	for i in pkg local; do
--	    if [ -r /usr/$i/include/term.h ]; then
--		echo "Found in /usr/$i/include"
--		extralibs="$extralibs -L/usr/$i/lib"
--		extraflags="$extraflags -I/usr/$i/include"
--		break
--	    else
--		false
--	    fi
--	done ||
--	{
--	    echo 'Not found!' >&2
--	    echo 'Do you have the ncurses devel package installed?' >&2
--	    echo 'If you know where term.h is, please email the author!' >&2
--	    exit 1
--	}
--    fi
--fi
--
- note 'base and dirname'
- if gcc_defines "__GLIBC__" || gcc_defines "__CYGWIN__" ; then
-     echo 'Not present, adding.'
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch
new file mode 100644
index 0000000..1302679
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch
@@ -0,0 +1,39 @@
+From a370ccd9447752c555aeca04f64021efedde4db3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 17:16:19 -0700
+Subject: [PATCH] Undefine REGEX for musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ GNUmakefile | 1 -
+ Makefile    | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/GNUmakefile b/GNUmakefile
+index 7bf7dca..0e10030 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -41,7 +41,6 @@ endif
+ CC?=		gcc
+ CFLAGS?=	-O2 -pipe
+ CFLAGS+=	-g -Wall
+-CPPFLAGS=	-DREGEX
+ CPPFLAGS+=	-D_GNU_SOURCE
+ CPPFLAGS+=	$(BSD_CPPFLAGS) -D__dead=__dead2
+ LIBS=		$(CURSES_LIBS) $(BSD_LIBS)
+diff --git a/Makefile b/Makefile
+index 94ce340..d516bbc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,7 @@ DPADD+=	${LIBCURSES} ${LIBUTIL}
+ #	REGEX		-- create regular expression functions.
+ #	STARTUPFILE	-- look for and handle initialization file.
+ #
+-CFLAGS+=-Wall -DREGEX
++CFLAGS+=-Wall
+ 
+ SRCS=	autoexec.c basic.c bell.c buffer.c cinfo.c dir.c display.c \
+ 	echo.c extend.c file.c fileio.c funmap.c help.c kbd.c keymap.c \
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch
new file mode 100644
index 0000000..551f1df
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch
@@ -0,0 +1,25 @@
+From 51539bcd2ee9f765595c0be16eebc1daee112b27 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 16:52:59 -0700
+Subject: [PATCH 1/2] fileio: Include sys/param.h for MAXNAMLEN
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fileio.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fileio.c b/fileio.c
+index 48a67a2..9b69665 100644
+--- a/fileio.c
++++ b/fileio.c
+@@ -12,6 +12,7 @@
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/param.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch
new file mode 100644
index 0000000..907d670
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch
@@ -0,0 +1,28 @@
+From ce24a29cabb8f1774d262e120e5764a2afeb3825 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 16:53:49 -0700
+Subject: [PATCH 2/2] fileio: Define DEFFILEMODE if platform is missing
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fileio.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/fileio.c b/fileio.c
+index 9b69665..a852fd2 100644
+--- a/fileio.c
++++ b/fileio.c
+@@ -28,6 +28,10 @@
+ #include "kbd.h"
+ #include "pathnames.h"
+ 
++#if !defined(DEFFILEMODE)
++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
++#endif
++
+ static char *bkuplocation(const char *);
+ static int   bkupleavetmp(const char *);
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb
similarity index 63%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb
index f9ceb46..dad1d00 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb
@@ -5,9 +5,15 @@
 DEPENDS = "ncurses libbsd"
 SECTION = "console/editors"
 
-SRC_URI = "http://homepage.boetes.org/software/mg/mg-${PV}.tar.gz"
-SRC_URI[md5sum] = "fc6faeeee7308bb46f3512b75867ed51"
-SRC_URI[sha256sum] = "b7fcb5136a6783ca24c8463ab0852fc1f26bdb2bb1c24759b2c51ccfc46c5e61"
+SRC_URI = "http://homepage.boetes.org/software/mg/mg-${PV}.tar.gz \
+           file://0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch \
+           file://0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch \
+           "
+SRC_URI_append_libc-musl = "\
+           file://0001-Undefine-REGEX-for-musl-based-systems.patch \
+           "
+SRC_URI[md5sum] = "884388589fb38c2109ad9fed328be20a"
+SRC_URI[sha256sum] = "0a3608b17c153960cb1d954ca3b62445a77c0c1a18aa5c8c58aba9f6b8d62aab"
 
 # CFLAGS isn't in EXTRA_OEMAKE, as the makefile picks it up via ?=
 EXTRA_OEMAKE = "\
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
index 1e48e1c..60c3c0a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
@@ -1,4 +1,4 @@
-From 74ff5e1cf8ef83dabcf6e6b92f87d6761f7f4d51 Mon Sep 17 00:00:00 2001
+From 630483b9738349c8b3e637a00879b96834a33cdb Mon Sep 17 00:00:00 2001
 From: Li xin <lixin.fnst@cn.fujitsu.com>
 Date: Tue, 7 Jul 2015 11:34:36 +0900
 Subject: [PATCH] multipathd.service: Error fix
@@ -13,10 +13,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
-index be3ba3f..b8d3ecd 100644
+index e3d6f91..a7e00b2 100644
 --- a/multipathd/multipathd.service
 +++ b/multipathd/multipathd.service
-@@ -6,11 +6,12 @@ DefaultDependencies=no
+@@ -8,11 +8,12 @@ Wants=local-fs-pre.target multipathd.socket blk-availability.service
  Conflicts=shutdown.target
  
  [Service]
@@ -25,12 +25,12 @@
  NotifyAccess=main
  LimitCORE=infinity
 +PIDFile=/var/run/multipathd.pid
- ExecStartPre=/sbin/modprobe dm-multipath
+ ExecStartPre=/sbin/modprobe -a scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm-multipath
 -ExecStart=/sbin/multipathd -d -s
 +ExecStart=/sbin/multipathd
  ExecReload=/sbin/multipathd reconfigure
  
  [Install]
 -- 
-1.8.4.2
+2.11.0
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
index a16a854..803e52c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
@@ -1,4 +1,7 @@
-Always use devmapper for kpartx
+From 7267cf235fc052eaa1ca36e437096576edacb131 Mon Sep 17 00:00:00 2001
+From: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] Always use devmapper for kpartx
 
 Do not try to compute the LIBDM_API_COOKIE make variable
 from host information when cross-compiling.
@@ -7,23 +10,27 @@
 
 Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
 Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ kpartx/Makefile | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
 
 diff --git a/kpartx/Makefile b/kpartx/Makefile
-index 2a07334..24bdabc 100644
+index e8a59f2..e694a65 100644
 --- a/kpartx/Makefile
 +++ b/kpartx/Makefile
-@@ -4,13 +4,7 @@
- #
- include ../Makefile.inc
+@@ -7,11 +7,7 @@ CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  
--CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--
+ LIBDEPS += -ldevmapper
+ 
 -LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
 -
 -ifneq ($(strip $(LIBDM_API_COOKIE)),0)
 -	CFLAGS += -DLIBDM_API_COOKIE
 -endif
-+CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLIBDM_API_COOKIE
++CFLAGS += -DLIBDM_API_COOKIE
  
- LDFLAGS = -ldevmapper
  OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
+ 	gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
index 89d2352..33834f6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
@@ -1,4 +1,7 @@
-Always use devmapper
+From c4f0dba4e86bfa20252fcc8218398e7468ca9149 Mon Sep 17 00:00:00 2001
+From: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] Always use devmapper
 
 Do not try to compute several _API_ make variables
 from host information when cross-compiling.
@@ -7,38 +10,48 @@
 
 Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
 Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ libmultipath/Makefile | 27 ++++-----------------------
+ 1 file changed, 4 insertions(+), 23 deletions(-)
 
 diff --git a/libmultipath/Makefile b/libmultipath/Makefile
-index e5b06b3..efd6cf6 100644
+index 495cebe..9626e69 100644
 --- a/libmultipath/Makefile
 +++ b/libmultipath/Makefile
-@@ -17,23 +17,18 @@ OBJS = memory.o parser.o vector.o devmapper.o \
-        log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \
-        lock.o waiter.o file.o wwids.o
+@@ -20,29 +20,10 @@ ifdef SYSTEMD
+ 	endif
+ endif
  
 -LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h)
- 
+-
 -ifneq ($(strip $(LIBDM_API_FLUSH)),0)
-+#ifneq ($(strip $(LIBDM_API_FLUSH)),0)
- 	CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
+-	CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
 -endif
-+#endif
- 
+-
 -LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
 -
 -ifneq ($(strip $(LIBDM_API_COOKIE)),0)
-+#ifneq ($(strip $(LIBDM_API_COOKIE)),0)
- 	CFLAGS += -DLIBDM_API_COOKIE
+-	CFLAGS += -DLIBDM_API_COOKIE
 -endif
 -
--LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_resolve_buffer_size' /usr/include/libudev.h)
-+#endif
- 
+-LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_receive_buffer_size' /usr/include/libudev.h)
+-
 -ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
-+#ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
- 	CFLAGS += -DLIBUDEV_API_RECVBUF
+-	CFLAGS += -DLIBUDEV_API_RECVBUF
 -endif
-+#endif
+-
+-LIBDM_API_DEFERRED = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_deferred_remove' /usr/include/libdevmapper.h)
+-
+-ifneq ($(strip $(LIBDM_API_DEFERRED)),0)
+-	CFLAGS += -DLIBDM_API_DEFERRED
+-endif
++CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
++CFLAGS += -DLIBDM_API_COOKIE
++CFLAGS += -DLIBUDEV_API_RECVBUF
++CFLAGS += -DLIBDM_API_DEFERRED
  
- 
- all: $(LIBS)
+ OBJS = memory.o parser.o vector.o devmapper.o callout.o \
+ 	hwtable.o blacklist.o util.o dmparser.o config.o \
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch
new file mode 100644
index 0000000..908a516
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch
@@ -0,0 +1,31 @@
+From 148b848f45957e5e1c0466e8c79c84ba4a0bf241 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 27 Jan 2017 10:35:54 +0100
+Subject: [PATCH] checkers: disable libcheckrbd.so
+
+libcheckrbd.so depends on librados, which is not currently available
+as a recipe. These checkers seem to be optional, so for now we merely
+disable compilation of libcheckrbd.so.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ libmultipath/checkers/Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
+index 11ab76f..c848d50 100644
+--- a/libmultipath/checkers/Makefile
++++ b/libmultipath/checkers/Makefile
+@@ -14,7 +14,6 @@ LIBS= \
+ 	libcheckemc_clariion.so \
+ 	libcheckhp_sw.so \
+ 	libcheckrdac.so \
+-	libcheckrbd.so
+ 
+ all: $(LIBS)
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch
deleted file mode 100644
index 86d5e0e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From fe65ac8face3c88d9d4e12811f44e63ad72c59ae Mon Sep 17 00:00:00 2001
-From: Bian Naimeng <biannm@cn.fujitsu.com>
-Date: Thu, 18 Jun 2015 12:25:25 +0900
-Subject: [PATCH] fix build warning
-
-  NOTE: Executing RunQueue Tasks
-  WARNING: QA Issue: Symlink /lib/libmpathpersist.so in multipath-tools-dev points to TMPDIR [symlink-to-sysroot]
-  NOTE: Tasks Summary: Attempted 1604 tasks of which 1591 didn't need to be rerun and all succeeded.
-
-Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
----
- libmpathpersist/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile
-index c4ec1c5..62022eb 100644
---- a/libmpathpersist/Makefile
-+++ b/libmpathpersist/Makefile
-@@ -32,7 +32,7 @@ install: $(LIBS)
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(man3dir)
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/include/
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/share/doc/mpathpersist/
--	ln -sf $(DESTDIR)$(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
-+	ln -sf $(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
- 	install -m 644 mpath_persistent_reserve_in.3.gz $(DESTDIR)$(man3dir)	
- 	install -m 644 mpath_persistent_reserve_out.3.gz $(DESTDIR)$(man3dir)	
- 	install -m 644 mpath_persist.h $(DESTDIR)/usr/include/
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
index 71963e0..5b7b696 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
@@ -1,4 +1,8 @@
-multipath-tools: modify Makefile.inc for cross-compilation
+From 9f5768eca165502b0f17d271aa6f7cf530ec60b2 Mon Sep 17 00:00:00 2001
+From: Joe Slater <joe.slater@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] multipath-tools: modify Makefile.inc for
+ cross-compilation
 
 Do not look for systemd info on the host, and allow us to pass in CFLAGS
 using the OPTFLAGS variable.
@@ -10,10 +14,15 @@
 Update for version 0.5.0-144-g770e6d0
 
 Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ Makefile.inc | 17 +++++------------
+ 1 file changed, 5 insertions(+), 12 deletions(-)
 
+diff --git a/Makefile.inc b/Makefile.inc
+index 1cc8f44..15f8b91 100644
 --- a/Makefile.inc
 +++ b/Makefile.inc
-@@ -21,12 +21,6 @@ ifndef LIB
+@@ -29,12 +29,6 @@ ifndef RUN
  	endif
  endif
  
@@ -26,14 +35,25 @@
  ifndef SYSTEMDPATH
  	SYSTEMDPATH=usr/lib
  endif
-@@ -53,7 +47,10 @@ ifndef RPM_OPT_FLAGS
- 	RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
- endif
+@@ -61,13 +55,12 @@ RM		= rm -f
+ LN		= ln -sf
+ INSTALL_PROGRAM	= install
  
+-OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 \
+-		  -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
+-		  -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector \
+-		  --param=ssp-buffer-size=4
 +ifndef OPTFLAGS
- OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
++OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
 +endif
-+
- CFLAGS	     = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
- SHARED_FLAGS = -shared
  
+-CFLAGS		= $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
+-SHARED_FLAGS	= -shared
++CFLAGS	     = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
++SHARED_FLAGS = -shared
+ 
+ %.o:	%.c
+ 	$(CC) $(CFLAGS) -c -o $@ $<
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch
new file mode 100644
index 0000000..88579e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch
@@ -0,0 +1,55 @@
+From 4311856200480288494df8df737f71ea316592d0 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Thu, 26 Jan 2017 15:28:34 +0100
+Subject: [PATCH] shared libs: avoid linking .so as executable
+
+When the OE build systems sets CFLAGS including -pie, gcc overrides
+the earlier -shared parameter and tries to link a binary, leading to
+errors about missing functions like main().
+
+Reordering the parameters so that -shared comes after CFLAGS
+fixes this.
+
+Upstream-Status: Inappropriate [OE specific, -pie shouldn't be in CFLAGS?!]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile
+index 457c4ca..f68c82c 100644
+--- a/libmpathcmd/Makefile
++++ b/libmpathcmd/Makefile
+@@ -9,7 +9,7 @@ OBJS = mpath_cmd.o
+ all: $(LIBS)
+ 
+ $(LIBS): $(OBJS)
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) $(LIBDEPS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)
+ 	$(LN) $@ $(DEVLIB)
+ 
+ install: $(LIBS)
+diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile
+index 6e43427..2486302 100644
+--- a/libmpathpersist/Makefile
++++ b/libmpathpersist/Makefile
+@@ -15,7 +15,7 @@ all: $(LIBS)
+ 
+ $(LIBS):
+ 	$(CC) -c $(CFLAGS) *.c
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) $(LIBDEPS) -Wl,-soname=$@ -o $@ $(OBJS)
+ 	$(LN) $(LIBS) $(DEVLIB)
+ 	$(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz
+ 	$(GZIP) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz
+diff --git a/libmultipath/Makefile b/libmultipath/Makefile
+index 495cebe..752bcc0 100644
+--- a/libmultipath/Makefile
++++ b/libmultipath/Makefile
+@@ -55,7 +55,7 @@ OBJS = memory.o parser.o vector.o devmapper.o callout.o \
+ all: $(LIBS)
+ 
+ $(LIBS): $(OBJS)
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) $(LIBDEPS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)
+ 	$(LN) $@ $(DEVLIB)
+ 
+ install:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
index 6bd6118..5f8c422 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
@@ -1,6 +1,6 @@
 SUMMARY = "The upstream project used to drive the Device Mapper multipathing driver"
 
-DEPENDS = "lvm2 libaio readline udev"
+DEPENDS = "libdevmapper libaio liburcu readline udev"
 
 LICENSE = "LGPLv2"
 
@@ -9,56 +9,48 @@
            file://makefile_inc.patch \
            file://always-use-libdevmapper.patch \
            file://always-use-libdevmapper-kpartx.patch \
-           file://do-not-link-libmpathpersist-to-TMPDIR.patch \
            file://0001-multipathd.service-Error-fix.patch \
+           file://shared-libs-avoid-linking-.so-as-executable.patch \
+           file://checkers-disable-libcheckrbd.so.patch \
            "
-# 0.5.0
-#
-#SRCREV = "82f391e787dc02e9d9294aa391137ab424bb83c4"
-#LIC_FILES_CHKSUM = "file://COPYING;md5=7be2873b6270e45abacc503abbe2aa3d"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
 
-# 0.5.0 + commits thru 7/18/2014
-#
-#SRCREV = "0d72f46c12207a6b7b89f5ef4f5ab5f87ed8bc90"
-#LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
-
-# 0.5.0 + commits thru 9/12/2014
-#
-#    includes important systemd related structure size fix
-#
-#SRCREV = "aec68ab217fd2956443b27ceeb97dd6475267789"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
-
-# 0.5.0 + commits thru 2/16/2015
-SRCREV = "770e6d0da035deaced82885939161c2b69225e10"
+# 0.6.4
+SRCREV = "922421cf795d53d339862bb2d99f1a85c96ad9a3"
 
 inherit systemd
 
 
 S = "${WORKDIR}/git"
 
-PV = "0.5.0+git${@'${SRCPV}'.split('+')[-1]}"
+PV = "0.6.4+git${@'${SRCPV}'.split('+')[-1]}"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+# multipath-tools includes a copy of the valgrind.h header
+# file and uses the macros to suppress some false positives. However,
+# that only works on ARM when thumb is disabled. Otherwise one gets:
+#   Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r12,r12,ror#3'
+#   ../Makefile.inc:66: recipe for target 'debug.o' failed
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
 # The exact version of SYSTEMD does not matter but should be greater than 209.
 #
 EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \
                 OPTFLAGS="${CFLAGS}" \
+                bindir=${base_sbindir} \
                 LIB=${base_libdir} libdir=${base_libdir}/multipath \
-                unitdir=/lib/systemd/system \
+                unitdir=${systemd_system_unitdir} \
                 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \
                '
 
 do_install() {
     oe_runmake install
 
-    # Copy a sample conf file, but do not rename it multipath.conf.
-    #
-    cp multipath.conf.defaults ${D}${sysconfdir}
-
     # We copy an initscript, but do not start multipathd at init time.
     #
+    install -d ${D}${sysconfdir}/init.d
     cp ${WORKDIR}/multipathd.oe ${D}${sysconfdir}/init.d/multipathd
 
 }
@@ -68,11 +60,12 @@
 # systemd and udev stuff always goes under /lib!
 #
 FILES_${PN} += "${base_libdir}/multipath \
-                /lib/systemd"
+                ${systemd_system_unitdir} \
+		"
 
 PACKAGES =+ "kpartx"
 FILES_kpartx = "${base_sbindir}/kpartx \
-                /usr/lib/udev/kpartx_id \
+                ${nonarch_libdir}/udev/kpartx_id \
                "
 
 RDEPENDS_${PN} += "kpartx"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.52.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.55.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.52.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.55.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
index 689b8ab..fd9dcbd 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
@@ -16,9 +16,11 @@
            file://configure.cmake-fix-valgrind.patch \
            file://fix-a-building-failure.patch \
            file://change-cc-to-cc-version.patch \
+           file://0001-disable-ucontext-on-musl.patch \
+           file://gcc7.patch \
           "
-SRC_URI[md5sum] = "fca86f1eaed2163b4bdce4f98f472324"
-SRC_URI[sha256sum] = "e142f9459507b97c5848042863b313ce70750118446bb4e35e5c07fe66007293"
+SRC_URI[md5sum] = "54a0bbbc9b67308e7c076622d02f0fcd"
+SRC_URI[sha256sum] = "cb94e315d0fc90c62db5a6c7829c9966f674285d99b3ba3ffa575fb4a26edc86"
 
 S = "${WORKDIR}/mariadb-${PV}"
 
@@ -48,7 +50,7 @@
 
 EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} setupdb"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb"
 PACKAGECONFIG_class-native = ""
 PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
 PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch
new file mode 100644
index 0000000..60e9199
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch
@@ -0,0 +1,28 @@
+From 5bc3e7ef9700d12054e0125a126f1bb093f01ef9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 26 Mar 2017 14:30:33 -0700
+Subject: [PATCH] disable ucontext on musl
+
+musl does not have *contex() APIs even though it has ucontext.h header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/my_context.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/my_context.h b/include/my_context.h
+index dd44103..9b28c17 100644
+--- a/include/my_context.h
++++ b/include/my_context.h
+@@ -31,7 +31,7 @@
+ #define MY_CONTEXT_USE_X86_64_GCC_ASM
+ #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
+ #define MY_CONTEXT_USE_I386_GCC_ASM
+-#elif defined(HAVE_UCONTEXT_H)
++#elif defined(__GLIBC__) && defined(HAVE_UCONTEXT_H)
+ #define MY_CONTEXT_USE_UCONTEXT
+ #else
+ #define MY_CONTEXT_DISABLE
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch
new file mode 100644
index 0000000..3e75b26
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch
@@ -0,0 +1,13 @@
+Index: mariadb-5.5.55/client/mysql.cc
+===================================================================
+--- mariadb-5.5.55.orig/client/mysql.cc
++++ mariadb-5.5.55/client/mysql.cc
+@@ -2850,7 +2850,7 @@ You can turn off this feature to get a q
+         mysql_free_result(fields);
+         break;
+       }
+-      field_names[i][num_fields*2]= '\0';
++      field_names[i][num_fields*2][0]= '\0';
+       j=0;
+       while ((sql_field=mysql_fetch_field(fields)))
+       {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.52.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.55.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.52.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.55.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch
deleted file mode 100644
index 0f224be..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -uNr nano-2.2.5.orig//configure.ac nano-2.2.5/configure.ac
---- nano-2.2.5.orig//configure.ac	2010-08-06 03:00:51.000000000 +0200
-+++ nano-2.2.5/configure.ac	2010-08-10 14:11:52.000000000 +0200
-@@ -442,7 +442,7 @@
-     AC_CHECK_HEADERS(ncurses.h)
- 
-     if test x$enable_utf8 != xno; then
--	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw $CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
-+	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
-     fi
- 
-     if eval "test x$CURSES_LIB_NAME = x"; then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
index 3fad029..22f0fb2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
@@ -5,15 +5,13 @@
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
 SECTION = "console/utils"
-DEPENDS = "ncurses"
+DEPENDS = "ncurses file"
 RDEPENDS_${PN} = "ncurses-terminfo"
 
-INC_PR = "r3"
+PV_MAJOR = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
-PV_MAJOR = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SRC_URI = "https://nano-editor.org/dist/v${PV_MAJOR}/nano-${PV}.tar.xz"
 
-SRC_URI = "ftp://nano-editor.org/pub/nano/v${PV_MAJOR}/nano-${PV}.tar.gz"
+inherit autotools gettext pkgconfig
 
-inherit autotools gettext
-
-PACKAGECONFIG[tiny] = "--enable-tiny,--enable-all,"
+PACKAGECONFIG[tiny] = "--enable-tiny,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb
deleted file mode 100644
index e656f46..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-include nano.inc
-
-PR = "${INC_PR}.0"
-
-SRC_URI += "file://ncursesw.includedir.patch"
-
-SRC_URI[md5sum] = "77a10a49589f975ce98350a4527a2ebf"
-SRC_URI[sha256sum] = "9015945d1badabbada203b37c4779d3dd1066234235c714deb439989c5cd7d9e"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb
new file mode 100644
index 0000000..eaf393e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb
@@ -0,0 +1,4 @@
+include nano.inc
+
+SRC_URI[md5sum] = "c011c7f9e47cb1da27d4e7cc8b56ec6a"
+SRC_URI[sha256sum] = "752170643039e2c95a433de357f0c70a8c4c4c561a90a7e7259a63e225b659b9"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch
new file mode 100644
index 0000000..9f2faaa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch
@@ -0,0 +1,44 @@
+From 8a0d1cbfcc0649b2696c9cf20f877366de259ce3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 12 Nov 2016 18:15:26 +0000
+Subject: [PATCH] CMakeLists.txt: Remove -mthumb-interwork
+
+This option is meaningless with aapcs ABI
+which is the default for Linux and android
+for armv7+ architectures
+
+As an aside it helps in compiling with clang
+where this option is absent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 784a5a8..68da920 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -117,7 +117,7 @@ if(ANDROID_PLATFORM)
+ 
+     # Adding cflags for armv7. Aarch64 does not need such flags.
+     if(${NE10_TARGET_ARCH} STREQUAL "armv7")
+-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=vfp3")
++        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=vfp3")
+         if(NE10_ARM_HARD_FLOAT)
+             # "--no-warn-mismatch" is needed for linker to suppress linker error about not all functions use VFP register to pass argument, eg.
+             #   .../arm-linux-androideabi/bin/ld: error: ..../test-float.o
+@@ -138,8 +138,8 @@ if(ANDROID_PLATFORM)
+     ${CMAKE_C_FLAGS}")
+ elseif(GNULINUX_PLATFORM)
+     if("${NE10_TARGET_ARCH}" STREQUAL "armv7")
+-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
+-      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
++      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
++      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=neon")
+       # Turn on asm optimization for Linux on ARM v7.
+       set(NE10_ASM_OPTIMIZATION on)
+     endif()
+-- 
+1.8.3.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch
new file mode 100644
index 0000000..a8fea82
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch
@@ -0,0 +1,38 @@
+From 66d332e4b631eef800c6f62cd347b164ee3b59d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Apr 2017 10:11:21 -0700
+Subject: [PATCH] Dont specify -march explicitly
+
+it assumes armv7-a for all armv7 based machines but that may
+not be true e.g. machines based on armv7ve and cortexa-7
+it causes conflicts in OE builds because it specifies -march
+in recipes anyway so this is redundant in CMakeLists.txt
+
+Fixes
+
+| cc1: warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
+| cc1: warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 68da920..a4b94b9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -138,8 +138,8 @@ if(ANDROID_PLATFORM)
+     ${CMAKE_C_FLAGS}")
+ elseif(GNULINUX_PLATFORM)
+     if("${NE10_TARGET_ARCH}" STREQUAL "armv7")
+-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
+-      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=neon")
++      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -mfpu=vfp3 -funsafe-math-optimizations")
++      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -mfpu=neon")
+       # Turn on asm optimization for Linux on ARM v7.
+       set(NE10_ASM_OPTIMIZATION on)
+     endif()
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
index de97982..e5b50ce 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
@@ -1,13 +1,17 @@
 DESCRIPTION = "Library containing NEON-optimized implementations for a common set of functions"
 HOMEPAGE = "http://projectne10.github.io/Ne10/"
 LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=463ac0a7d64edc2b787c4206635ca2b1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7fe20c9be97be5579e3ab5d92d3a218"
 SECTION = "libs"
 
-SRC_URI = "git://github.com/projectNe10/Ne10.git"
-SRCREV = "a08b29d88e3c94d32b5b8f827e7fcf0bc2b34ac2"
+SRC_URI = "git://github.com/projectNe10/Ne10.git \
+           file://0001-CMakeLists.txt-Remove-mthumb-interwork.patch \
+           file://0001-Dont-specify-march-explicitly.patch \
+           "
+SRCREV = "18c4c982a595dad069cd8df4932aefb1d257591f"
 
 S = "${WORKDIR}/git"
+PV .= "gitr+${SRCPV}"
 
 inherit cmake
 
@@ -18,10 +22,10 @@
 COMPATIBLE_MACHINE_armv7a = "(.*)"
 
 python () {
-    if any(t.startswith('armv7') for t in d.getVar('TUNE_FEATURES', True).split()):
+    if any(t.startswith('armv7') for t in d.getVar('TUNE_FEATURES').split()):
         d.setVar('NE10_TARGET_ARCH', 'armv7')
         bb.debug(2, 'Building Ne10 for armv7')
-    elif any(t.startswith('aarch64') for t in d.getVar('TUNE_FEATURES', True).split()):
+    elif any(t.startswith('aarch64') for t in d.getVar('TUNE_FEATURES').split()):
         d.setVar('NE10_TARGET_ARCH', 'aarch64')
         bb.debug(2, 'Building Ne10 for aarch64')
     else:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
index 2dc82a8..c90c819 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
@@ -26,3 +26,6 @@
 # if it isn't explicitly selected and "$build_os" == "$target_os", then configure will run
 # series of AC_TRY_RUN which won't work for cross-compilation and configure fails
 PACKAGECONFIG[double-precision] = "--enable-double-precision,--disable-double-precision"
+
+PNBLACKLIST[ode] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130599/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[ode] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130620/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
index c32668b..d3f2e78 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
@@ -18,4 +18,4 @@
 inherit autotools
 
 # http://errors.yoctoproject.org/Errors/Details/68667/
-PNBLACKLIST[open-vcdiff] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[open-vcdiff] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
index d4ad9c1..0f5568c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
@@ -24,7 +24,7 @@
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 SYSTEMD_SERVICE_${PN} += "openct.service "
 SYSTEMD_AUTO_ENABLE = "enable"
 
@@ -34,7 +34,7 @@
     --enable-pcsc \
     --enable-doc \
     --enable-api-doc \
-    --with-udev=/lib/udev \
+    --with-udev=${nonarch_base_libdir}/udev \
     --with-bundle=${libdir}/pcsc/drivers \
 "
 
@@ -42,7 +42,7 @@
 
 FILES_${PN} += " \
     ${libdir}/ctapi \
-    /lib/udev \
+    ${nonarch_base_libdir}/udev \
     ${libdir}/openct-ifd.so \
     ${libdir}/pcsc \
     /run/openct/status \
@@ -62,7 +62,7 @@
 do_install () {
     rm -rf ${D}
     install -d ${D}/etc
-    install -dm 755 ${D}/lib/udev
+    install -dm 755 ${D}${nonarch_base_libdir}/udev
     # fix up hardcoded paths
     sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
         ${WORKDIR}/openct.service ${WORKDIR}/openct.init
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
index b8e3a2d..107184b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
@@ -38,4 +38,4 @@
 FILES_${PN}-dev += "${datadir}/opencv/samples/*.c* ${datadir}/opencv/samples/*.vcp* ${datadir}/opencv/samples/build*"
 FILES_${PN} += "${bindir} ${datadir}/opencv"
 
-PNBLACKLIST[opencv-samples] ?= "Depends on blacklisted opencv"
+PNBLACKLIST[opencv-samples] ?= "Depends on blacklisted opencv - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
index d568018..1077d05 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
@@ -17,7 +17,7 @@
    endif()
  
 +  if(NOT DEFINED OPENCV_ICV_PATH)
-   set(OPENCV_ICV_UNPACK_PATH "${CMAKE_CURRENT_LIST_DIR}/unpack")
+   set(OPENCV_ICV_UNPACK_PATH "${CMAKE_BINARY_DIR}/3rdparty/ippicv")
    set(OPENCV_ICV_PATH "${OPENCV_ICV_UNPACK_PATH}${OPENCV_ICV_PACKAGE_SUBDIR}")
 +  endif()
  
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch
new file mode 100644
index 0000000..05ec41f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch
@@ -0,0 +1,26 @@
+From 49d1f7c40a5d097f23671318045ac54bc07846cf Mon Sep 17 00:00:00 2001
+From: Bian Naimeng <biannm@cn.fujitsu.com>
+Date: Wed, 19 Apr 2017 03:11:37 +0900
+Subject: [PATCH] Make opencv-ts create share library intead of static.
+
+Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
+---
+ modules/ts/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
+index bb56da2..7bb4ce9 100644
+--- a/modules/ts/CMakeLists.txt
++++ b/modules/ts/CMakeLists.txt
+@@ -4,7 +4,7 @@ if(IOS)
+   ocv_module_disable(ts)
+ endif()
+ 
+-set(OPENCV_MODULE_TYPE STATIC)
++#set(OPENCV_MODULE_TYPE STATIC)
+ set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
+ 
+ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
+-- 
+1.8.4.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
new file mode 100644
index 0000000..507d796
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
@@ -0,0 +1,27 @@
+From 69f9707678190f6a0948a547dce948251f972676 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Wed, 26 Apr 2017 14:57:30 -0400
+Subject: [PATCH 1/2] Revert "cuda: fix fp16 compilation"
+
+This reverts commit 12e00827be40576b686ea4438a6e6ef85208743d.
+---
+ modules/core/include/opencv2/core/cvdef.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index 699b166..efc24ca 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -303,8 +303,7 @@ enum CpuFeatures {
+ #define CV_2PI 6.283185307179586476925286766559
+ #define CV_LOG2 0.69314718055994530941723212145818
+ 
+-#if defined __ARM_FP16_FORMAT_IEEE \
+-    && !defined __CUDACC__
++#if defined (__ARM_FP16_FORMAT_IEEE)
+ #  define CV_FP16_TYPE 1
+ #else
+ #  define CV_FP16_TYPE 0
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch
new file mode 100644
index 0000000..820ab81
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch
@@ -0,0 +1,53 @@
+From db1d9cc82b68f6593360d66ef40cb6b0fc377e6e Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Fri, 19 May 2017 04:27:50 +0900
+Subject: [PATCH] To fix errors as following:
+
+"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'"
+"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'"
+"test_superres.cpp:270: undefined reference to `checkIppStatus()'"
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+---
+ modules/ts/include/opencv2/ts.hpp        | 4 ++--
+ modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp
+index c573905..7ff6cc1 100644
+--- a/modules/ts/include/opencv2/ts.hpp
++++ b/modules/ts/include/opencv2/ts.hpp
+@@ -539,7 +539,7 @@ protected:
+     }
+ };
+ 
+-extern uint64 param_seed;
++CV_EXPORTS extern uint64 param_seed;
+ 
+ struct CV_EXPORTS DefaultRngAuto
+ {
+@@ -602,7 +602,7 @@ void dumpOpenCLDevice();
+ #define TEST_DUMP_OCL_INFO
+ #endif
+ 
+-void parseCustomOptions(int argc, char **argv);
++CV_EXPORTS void parseCustomOptions(int argc, char **argv);
+ 
+ #define CV_TEST_MAIN(resourcesubdir, ...) \
+ int main(int argc, char **argv) \
+diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp
+index 05ccc63..8075065 100644
+--- a/modules/ts/include/opencv2/ts/ts_ext.hpp
++++ b/modules/ts/include/opencv2/ts/ts_ext.hpp
+@@ -9,7 +9,7 @@
+ #define OPENCV_TS_EXT_HPP
+ 
+ namespace cvtest {
+-void checkIppStatus();
++CV_EXPORTS void checkIppStatus();
+ }
+ 
+ #define CV_TEST_INIT \
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch
new file mode 100644
index 0000000..fba43eb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch
@@ -0,0 +1,243 @@
+From 69f86025978b9bbbefa54a7248316a859773aeaf Mon Sep 17 00:00:00 2001
+From: berak <px1704@web.de>
+Date: Sat, 4 Mar 2017 12:38:50 +0100
+Subject: [PATCH] tracking: make opencv_dnn dependancy optional
+
+Upstream-status: Backport [https://github.com/opencv/opencv_contrib/commit/43925b60d392fbd01d6b0449713f010f9babe448]
+Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
+
+---
+ modules/tracking/CMakeLists.txt                   |  3 +--
+ modules/tracking/samples/goturnTracker.cpp        | 22 +++++++++++++++++++---
+ modules/tracking/samples/multiTracker_dataset.cpp |  1 +
+ modules/tracking/samples/tracker_dataset.cpp      |  1 +
+ modules/tracking/src/gtrTracker.cpp               | 11 ++++++++++-
+ modules/tracking/src/gtrTracker.hpp               | 12 ++++++++----
+ modules/tracking/src/gtrUtils.cpp                 |  6 +++---
+ modules/tracking/src/gtrUtils.hpp                 |  5 ++---
+ modules/tracking/src/tracker.cpp                  |  1 +
+ 9 files changed, 46 insertions(+), 16 deletions(-)
+
+diff --git a/modules/tracking/CMakeLists.txt b/modules/tracking/CMakeLists.txt
+index a8b3183..d27f999 100644
+--- a/modules/tracking/CMakeLists.txt
++++ b/modules/tracking/CMakeLists.txt
+@@ -1,2 +1 @@
+-set(the_description "Tracking API")
+-ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui opencv_dnn opencv_plot OPTIONAL opencv_datasets WRAP python)
+\ No newline at end of file
++ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui opencv_plot OPTIONAL opencv_dnn opencv_datasets WRAP python)
+diff --git a/modules/tracking/samples/goturnTracker.cpp b/modules/tracking/samples/goturnTracker.cpp
+index 389771e..1e6632d 100644
+--- a/modules/tracking/samples/goturnTracker.cpp
++++ b/modules/tracking/samples/goturnTracker.cpp
+@@ -45,6 +45,9 @@
+ //1 - Train you own GOTURN model using <https://github.com/Auron-X/GOTURN_Training_Toolkit>
+ //2 - Download pretrained caffemodel from <https://github.com/opencv/opencv_extra>
+ 
++#include "opencv2/opencv_modules.hpp"
++#if defined(HAVE_OPENCV_DNN) && defined(HAVE_OPENCV_DATASETS)
++
+ #include "opencv2/datasets/track_alov.hpp"
+ #include <opencv2/core/utility.hpp>
+ #include <opencv2/tracking.hpp>
+@@ -65,8 +68,8 @@ static bool startSelection = false;
+ Rect2d boundingBox;
+ 
+ static const char* keys =
+-{ "{@dataset_path     |true| Dataset path     }"
+-"{@dataset_id     |1| Dataset ID     }"
++{ "{@dataset_path     || Dataset path   }"
++  "{@dataset_id      |1| Dataset ID     }"
+ };
+ 
+ static void onMouse(int event, int x, int y, int, void*)
+@@ -144,9 +147,14 @@ int main(int argc, char *argv[])
+     Ptr<cv::datasets::TRACK_alov> dataset = TRACK_alov::create();
+     dataset->load(datasetRootPath);
+     dataset->initDataset(datasetID);
+-
+     //Read first frame
+     dataset->getNextFrame(frame);
++    if (frame.empty())
++    {
++        cout << "invalid dataset: " << datasetRootPath << endl;
++        return -2;
++    }
++
+     frame.copyTo(image);
+     rectangle(image, boundingBox, Scalar(255, 0, 0), 2, 1);
+     imshow("GOTURN Tracking", image);
+@@ -215,3 +223,11 @@ int main(int argc, char *argv[])
+ 
+     return 0;
+ }
++
++#else // ! HAVE_OPENCV_DNN && HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
++int main() {
++    CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets and opencv_dnn !");
++    return -1;
++}
++#endif
+diff --git a/modules/tracking/samples/multiTracker_dataset.cpp b/modules/tracking/samples/multiTracker_dataset.cpp
+index 2826b19..b5c27da 100644
+--- a/modules/tracking/samples/multiTracker_dataset.cpp
++++ b/modules/tracking/samples/multiTracker_dataset.cpp
+@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
+ }
+ 
+ #else // ! HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
+ int main() {
+ 	CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
+ 	return -1;
+diff --git a/modules/tracking/samples/tracker_dataset.cpp b/modules/tracking/samples/tracker_dataset.cpp
+index 8b7832a..6178105 100644
+--- a/modules/tracking/samples/tracker_dataset.cpp
++++ b/modules/tracking/samples/tracker_dataset.cpp
+@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
+ 
+ 
+ #else // ! HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
+ int main() {
+ 	CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
+ 	return -1;
+diff --git a/modules/tracking/src/gtrTracker.cpp b/modules/tracking/src/gtrTracker.cpp
+index 58debfd..4904f47 100644
+--- a/modules/tracking/src/gtrTracker.cpp
++++ b/modules/tracking/src/gtrTracker.cpp
+@@ -38,7 +38,7 @@
+ // the use of this software, even if advised of the possibility of such damage.
+ //
+ //M*/
+-
++#include "opencv2/opencv_modules.hpp"
+ #include "gtrTracker.hpp"
+ 
+ 
+@@ -54,9 +54,16 @@ void TrackerGOTURN::Params::write(cv::FileStorage& /*fs*/) const {}
+ 
+ Ptr<TrackerGOTURN> TrackerGOTURN::createTracker(const TrackerGOTURN::Params &parameters)
+ {
++#ifdef HAVE_OPENCV_DNN
+     return Ptr<gtr::TrackerGOTURNImpl>(new gtr::TrackerGOTURNImpl(parameters));
++#else
++    (void)(parameters);
++    CV_ErrorNoReturn(cv::Error::StsNotImplemented , "to use GOTURN, the tracking module needs to be built with opencv_dnn !");
++#endif
+ }
+ 
++
++#ifdef HAVE_OPENCV_DNN
+ namespace gtr
+ {
+ 
+@@ -183,9 +190,11 @@ bool TrackerGOTURNImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
+     //Set new model image and BB from current frame
+     ((TrackerGOTURNModel*)static_cast<TrackerModel*>(model))->setImage(curFrame);
+     ((TrackerGOTURNModel*)static_cast<TrackerModel*>(model))->setBoudingBox(curBB);
++
+     return true;
+ }
+ 
+ }
++#endif // OPENCV_HAVE_DNN
+ 
+ }
+diff --git a/modules/tracking/src/gtrTracker.hpp b/modules/tracking/src/gtrTracker.hpp
+index 34f2c48..21ae3d9 100644
+--- a/modules/tracking/src/gtrTracker.hpp
++++ b/modules/tracking/src/gtrTracker.hpp
+@@ -45,11 +45,15 @@
+ 
+ #include "precomp.hpp"
+ #include "opencv2/video/tracking.hpp"
+-#include "opencv2/dnn.hpp"
+ #include "gtrUtils.hpp"
+ #include "opencv2/imgproc.hpp"
+-#include<algorithm>
+-#include<limits.h>
++
++#include <algorithm>
++#include <limits.h>
++
++#include "opencv2/opencv_modules.hpp"
++#ifdef HAVE_OPENCV_DNN
++#include "opencv2/dnn.hpp"
+ 
+ namespace cv
+ {
+@@ -72,5 +76,5 @@ public:
+ 
+ }
+ }
+-
++#endif
+ #endif
+diff --git a/modules/tracking/src/gtrUtils.cpp b/modules/tracking/src/gtrUtils.cpp
+index 0df1197..e80dda1 100644
+--- a/modules/tracking/src/gtrUtils.cpp
++++ b/modules/tracking/src/gtrUtils.cpp
+@@ -58,7 +58,7 @@ double generateRandomLaplacian(double b, double m)
+         return m - b*log(n);
+ }
+ 
+-Rect2f anno2rect(vector<Point2f> annoBB)
++Rect2f anno2rect(std::vector<Point2f> annoBB)
+ {
+     Rect2f rectBB;
+     rectBB.x = min(annoBB[0].x, annoBB[1].x);
+@@ -69,9 +69,9 @@ Rect2f anno2rect(vector<Point2f> annoBB)
+     return rectBB;
+ }
+ 
+-vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB)
++std::vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB)
+ {
+-    vector <TrainingSample> trainingSamples;
++    std::vector <TrainingSample> trainingSamples;
+     Point2f currCenter, prevCenter;
+     Rect2f targetPatchRect, searchPatchRect;
+     Mat targetPatch, searchPatch;
+diff --git a/modules/tracking/src/gtrUtils.hpp b/modules/tracking/src/gtrUtils.hpp
+index 8f388be..41aad21 100644
+--- a/modules/tracking/src/gtrUtils.hpp
++++ b/modules/tracking/src/gtrUtils.hpp
+@@ -4,7 +4,6 @@
+ #include "precomp.hpp"
+ #include <vector>
+ #include "opencv2/highgui.hpp"
+-#include <opencv2/datasets/track_alov.hpp>
+ 
+ namespace cv
+ {
+@@ -50,10 +49,10 @@ struct TrainingSample
+ double generateRandomLaplacian(double b, double m);
+ 
+ //Convert ALOV300++ anno coordinates to Rectangle BB
+-Rect2f anno2rect(vector<Point2f> annoBB);
++Rect2f anno2rect(std::vector<Point2f> annoBB);
+ 
+ //Gather samples from random video frame
+-vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB);
++std::vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB);
+ 
+ }
+ }
+diff --git a/modules/tracking/src/tracker.cpp b/modules/tracking/src/tracker.cpp
+index 8127f2a..b96aca8 100644
+--- a/modules/tracking/src/tracker.cpp
++++ b/modules/tracking/src/tracker.cpp
+@@ -112,6 +112,7 @@ Ptr<Tracker> Tracker::create( const String& trackerType )
+   BOILERPLATE_CODE("TLD",TrackerTLD);
+   BOILERPLATE_CODE("KCF",TrackerKCF);
+   BOILERPLATE_CODE("GOTURN", TrackerGOTURN);
++
+   return Ptr<Tracker>();
+ }
+ 
+-- 
+2.9.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
new file mode 100644
index 0000000..d1950a9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
@@ -0,0 +1,245 @@
+From 9108e39e5584ef9b41f80751639b4ec72b3e9538 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Wed, 26 Apr 2017 15:00:32 -0400
+Subject: [PATCH 2/2] Revert "check FP16 build condition correctly"
+
+This reverts commit c7cb116dc08441fe56cf82d5b21f929e5b674c13.
+
+Fix up revert conflicts to take previous behaviour.
+---
+ cmake/OpenCVCompilerOptions.cmake         | 45 +++++++++--------------
+ modules/core/include/opencv2/core/cvdef.h |  2 +-
+ modules/core/src/convert.cpp              | 11 +++---
+ modules/core/test/test_intrin.cpp         | 60 ++++++++++++++-----------------
+ 4 files changed, 48 insertions(+), 70 deletions(-)
+
+diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
+index 5bb0479..4b19fdb 100644
+--- a/cmake/OpenCVCompilerOptions.cmake
++++ b/cmake/OpenCVCompilerOptions.cmake
+@@ -185,7 +185,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+     add_extra_compiler_option("-mfp16-format=ieee")
+   endif(ARM)
+   if(ENABLE_NEON)
+-    add_extra_compiler_option("-mfpu=neon")
++    add_extra_compiler_option("-mfpu=neon-fp16")
+   endif()
+   if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
+     add_extra_compiler_option("-mfpu=vfpv3")
+@@ -370,34 +370,6 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_OPENCV_GCC_VERSION_NUM GREATER 399)
+   add_extra_compiler_option(-fvisibility-inlines-hidden)
+ endif()
+ 
+-if(NOT OPENCV_FP16_DISABLE AND NOT IOS)
+-  if(ARM AND ENABLE_NEON)
+-    set(FP16_OPTION "-mfpu=neon-fp16")
+-  elseif((X86 OR X86_64) AND NOT MSVC AND ENABLE_AVX)
+-    set(FP16_OPTION "-mf16c")
+-  endif()
+-  try_compile(__VALID_FP16
+-    "${OpenCV_BINARY_DIR}"
+-    "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
+-    COMPILE_DEFINITIONS "-DCHECK_FP16" "${FP16_OPTION}"
+-    OUTPUT_VARIABLE TRY_OUT
+-    )
+-  if(NOT __VALID_FP16)
+-    if((X86 OR X86_64) AND NOT MSVC AND NOT ENABLE_AVX)
+-      # GCC enables AVX when mf16c is passed
+-      message(STATUS "FP16: Feature disabled")
+-    else()
+-      message(STATUS "FP16: Compiler support is not available")
+-    endif()
+-  else()
+-    message(STATUS "FP16: Compiler support is available")
+-    set(HAVE_FP16 1)
+-    if(NOT ${FP16_OPTION} STREQUAL "")
+-      add_extra_compiler_option(${FP16_OPTION})
+-    endif()
+-  endif()
+-endif()
+-
+ #combine all "extra" options
+ set(CMAKE_C_FLAGS           "${CMAKE_C_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}")
+@@ -450,6 +422,21 @@ if(MSVC)
+   endif()
+ endif()
+ 
++if(NOT OPENCV_FP16_DISABLE)
++  try_compile(__VALID_FP16
++    "${OpenCV_BINARY_DIR}"
++    "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
++    COMPILE_DEFINITIONS "-DCHECK_FP16"
++    OUTPUT_VARIABLE TRY_OUT
++    )
++  if(NOT __VALID_FP16)
++    message(STATUS "FP16: Compiler support is not available")
++  else()
++    message(STATUS "FP16: Compiler support is available")
++    set(HAVE_FP16 1)
++  endif()
++endif()
++
+ if(APPLE AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{LDFLAGS} AND EXISTS "/usr/local/lib")
+   link_directories("/usr/local/lib")
+ endif()
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index efc24ca..a10936b 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -312,7 +312,7 @@ enum CpuFeatures {
+ typedef union Cv16suf
+ {
+     short i;
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && !defined (__CUDACC__) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+     __fp16 h;
+ #endif
+     struct _fp16Format
+diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp
+index e04d89e..46db26f 100644
+--- a/modules/core/src/convert.cpp
++++ b/modules/core/src/convert.cpp
+@@ -44,7 +44,6 @@
+ #include "precomp.hpp"
+ 
+ #include "opencl_kernels_core.hpp"
+-#include "opencv2/core/hal/intrin.hpp"
+ 
+ #include "opencv2/core/openvx/ovx_defs.hpp"
+ 
+@@ -4382,7 +4381,7 @@ struct Cvt_SIMD<float, int>
+ 
+ #endif
+ 
+-#if !CV_FP16_TYPE
++#if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) )
+ // const numbers for floating points format
+ const unsigned int kShiftSignificand    = 13;
+ const unsigned int kMaskFp16Significand = 0x3ff;
+@@ -4390,7 +4389,7 @@ const unsigned int kBiasFp16Exponent    = 15;
+ const unsigned int kBiasFp32Exponent    = 127;
+ #endif
+ 
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+ static float convertFp16SW(short fp16)
+ {
+     // Fp16 -> Fp32
+@@ -4452,7 +4451,7 @@ static float convertFp16SW(short fp16)
+ }
+ #endif
+ 
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+ static short convertFp16SW(float fp32)
+ {
+     // Fp32 -> Fp16
+@@ -4560,7 +4559,7 @@ cvtScaleHalf_<float, short>( const float* src, size_t sstep, short* dst, size_t
+             if ( ( (intptr_t)dst & 0xf ) == 0 )
+ #endif
+             {
+-#if CV_FP16 && CV_SIMD128
++#if CV_FP16
+                 for ( ; x <= size.width - 4; x += 4)
+                 {
+                     v_float32x4 v_src = v_load(src + x);
+@@ -4606,7 +4605,7 @@ cvtScaleHalf_<short, float>( const short* src, size_t sstep, float* dst, size_t
+             if ( ( (intptr_t)src & 0xf ) == 0 )
+ #endif
+             {
+-#if CV_FP16 && CV_SIMD128
++#if CV_FP16
+                 for ( ; x <= size.width - 4; x += 4)
+                 {
+                     v_float16x4 v_src = v_load_f16(src + x);
+diff --git a/modules/core/test/test_intrin.cpp b/modules/core/test/test_intrin.cpp
+index 66b2083..7349d48 100644
+--- a/modules/core/test/test_intrin.cpp
++++ b/modules/core/test/test_intrin.cpp
+@@ -729,56 +729,48 @@ template<typename R> struct TheTest
+         return *this;
+     }
+ 
++#if CV_FP16
+     TheTest & test_loadstore_fp16()
+     {
+-#if CV_FP16
+         AlignedData<R> data;
+         AlignedData<R> out;
+ 
+-        if(checkHardwareSupport(CV_CPU_FP16))
+-        {
+-            // check if addresses are aligned and unaligned respectively
+-            EXPECT_EQ((size_t)0, (size_t)&data.a.d % 16);
+-            EXPECT_NE((size_t)0, (size_t)&data.u.d % 16);
+-            EXPECT_EQ((size_t)0, (size_t)&out.a.d % 16);
+-            EXPECT_NE((size_t)0, (size_t)&out.u.d % 16);
+-
+-            // check some initialization methods
+-            R r1 = data.u;
+-            R r2 = v_load_f16(data.a.d);
+-            R r3(r2);
+-            EXPECT_EQ(data.u[0], r1.get0());
+-            EXPECT_EQ(data.a[0], r2.get0());
+-            EXPECT_EQ(data.a[0], r3.get0());
+-
+-            // check some store methods
+-            out.a.clear();
+-            v_store_f16(out.a.d, r1);
+-            EXPECT_EQ(data.a, out.a);
+-        }
++        // check if addresses are aligned and unaligned respectively
++        EXPECT_EQ((size_t)0, (size_t)&data.a.d % 16);
++        EXPECT_NE((size_t)0, (size_t)&data.u.d % 16);
++        EXPECT_EQ((size_t)0, (size_t)&out.a.d % 16);
++        EXPECT_NE((size_t)0, (size_t)&out.u.d % 16);
++
++        // check some initialization methods
++        R r1 = data.u;
++        R r2 = v_load_f16(data.a.d);
++        R r3(r2);
++        EXPECT_EQ(data.u[0], r1.get0());
++        EXPECT_EQ(data.a[0], r2.get0());
++        EXPECT_EQ(data.a[0], r3.get0());
++
++        // check some store methods
++        out.a.clear();
++        v_store_f16(out.a.d, r1);
++        EXPECT_EQ(data.a, out.a);
+ 
+         return *this;
+-#endif
+     }
+ 
+     TheTest & test_float_cvt_fp16()
+     {
+-#if CV_FP16
+         AlignedData<v_float32x4> data;
+ 
+-        if(checkHardwareSupport(CV_CPU_FP16))
+-        {
+-            // check conversion
+-            v_float32x4 r1 = v_load(data.a.d);
+-            v_float16x4 r2 = v_cvt_f16(r1);
+-            v_float32x4 r3 = v_cvt_f32(r2);
+-            EXPECT_EQ(0x3c00, r2.get0());
+-            EXPECT_EQ(r3.get0(), r1.get0());
+-        }
++        // check conversion
++        v_float32x4 r1 = v_load(data.a.d);
++        v_float16x4 r2 = v_cvt_f16(r1);
++        v_float32x4 r3 = v_cvt_f32(r2);
++        EXPECT_EQ(0x3c00, r2.get0());
++        EXPECT_EQ(r3.get0(), r1.get0());
+ 
+         return *this;
+-#endif
+     }
++#endif
+ 
+ };
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch
deleted file mode 100644
index 5d0bf97..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
-index 28ccc1c6be4f..b0e1cbf77287 100644
---- a/cmake/OpenCVPCHSupport.cmake
-+++ b/cmake/OpenCVPCHSupport.cmake
-@@ -19,7 +19,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
-         ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
-         OUTPUT_VARIABLE gcc_compiler_version)
-     #MESSAGE("GCC Version: ${gcc_compiler_version}")
--    IF(gcc_compiler_version VERSION_GREATER "4.2.-1")
-+    IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
-         SET(PCHSupport_FOUND TRUE)
-     ENDIF()
- 
-diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
-index 3a23cd73633d..1fea1578b1d9 100644
---- a/cmake/OpenCVUtils.cmake
-+++ b/cmake/OpenCVUtils.cmake
-@@ -76,7 +76,11 @@ function(ocv_include_directories)
-     if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
-       list(APPEND __add_before "${dir}")
-     else()
--      include_directories(AFTER SYSTEM "${dir}")
-+	    if (gcc_compiler_version VERSION_LESS "6.0.0")
-+		    include_directories(AFTER SYSTEM "${dir}")
-+	    else()
-+		    include_directories(AFTER "${dir}")
-+	    endif()
-     endif()
-   endforeach()
-   include_directories(BEFORE ${__add_before})
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
new file mode 100644
index 0000000..a2db48d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
@@ -0,0 +1,12 @@
+diff --git a/modules/xfeatures2d/CMakeLists.txt b/modules/xfeatures2d/CMakeLists.txt
+index f295bddaed66..6086e75ec37b 100644
+--- a/modules/xfeatures2d/CMakeLists.txt
++++ b/modules/xfeatures2d/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection")
+ ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml
+                   OPTIONAL opencv_cudaarithm WRAP python java)
+-include(cmake/download_vgg.cmake)
+-include(cmake/download_boostdesc.cmake)
++#include(cmake/download_vgg.cmake)
++#include(cmake/download_boostdesc.cmake)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch
new file mode 100644
index 0000000..3068bd4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch
@@ -0,0 +1,13 @@
+diff --git a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
+index eb2a729cc2eb..8717736484de 100644
+--- a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
++++ b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
+@@ -24,7 +24,7 @@ if(NOT BUILD_PROTOBUF AND NOT (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF
+   find_package(Protobuf QUIET)
+ endif()
+ 
+-if(PROTOBUF_FOUND)
++if(PROTOBUF_FOUND OR (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
+   # nothing
+ else()
+   include(${CMAKE_CURRENT_LIST_DIR}/download_protobuf.cmake)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
index ced066f..d17c640 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
@@ -65,12 +65,12 @@
     do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
     do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
 
-    pn = d.getVar('PN', 1)
+    pn = d.getVar('PN')
     metapkg =  pn + '-dev'
     d.setVar('ALLOW_EMPTY_' + metapkg, "1")
     blacklist = [ metapkg ]
     metapkg_rdepends = [ ]
-    packages = d.getVar('PACKAGES', 1).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages[1:]:
         if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
             metapkg_rdepends.append(pkg)
@@ -103,4 +103,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/40660/
-PNBLACKLIST[opencv] ?= "Not compatible with currently used ffmpeg 3"
+PNBLACKLIST[opencv] ?= "Not compatible with currently used ffmpeg 3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb
deleted file mode 100644
index 1bbb965..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb
+++ /dev/null
@@ -1,150 +0,0 @@
-SUMMARY = "Opencv : The Open Computer Vision Library"
-HOMEPAGE = "http://opencv.org/"
-SECTION = "libs"
-
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0ea90d28b4de883d7af5e6711f14f7bf"
-
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-DEFAULT_PREFERENCE = "-1"
-
-DEPENDS = "python-numpy libtool swig swig-native python bzip2 zlib glib-2.0 libwebp protobuf protobuf-native"
-
-SRCREV_opencv = "92387b1ef8fad15196dd5f7fb4931444a68bc93a"
-SRCREV_contrib = "5409d5ad560523c85c6796cc5a009347072d883c"
-SRCREV_party3 = "81a676001ca8075ada498583e4166079e5744668"
-IPP_MD5 = "808b791a6eac9ed78d32a7666804320e"
-
-SRCREV_FORMAT = "opencv"
-SRC_URI = "git://github.com/Itseez/opencv.git;name=opencv \
-    git://github.com/Itseez/opencv_contrib.git;destsuffix=contrib;name=contrib \
-    git://github.com/Itseez/opencv_3rdparty.git;branch=ippicv/master_20151201;destsuffix=party3;name=party3 \
-    file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
-    file://fixgcc60.patch \
-    file://fixpkgconfig.patch \
-"
-
-PV = "3.1+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-do_unpack_extra() {
-    tar xzf ${WORKDIR}/party3/ippicv/ippicv_linux_20151201.tgz -C ${WORKDIR}
-}
-addtask unpack_extra after do_unpack before do_patch
-
-EXTRA_OECMAKE = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include \
-    -DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
-    -DWITH_1394=OFF \
-    -DCMAKE_SKIP_RPATH=ON \
-    -DOPENCV_ICV_PACKAGE_DOWNLOADED=${IPP_MD5} \
-    -DOPENCV_ICV_PATH=${WORKDIR}/ippicv_lnx \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
-    ${@base_conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
-    ${@base_conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
-"
-EXTRA_OECMAKE_append_x86 = " -DX86=ON"
-
-PACKAGECONFIG ??= "eigen jpeg png tiff v4l libv4l gstreamer samples tbb  gphoto2 \
-    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
-    ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
-
-PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
-PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
-PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen,"
-PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
-PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
-PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
-PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
-PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
-PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
-PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
-PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers,"
-PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
-PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
-PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
-PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
-PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
-PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
-
-inherit distutils-base pkgconfig cmake
-
-export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
-export PYTHON="${STAGING_BINDIR_NATIVE}/python"
-export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
-export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
-
-TARGET_CC_ARCH += "-I${S}/include "
-
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java-dbg ${PN}-java', '', d)} \
-    ${PN}-samples-dbg ${PN}-samples ${PN}-apps python-opencv"
-
-python populate_packages_prepend () {
-    cv_libdir = d.expand('${libdir}')
-    cv_libdir_dbg = d.expand('${libdir}/.debug')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
-    do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
-
-    pn = d.getVar('PN', 1)
-    metapkg =  pn + '-dev'
-    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
-    blacklist = [ metapkg ]
-    metapkg_rdepends = [ ]
-    packages = d.getVar('PACKAGES', 1).split()
-    for pkg in packages[1:]:
-        if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
-            metapkg_rdepends.append(pkg)
-    d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
-
-    metapkg =  pn
-    blacklist = [ metapkg ]
-    metapkg_rdepends = [ ]
-    for pkg in packages[1:]:
-        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale'):
-            metapkg_rdepends.append(pkg)
-    bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
-
-}
-
-PACKAGES_DYNAMIC += "^libopencv-.*"
-
-FILES_${PN} = ""
-FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
-FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig ${datadir}/OpenCV/*.cmake ${datadir}/OpenCV/3rdparty/${baselib}/*.a"
-FILES_${PN}-doc = "${datadir}/OpenCV/doc"
-FILES_${PN}-java = "${datadir}/OpenCV/java"
-FILES_${PN}-java-dbg = "${datadir}/OpenCV/java/.debug/"
-FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
-FILES_${PN}-samples-dbg = "${datadir}/OpenCV/samples/bin/.debug"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-INSANE_SKIP_${PN}-java = "libdir"
-INSANE_SKIP_${PN}-java-dbg = "libdir"
-
-ALLOW_EMPTY_${PN} = "1"
-
-SUMMARY_python-opencv = "Python bindings to opencv"
-FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
-RDEPENDS_python-opencv = "python-core python-numpy"
-
-do_install_append() {
-    cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
-    sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
-
-    # Move Python files into correct library folder (for multilib build)
-    if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
-        mv ${D}/usr/lib/* ${D}/${libdir}/
-        rm -rf ${D}/usr/lib
-    fi
-
-    if ${@bb.utils.contains("PACKAGECONFIG", "samples", "true", "false", d)}; then
-        install -d ${D}${datadir}/OpenCV/samples/bin/
-        cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
-    fi
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb
new file mode 100644
index 0000000..535c761
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb
@@ -0,0 +1,175 @@
+SUMMARY = "Opencv : The Open Computer Vision Library"
+HOMEPAGE = "http://opencv.org/"
+SECTION = "libs"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2b2f8752cc5edf504d283107d033f544"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"
+
+SRCREV_opencv = "70bbf17b133496bd7d54d034b0f94bd869e0e810"
+SRCREV_contrib = "86342522b0eb2b16fa851c020cc4e0fef4e010b7"
+SRCREV_ipp = "81a676001ca8075ada498583e4166079e5744668"
+SRCREV_bootdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
+SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
+IPP_MD5 = "808b791a6eac9ed78d32a7666804320e"
+
+SRCREV_FORMAT = "opencv"
+SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
+    git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \
+    git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20151201;destsuffix=ipp;name=ipp \
+    git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=bootdesc;name=bootdesc \
+    git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
+    file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
+    file://fixpkgconfig.patch \
+    file://uselocalxfeatures.patch;patchdir=../contrib/ \
+    file://useoeprotobuf.patch;patchdir=../contrib/ \
+    file://0001-Revert-cuda-fix-fp16-compilation.patch \
+    file://0002-Revert-check-FP16-build-condition-correctly.patch \
+    file://0001-Make-opencv-ts-create-share-library-intead-of-static.patch \
+    file://0001-To-fix-errors-as-following.patch \
+    file://0001-tracking-make-opencv_dnn-dependancy-optional.patch;patchdir=../contrib/ \
+"
+
+PV = "3.2+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+do_unpack_extra() {
+    tar xzf ${WORKDIR}/ipp/ippicv/ippicv_linux_20151201.tgz -C ${WORKDIR}
+    cp ${WORKDIR}/vgg/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
+    cp ${WORKDIR}/bootdesc/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
+}
+addtask unpack_extra after do_unpack before do_patch
+
+EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
+    -DWITH_1394=OFF \
+    -DCMAKE_SKIP_RPATH=ON \
+    -DOPENCV_ICV_PACKAGE_DOWNLOADED=${IPP_MD5} \
+    -DOPENCV_ICV_PATH=${WORKDIR}/ippicv_lnx \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
+    ${@base_conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
+    ${@base_conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
+"
+EXTRA_OECMAKE_append_x86 = " -DX86=ON"
+
+PACKAGECONFIG ??= "python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
+    ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
+
+PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
+PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
+PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DUPDATE_PROTO_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native,"
+PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog,"
+PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype,"
+PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
+PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
+PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
+PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
+PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native,"
+PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
+PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
+PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
+PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd,"
+PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
+PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
+PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy,"
+PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy,"
+PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
+PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
+PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
+PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
+PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
+
+inherit pkgconfig cmake
+
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'distutils3-base', '', d)}
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)}
+
+export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
+export PYTHON="${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}"
+export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
+export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native"
+export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
+
+TARGET_CC_ARCH += "-I${S}/include "
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \
+    ${PN}-apps"
+
+python populate_packages_prepend () {
+    cv_libdir = d.expand('${libdir}')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
+    do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
+
+    pn = d.getVar('PN')
+    metapkg =  pn + '-dev'
+    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+    blacklist = [ metapkg ]
+    metapkg_rdepends = [ ]
+    packages = d.getVar('PACKAGES').split()
+    for pkg in packages[1:]:
+        if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
+            metapkg_rdepends.append(pkg)
+    d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
+
+    metapkg =  pn
+    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+    blacklist = [ metapkg ]
+    metapkg_rdepends = [ ]
+    for pkg in packages[1:]:
+        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
+            metapkg_rdepends.append(pkg)
+    d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
+
+}
+
+PACKAGES_DYNAMIC += "^libopencv-.*"
+
+FILES_${PN} = ""
+FILES_${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*"
+FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig ${datadir}/OpenCV/*.cmake"
+FILES_${PN}-staticdev += "${datadir}/OpenCV/3rdparty/lib/*.a"
+FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
+FILES_${PN}-java = "${datadir}/OpenCV/java"
+FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
+
+INSANE_SKIP_${PN}-java = "libdir"
+INSANE_SKIP_${PN}-dbg = "libdir"
+
+ALLOW_EMPTY_${PN} = "1"
+
+SUMMARY_python-opencv = "Python bindings to opencv"
+FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS_python-opencv = "python-core python-numpy"
+
+SUMMARY_python3-opencv = "Python bindings to opencv"
+FILES_python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS_python3-opencv = "python3-core python3-numpy"
+
+do_install_append() {
+    cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
+    sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
+
+    # Move Python files into correct library folder (for multilib build)
+    if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
+        mv ${D}/usr/lib/* ${D}/${libdir}/
+        rm -rf ${D}/usr/lib
+    fi
+
+    if ${@bb.utils.contains("PACKAGECONFIG", "samples", "true", "false", d)}; then
+        install -d ${D}${datadir}/OpenCV/samples/bin/
+        cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
+    fi
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
new file mode 100644
index 0000000..d4e02be
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
@@ -0,0 +1,25 @@
+Do not install pyc and pyo for python module
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ swig/python/Makefile.am | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/swig/python/Makefile.am b/swig/python/Makefile.am
+index da95a81..97a62bf 100644
+--- a/swig/python/Makefile.am
++++ b/swig/python/Makefile.am
+@@ -33,8 +33,6 @@ CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py OpenIPMI.pyo OpenIPMI.pyc
+ install-exec-local: _OpenIPMI.la OpenIPMI.py OpenIPMI.pyc OpenIPMI.pyo
+ 	$(INSTALL) -d $(DESTDIR)$(PYTHON_INSTALL_DIR)
+ 	$(INSTALL_DATA) OpenIPMI.py "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+-	$(INSTALL_DATA) OpenIPMI.pyc "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+-	$(INSTALL_DATA) OpenIPMI.pyo "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+ 	if test "x$(PYTHON_GUI_DIR)" = "xopenipmigui"; then \
+ 	    $(INSTALL) -d $(DESTDIR)$(bindir); \
+ 	    $(INSTALL_SCRIPT) $(srcdir)/openipmigui.py "$(DESTDIR)$(bindir)/openipmigui";\
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
new file mode 100644
index 0000000..9a568b2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
@@ -0,0 +1,22 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date:   Thu Jun 7 16:00:13 2012 -0400
+
+    This patch fixes the error during the install stage when
+    creating a symbolic link for opeipmish in openipmi/cmdlang
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/cmdlang/Makefile.am b/cmdlang/Makefile.am
+index 92d6e83..f6039f9 100644
+--- a/cmdlang/Makefile.am
++++ b/cmdlang/Makefile.am
+@@ -36,6 +36,7 @@ CLEANFILES = libOpenIPMIcmdlang.map
+ # compatability.
+ install-data-local:
+ 	rm -f $(DESTDIR)$(bindir)/ipmish
++	mkdir -p $(DESTDIR)$(bindir)/
+ 	$(LN_S) openipmish $(DESTDIR)$(bindir)/ipmish
+ 
+ uninstall-local:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch
new file mode 100644
index 0000000..58ec5d8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch
@@ -0,0 +1,17 @@
+include sys/types.h for u_int32_t
+
+ui.c:340:5: error: unknown type name 'u_int32_t'; did you mean 'uint32_t'?
+     u_int32_t     addr;
+     ^~~~~~~~~
+Index: OpenIPMI-2.0.22/ui/ui.c
+===================================================================
+--- OpenIPMI-2.0.22.orig/ui/ui.c
++++ OpenIPMI-2.0.22/ui/ui.c
+@@ -42,6 +42,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <ctype.h>
+ 
+ #include <OpenIPMI/selector.h>
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
new file mode 100644
index 0000000..51a398b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
@@ -0,0 +1,41 @@
+Subject: [PATCH] ipmi-init: fix the arguments
+
+The functions success/failure/warning defined in /etc/init.d/functions
+(provided by initscripts) only accepts numeric argument as return code,
+not a string.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ ipmi.init | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ipmi.init b/ipmi.init
+index 2ebcd94..d8161c5 100644
+--- a/ipmi.init
++++ b/ipmi.init
+@@ -45,17 +45,17 @@ elif [ -r /etc/init.d/functions ]; then
+ 	case "$ACTION" in
+ 	    success)
+ 		echo -n $*
+-		success "$*"
++		success 0
+ 		echo
+ 		;;
+ 	    failure)
+ 		echo -n $*
+-		failure "$*"
++		failure 1
+ 		echo
+ 		;;
+ 	    warning)
+ 		echo -n $*
+-		warning "$*"
++		warning 0
+ 		echo
+ 		;;
+ 	    *)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service
new file mode 100644
index 0000000..6fe1378
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=IPMI Driver
+After=network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/openipmi-helper start
+ExecStop=@LIBEXECDIR@/openipmi-helper stop-all
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch
new file mode 100644
index 0000000..271c532
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile.am, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/swig/perl/Makefile.am b/swig/perl/Makefile.am
+index 2f9ee4c..3a18892 100644
+--- a/swig/perl/Makefile.am
++++ b/swig/perl/Makefile.am
+@@ -20,7 +20,7 @@ OpenIPMI_SRC = OpenIPMI_perl.c
+ OpenIPMI_OBJ = OpenIPMI_wrap.lo OpenIPMI_perl.lo
+ 
+ OpenIPMI.so: $(OpenIPMI_OBJ)
+-	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
++	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version $(LDFLAGS) -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
+ 	rm -f OpenIPMI.so
+ 	mv .libs/OpenIPMI.so .
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch
new file mode 100644
index 0000000..ee3c660
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch
@@ -0,0 +1,32 @@
+From bbd51cf010c80322034f7094e2c6a656aa1f17a7 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 13 Feb 2015 06:55:33 +0000
+Subject: [PATCH] openipmi: don't rm .libs
+
+Don't remove .libs after OpenIPMI.so generated, this may cause
+dummystuff.so fails to link from the second build with error:
+
+* error: .libs/dummystuff.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ swig/perl/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/swig/perl/Makefile.am b/swig/perl/Makefile.am
+index 12a282c..2f9ee4c 100644
+--- a/swig/perl/Makefile.am
++++ b/swig/perl/Makefile.am
+@@ -23,7 +23,6 @@ OpenIPMI.so: $(OpenIPMI_OBJ)
+ 	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
+ 	rm -f OpenIPMI.so
+ 	mv .libs/OpenIPMI.so .
+-	rm -rf .libs
+ 
+ dummystuff.lo: dummystuff.c
+ 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper
new file mode 100755
index 0000000..4cebfb9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper
@@ -0,0 +1,512 @@
+#!/bin/sh
+#############################################################################
+#
+# ipmi:		OpenIPMI Driver helper script
+#
+# Authors:	Jan Safranek <jsafrane@redhat.com>
+#
+# Based on IPMI init script by:
+#               Matt Domsch <Matt_Domsch@dell.com>
+#               Chris Poblete <Chris_Poblete@dell.com>
+#
+# Status return code bits
+# no bits set = no errors
+# bit 0 set = minimum modules aren't loaded
+# bit 1 set = requested feature module isn't loaded
+# bit 2 set = /dev/ipmi0 (or /dev/imb if using that instead) doesn't exist
+# bit 3 set = /dev/watchdog doesn't exist
+# bit 4 set = lockfile doesn't exist
+# bit 5 set = modules are loaded even when asked to be unloaded
+
+CONFIGFILE=/etc/sysconfig/ipmi
+# source config info
+[ -r ${CONFIGFILE} ] && . ${CONFIGFILE}
+
+#############################################################################
+# GLOBALS
+#############################################################################
+MODULE_NAME="ipmi"
+INTF_NUM=0
+
+IPMI_SMB_MODULE_NAME="ipmi_smb"
+IPMI_SI_MODULE_NAME="ipmi_si"
+kernel=`uname -r | cut -d. -f1-2`
+if [ "${kernel}" == "2.4" ]; then
+    IPMI_SMB_MODULE_NAME="ipmi_smb_intf"
+    IPMI_SI_MODULE_NAME="ipmi_si_drv"
+fi
+
+MODULES_INTERFACES=""
+[ "${DEV_IPMI}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_devintf"
+[ "${IPMI_IMB}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_imb"
+
+MODULES_FEATURES=""
+[ "${IPMI_WATCHDOG}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_watchdog"
+[ "${IPMI_POWEROFF}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_poweroff"
+
+MODULES_HW=""
+[ "${IPMI_SI}"  = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SI_MODULE_NAME}"
+[ "${IPMI_SMB}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SMB_MODULE_NAME}"
+
+MODULES_BASE="ipmi_msghandler"
+MODULES="${MODULES_INTERFACES} ${MODULES_FEATURES} ${MODULES_HW} ${MODULES_BASE}"
+
+RETVAL=0
+LOCKFILE=/var/lock/subsys/ipmi
+DEV_IPMI_TIMEOUT=150
+
+UDEV_EXISTS=0
+if [ -e /sbin/udev -o -e /sbin/udevd ]; then
+    UDEV_EXISTS=1
+fi
+
+#############################################################################
+# NOTES:
+# * /dev/ipmi0 is unconditionally deleted here on ipmi_devintf unload,
+#   because SLES9 and RHEL4 kernels don't send a message for udev to delete
+#   it for us.
+# 
+#############################################################################
+
+modules_loaded_verbose()
+{
+	OnePlusLoaded=0
+	OnePlusUnloaded=0
+	for m in $@; do
+		if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+			echo "$m module loaded."
+			OnePlusLoaded=1
+		else
+			echo "$m module not loaded."
+			OnePlusUnloaded=1
+		fi
+	done
+}
+
+modules_loaded()
+{
+	OnePlusLoaded=0
+	OnePlusUnloaded=0
+	for m in $@; do
+		if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+			OnePlusLoaded=1
+		else
+			OnePlusUnloaded=1
+		fi
+	done
+}
+
+device_node_exists ()
+{
+	if [ -e "$1" ]; then
+		echo "$1 exists."
+		return 1
+	fi
+	echo "$1 does not exist."
+	return 0
+}
+
+minimum_modules_loaded()
+{
+        rc_base=1
+	rc_hw=1
+        modules_loaded_verbose "${MODULES_BASE}"
+	[ ${OnePlusLoaded} -eq 0 ] && rc_base=0
+	    
+	modules_loaded_verbose "${MODULES_HW}"
+	[ ${OnePlusLoaded} -eq 0 ] && rc_hw=0
+	
+	return $((rc_base && rc_hw))
+}
+
+#############################################################################
+
+load_si()
+{
+	if [ "${IPMI_SI}" = "yes" ]; then
+		modprobe ${IPMI_SI_MODULE_NAME} > /dev/null 2>&1
+		modules_loaded ${IPMI_SI_MODULE_NAME}
+		[ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+	fi
+}
+
+load_smb()
+{
+	if [ "${IPMI_SMB}" = "yes" ]; then
+		modprobe ${IPMI_SMB_MODULE_NAME} > /dev/null 2>&1
+		modules_loaded ${IPMI_SMB_MODULE_NAME}
+		[ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+	fi
+}
+
+load_hw_modules()
+{
+	load_si
+	load_smb
+}
+
+start_watchdog_common()
+{
+	load_hw_modules
+	modprobe ipmi_watchdog ${IPMI_WATCHDOG_OPTIONS} > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	[ ${OnePlusUnloaded} -ne 0 ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Watchdog startup failed: cannot load ipmi_watchdog module" &&
+		return
+	if [ ${UDEV_EXISTS} -eq 0 -a ! -e /dev/watchdog ]; then
+		mknod -m 0600 /dev/watchdog c 10 130
+		[ $? -ne 0 ] &&
+			RETVAL=$((RETVAL | 8)) &&
+			echo "Watchdog startup failed: cannot create /dev/watchdog" &&
+			return
+	fi
+}
+
+start_watchdog_quiet()
+{
+	[ "${IPMI_WATCHDOG}" != "yes" ] &&
+		return
+	start_watchdog_common
+}
+
+start_watchdog()
+{
+	[ "${IPMI_WATCHDOG}" != "yes" ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Watchdog not configured" &&
+		return
+	start_watchdog_common
+}
+
+stop_watchdog()
+{
+	modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	    echo "Watchog shutdown failed: cannot unload ipmi_watchdog module"
+	else
+	    if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+		[ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+	    fi
+	fi
+}
+
+stop_watchdog_quiet()
+{
+	modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	else
+	    if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+		[ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+	    fi
+	fi
+}
+
+start_powercontrol_common()
+{
+	local poweroff_opts=""
+	load_hw_modules
+	if [ "${IPMI_POWERCYCLE}" == "yes" ]; then
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_control > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_control=2"
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_powercycle > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_powercycle=1"
+	fi
+	modprobe ipmi_poweroff "${poweroff_opts}" > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	[ ${OnePlusUnloaded} -ne 0 ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Powercontroll startup failed: cannot load ipmi_poweroff module" &&
+		return
+}
+
+start_powercontrol_quiet()
+{
+	[ "${IPMI_POWEROFF}" != "yes" ] &&
+		return
+	start_powercontrol_common
+}
+
+start_powercontrol()
+{
+	[ "${IPMI_POWEROFF}" != "yes" ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Powercontroll not configured" &&
+		return
+	start_powercontrol_common
+}
+
+stop_powercontrol()
+{
+	modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	    echo "Powercontroll shutdown failed: cannot unload ipmi_poweroff module"
+	fi
+}
+
+stop_powercontrol_quiet()
+{
+	modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	[ ${OnePlusLoaded} -ne 0 ] && RETVAL=$((RETVAL | 32))
+}
+
+#############################################################################
+unload_all_ipmi_modules()
+{
+	stop_watchdog_quiet
+	stop_powercontrol_quiet
+	for m in ${MODULES}; do
+		modprobe -q -r ${m} > /dev/null 2>&1
+	done
+        # delete interface node ONLY if ipmi_devintf is unloaded
+        [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+	        rm -f "/dev/ipmi${INTF_NUM}"
+}
+
+unload_ipmi_modules_leave_features()
+{
+	for m in ${MODULES_INTERFACES}; do
+		modprobe -q -r ${m} > /dev/null 2>&1
+	done
+        # delete interface node ONLY if ipmi_devintf is unloaded
+        [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+	        rm -f "/dev/ipmi${INTF_NUM}"
+	lsmod | egrep -q "ipmi_(poweroff|watchdog)" > /dev/null 2>&1
+	if [ "$?" -ne "0" ]; then
+		stop_watchdog_quiet
+		stop_powercontrol_quiet
+		for m in ${MODULES}; do
+			modprobe -q -r ${m} > /dev/null 2>&1
+		done
+	fi
+}
+
+#############################################################################
+load_ipmi_modules ()
+{
+	local locdelay
+	modprobe ipmi_msghandler > /dev/null 2>&1
+	modules_loaded ipmi_msghandler
+	[ ${OnePlusLoaded} -ne 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+	load_hw_modules
+	[ $((RETVAL & 1)) -eq 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+
+	if [ "${DEV_IPMI}" = "yes" ]; then
+		modprobe ipmi_devintf > /dev/null 2>&1
+		modules_loaded ipmi_devintf
+		RETVAL=$((RETVAL & ~2))
+		[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+		if [ ${OnePlusLoaded} -eq 1 ]; then
+			if [ ${UDEV_EXISTS} -eq 0 ]; then
+				DEVMAJOR=`cat /proc/devices | awk '/ipmidev/{print $1}'`
+				rm -f /dev/ipmi${INTF_NUM}
+				mknod -m 0600 /dev/ipmi${INTF_NUM} c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+			fi
+
+			# udev can take several seconds to create /dev/ipmi0, 
+			# but it happens asynchronously, so delay here
+			locdelay=${DEV_IPMI_TIMEOUT}
+			while [ ! -e /dev/ipmi${INTF_NUM} -a ${locdelay} -gt 0 ]; do
+				locdelay=$((locdelay - 1))
+				sleep 0.1
+			done
+		fi
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+		modprobe ipmi_imb > /dev/null 2>&1
+		modules_loaded ipmi_imb
+		RETVAL=$((RETVAL & ~2))
+		[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+		if [ ${OnePlusLoaded} -eq 1 ]; then
+			DEVMAJOR=`cat /proc/devices | awk '/imb/{print $1}'`
+			rm -f /dev/imb
+			mknod -m 0600 /dev/imb c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+		fi
+	fi
+
+	# Per Corey Minyard, essentially no one uses ipmi_radisys
+	# and we don't want to encourage its further use
+	# so it won't be handled here.
+	return
+}
+
+#############################################################################
+start()
+{
+	load_ipmi_modules
+	if [ ${RETVAL} -eq 0 ]; then
+		touch ${LOCKFILE}
+	else
+		if [ $((RETVAL & 1)) -eq 1 ]; then
+			echo "Startup failed."
+		else
+			touch ${LOCKFILE} && echo "Warning!?"
+		fi
+	fi
+	start_watchdog_quiet
+	start_powercontrol_quiet
+}
+
+#############################################################################
+stop()
+{
+	unload_ipmi_modules_leave_features
+	modules_loaded ${MODULES_INTERFACES}
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+		RETVAL=$((RETVAL | 32))
+		echo "Shutdown failed, something may be in use"
+	else
+		rm -f ${LOCKFILE}
+	fi
+}
+
+stop_all()
+{
+	unload_all_ipmi_modules
+	modules_loaded ${MODULES}
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+		RETVAL=$((RETVAL | 32))
+		echo "Shutdown failed, something may be in use"
+	else
+		rm -f ${LOCKFILE}
+	fi
+}
+
+#############################################################################
+restart()
+{
+	stop_all
+	RETVAL=0
+	start
+}
+
+#############################################################################
+
+reload()
+{
+	stop_all
+	RETVAL=0
+	start
+}
+
+#############################################################################
+
+status_all()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+	
+	modules_loaded_verbose ${MODULES_FEATURES} ${MODULES_INTERFACES}
+	[ ${OnePlusUnloaded} -ne 0 ] && RETVAL=$((RETVAL | 2))
+
+	if [ "${DEV_IPMI}" = "yes" ]; then 
+	    device_node_exists /dev/ipmi${INTF_NUM}
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+	    device_node_exists /dev/imb
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+	    device_node_exists /dev/watchdog
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+	fi
+
+	[ ! -e ${LOCKFILE} ] && RETVAL=$((RETVAL | 16))
+}
+
+status()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+	
+	if [ "${DEV_IPMI}" = "yes" ]; then 
+	    modules_loaded_verbose ipmi_devintf
+	    [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+	    device_node_exists /dev/ipmi${INTF_NUM}
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+	    device_node_exists /dev/imb
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+}
+
+status_watchdog()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+	modules_loaded_verbose ipmi_watchdog
+	[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+	device_node_exists /dev/watchdog
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+}
+
+status_powercontrol()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+	modules_loaded_verbose ipmi_powercontrol
+	[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+}
+
+#############################################################################
+usage ()
+{
+	echo $"Usage: $0 {start|stop|status" 1>&2
+	echo $"          restart|condrestart|try-restart|reload|force-reload" 1>&2
+	echo $"          start-watchdog|stop-watchdog|status-watchdog" 1>&2
+	echo $"          start-powercontrol|stop-powercontrol|status-powercontrol" 1>&2
+	echo $"          stop-all|status-all}" 1>&2
+	RETVAL=2
+}
+
+condrestart ()
+{
+	[ -e ${LOCKFILE} ] && restart
+}
+
+#############################################################################
+# MAIN
+#############################################################################
+case "$1" in
+	start) start ;;
+	stop)  stop ;;
+	restart) restart ;;
+	force-reload) reload ;;
+	reload) reload ;;
+	status)	status ;;
+	status-all) status_all ;;
+	condrestart) condrestart ;;
+	try-restart) condrestart ;;
+	start-watchdog) start_watchdog ;;
+	stop-watchdog) stop_watchdog ;;
+	status-watchdog) status_watchdog ;;
+	start-powercontrol) start_powercontrol ;;
+	stop-powercontrol) stop_powercontrol ;;
+	status-powercontrol) status_powercontrol ;;
+	stop-all) stop_all ;;
+	*) usage ;;
+esac
+
+exit ${RETVAL}
+
+#############################################################################
+# end of file
+#############################################################################
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
new file mode 100644
index 0000000..1fa68f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
@@ -0,0 +1,26 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date:   Thu Jun 7 12:28:34 2012 -0400
+
+    This patch was carried over from WRL4.3 (openipmi v2.0.16)
+    
+    It was updated for openipmi v2.0.19
+    
+    Disable making openipmigui man page since we don't need it
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+    Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 632f55b..5ce79f5 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -1,6 +1,6 @@
+ 
+ man_MANS = ipmi_ui.1 openipmicmd.1 openipmish.1 ipmi_cmdlang.7 \
+-	openipmigui.1 openipmi_conparms.7 solterm.1 rmcp_ping.1 \
++	openipmi_conparms.7 solterm.1 rmcp_ping.1 \
+ 	openipmi_eventd.1
+ 
+ EXTRA_DIST = $(man_MANS)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
new file mode 100644
index 0000000..6f16234
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
@@ -0,0 +1,85 @@
+From aa0dc0783a6ff5fb56c914b640836223e3c192bb Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 29 Dec 2014 18:16:04 +0800
+Subject: [PATCH] remove host path from la_LDFLAGS
+
+Upstream-Status: Inappropriate [ cross compile specific ]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ cmdlang/Makefile.am |    2 +-
+ glib/Makefile.am    |    4 ++--
+ tcl/Makefile.am     |    2 +-
+ unix/Makefile.am    |    4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/cmdlang/Makefile.am b/cmdlang/Makefile.am
+index 00c3d2b..0fa85d7 100644
+--- a/cmdlang/Makefile.am
++++ b/cmdlang/Makefile.am
+@@ -16,7 +16,7 @@ libOpenIPMIcmdlang_la_LIBADD = -lm \
+ 	$(top_builddir)/utils/libOpenIPMIutils.la \
+ 	$(top_builddir)/lib/libOpenIPMI.la
+ libOpenIPMIcmdlang_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIcmdlang.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIcmdlang.map
+ 
+ bin_PROGRAMS = openipmish
+ 
+diff --git a/glib/Makefile.am b/glib/Makefile.am
+index 671cae2..eff55f3 100644
+--- a/glib/Makefile.am
++++ b/glib/Makefile.am
+@@ -11,14 +11,14 @@ libOpenIPMIglib_la_SOURCES = glib_os_hnd.c
+ libOpenIPMIglib_la_CFLAGS = $(GLIB_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMIglib_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMIglib_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIglib.map $(GLIB_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMIglib.map $(GLIB_LIBS) \
+ 	-rpath $(libdir)
+ 
+ libOpenIPMIglib12_la_SOURCES = glib_os_hnd.c
+ libOpenIPMIglib12_la_CFLAGS = $(GLIB12_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMIglib12_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMIglib12_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIglib12.map $(GLIB12_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMIglib12.map $(GLIB12_LIBS) \
+ 	-rpath $(libdir)
+ 
+ CLEANFILES = libOpenIPMIglib.map libOpenIPMIglib12.map
+diff --git a/tcl/Makefile.am b/tcl/Makefile.am
+index b702819..282619c 100644
+--- a/tcl/Makefile.am
++++ b/tcl/Makefile.am
+@@ -11,7 +11,7 @@ libOpenIPMItcl_la_SOURCES = tcl_os_hnd.c
+ libOpenIPMItcl_la_CFLAGS = $(TCL_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMItcl_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMItcl_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMItcl.map $(TCL_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMItcl.map $(TCL_LIBS) \
+ 	-rpath $(libdir)
+ 
+ noinst_PROGRAMS = test_handlers
+diff --git a/unix/Makefile.am b/unix/Makefile.am
+index a792147..a108bc6 100644
+--- a/unix/Makefile.am
++++ b/unix/Makefile.am
+@@ -11,13 +11,13 @@ libOpenIPMIpthread_la_SOURCES = posix_thread_os_hnd.c selector.c
+ libOpenIPMIpthread_la_LIBADD = -lpthread $(GDBM_LIB) \
+ 	$(top_builddir)/utils/libOpenIPMIutils.la
+ libOpenIPMIpthread_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIpthread.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIpthread.map
+ 
+ libOpenIPMIposix_la_SOURCES = posix_os_hnd.c selector.c
+ libOpenIPMIposix_la_LIBADD = $(top_builddir)/utils/libOpenIPMIutils.la \
+ 	$(GDBM_LIB)
+ libOpenIPMIposix_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIposix.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIposix.map
+ 
+ noinst_HEADERS = heap.h
+ 
+-- 
+1.7.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb
new file mode 100644
index 0000000..9f4b0ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb
@@ -0,0 +1,112 @@
+SUMMARY = "IPMI (Intelligent Platform Management Interface) library and tools"
+DESCRIPTION = "OpenIPMI is an effort to create a full-function IPMI system, \
+to allow full access to all IPMI information on a server \
+and to abstract it to a level that will make it easy to use"
+
+HOMEPAGE = "http://openipmi.sourceforge.net"
+
+DEPENDS = " \
+    glib-2.0 \
+    ncurses \
+    net-snmp \
+    openssl \
+    popt \
+    python \
+    swig-native \
+    "
+
+LICENSE = "GPLv2 & LGPLv2.1 & BSD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://COPYING.BSD;md5=4b318d4160eb69c8ee53452feb1b4cdf \
+                    "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openipmi/OpenIPMI-${PV}.tar.gz \
+           file://fix-symlink-install-error-in-cmdlang.patch \
+           file://openipmi-no-openipmigui-man.patch \
+           file://openipmi-remove-host-path-from-la_LDFLAGS.patch \
+           file://openipmi-don-t-rm-.libs.patch \
+           file://ipmi-init-fix-the-arguments.patch \
+           file://makefile-add-ldflags.patch \
+           file://do-not-install-pyc-and-pyo.patch \
+           file://include_sys_types.patch \
+           file://openipmi-helper \
+           file://ipmi.service \
+           "
+
+SRC_URI[md5sum] = "9a4e1f6bb073379c494839201ea10aee"
+SRC_URI[sha256sum] = "4988900043c35fcfa9b2bf275d6593904f6429221befb770ba6ecb5502108e55"
+
+S = "${WORKDIR}/OpenIPMI-${PV}"
+
+inherit autotools-brokensep pkgconfig pythonnative perlnative update-rc.d systemd
+
+EXTRA_OECONF = "--disable-static \
+                --with-perl='${STAGING_BINDIR_NATIVE}/perl-native/perl' \
+                --with-python='${STAGING_BINDIR_NATIVE}/python-native/python' \
+                --with-pythoninstall='${PYTHON_SITEPACKAGES_DIR}' \
+                --with-glibver=2.0 --with-glib12=no"
+
+PACKAGECONFIG ??= "gdbm"
+PACKAGECONFIG[gdbm] = "ac_cv_header_gdbm_h=yes,ac_cv_header_gdbm_h=no,gdbm,"
+
+PACKAGES += "${PN}-perl ${PN}-python"
+
+FILES_${PN}-perl = " \
+    ${libdir}/perl/vendor_perl/*/OpenIPMI.pm \
+    ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/OpenIPMI.so \
+    "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+FILES_${PN}-dbg += " \
+    ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/.debug \
+    ${PYTHON_SITEPACKAGES_DIR}/.debug \
+    "
+
+do_configure () {
+
+    # Let's perform regular configuration first then handle perl issues.
+    autotools_do_configure
+
+    perl_ver=`perl -V:version | cut -d\' -f 2`
+    
+    # Force openipmi perl bindings to be compiled using perl-native instead of
+    # the host's perl. Set the proper install directory for the resulting
+    # openipmi.pm and openipmi.so
+    for i in ${S}/swig/Makefile ${S}/swig/perl/Makefile; do
+        echo "SAL: i = $i"
+        echo "SAL: STAGING_INCDIR_NATIVE = $STAGING_INCDIR_NATIVE"
+        echo "SAL: libdir = $libdir"
+        sed -i -e "/^PERL_CFLAGS/s:-I/usr/local/include:-I${STAGING_INCDIR_NATIVE}:g" $i
+        sed -i -e "/^PERL_INSTALL_DIR/s:^PERL_INSTALL_DIR = .*:PERL_INSTALL_DIR = ${libdir}/perl/vendor_perl/$perl_ver:g" $i
+    done
+}
+
+do_install_append () {
+    echo "SAL: D = $D"
+    echo "SAL: libdir = $libdir"
+    install -m 0755 -d ${D}${sysconfdir}/sysconfig ${D}${sysconfdir}/init.d
+    install -m 0755 ${S}/ipmi.init ${D}${sysconfdir}/init.d/ipmi
+    install -m 0644 ${S}/ipmi.sysconf ${D}${sysconfdir}/sysconfig/ipmi
+    # SAL: mv: cannot stat `/localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/openipmi-2.0.19-r4/image/usr/lib64/perl5': No such file or directory
+    # SAL: real path to perl is /localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/perl-5.14.2-r8.3/package/usr/lib64/perl5 and it is a symlink to perl so no need to mv.
+    if [ -d ${D}${libdir}/perl5 ]
+    then
+        mv ${D}${libdir}/perl5 ${D}${libdir}/perl
+    fi
+ 
+    # for systemd
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0664 ${WORKDIR}/ipmi.service ${D}${systemd_unitdir}/system
+    sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/ipmi.service
+    install -d ${D}${libexecdir}
+    install -m 0755 ${WORKDIR}/openipmi-helper ${D}${libexecdir}
+}
+
+INITSCRIPT_NAME = "ipmi"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "ipmi.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
index 05ffc5c..f5c233f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
@@ -14,7 +14,7 @@
 "
 SECTION = "libs"
 
-LDAP_VER = "${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+LDAP_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 
 SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${BP}.tgz \
     file://openldap-m4-pthread.patch \
@@ -54,7 +54,7 @@
 
 PACKAGECONFIG ??= "gnutls modules \
                    mdb ldap meta monitor null passwd shell proxycache dnssrv \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 #--with-tls              with TLS/SSL support auto|openssl|gnutls [auto]
 PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls libgcrypt"
@@ -150,7 +150,7 @@
 # it was disabled for cross-compiling.
 CPPFLAGS_append = " -D_GNU_SOURCE -DURANDOM_DEVICE=\'/dev/urandom\' -fPIC"
 
-LDFLAGS += "-pthread"
+LDFLAGS_append = " -pthread"
 
 do_configure() {
     cp ${STAGING_DATADIR_NATIVE}/libtool/build-aux/ltmain.sh ${S}/build
@@ -242,7 +242,7 @@
     d.setVar('ALLOW_EMPTY_' + metapkg, "1")
     d.setVar('FILES_' + metapkg, "")
     metapkg_rdepends = []
-    packages = d.getVar('PACKAGES', 1).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages[1:]:
         if pkg.count("openldap-backend-") and not pkg in metapkg_rdepends and not pkg.count("-dev") and not pkg.count("-dbg") and not pkg.count("static") and not pkg.count("locale"):
             metapkg_rdepends.append(pkg)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
index 2baeda0..35c39cb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
@@ -7,7 +7,7 @@
 
 PR = "r3"
 
-PNBLACKLIST[openmotif] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[openmotif] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://motif.ics.com/sites/default/files/openmotif-2.3.3.tar.gz \
            file://configure.patch;patch=1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
index bd15bba..8c948c5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
@@ -15,7 +15,7 @@
 
 inherit cmake pkgconfig
 
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
 
 PACKAGES += "${PN}-tools"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
index f5896e6..e914238 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
@@ -93,7 +93,7 @@
     touch ${D}/var/lib/openwbem/{classassociation,instances,instassociation,namespaces,schema}.{dat,ndx,lock}
 }
 
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 SYSTEMD_SERVICE_${PN} = "owcimomd.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 FILES_${PN} += " \
@@ -112,4 +112,4 @@
 "
 
 # http://errors.yoctoproject.org/Errors/Details/68630/
-PNBLACKLIST[openwbem] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[openwbem] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb
deleted file mode 100644
index d2a76c0..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "Lightweight and minimal (~20K) dumb-terminal emulation program"
-SECTION = "console/utils"
-LICENSE = "GPLv2+"
-HOMEPAGE = "http://code.google.com/p/picocom/"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=393a5ca445f6965873eca0259a17f833"
-
-SRC_URI = "http://picocom.googlecode.com/files/picocom-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "8eaba1d31407e8408674d6e57af447ef"
-SRC_URI[sha256sum] = "d0f31c8f7a215a76922d30c81a52b9a2348c89e02a84935517002b3bc2c1129e"
-
-EXTRA_OEMAKE = "'CC=${CC}' 'LD=${LD}' 'VERSION=${PV}' \
-		'CFLAGS=${CFLAGS}' 'LDFLAGS=${LDFLAGS}' "
-
-do_install () {
-    install -d ${D}${bindir}
-    install -m 0755 ${BPN} pcasc pcxm pcym pczm ${D}${bindir}/
-}
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb
new file mode 100644
index 0000000..e091094
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Lightweight and minimal (~20K) dumb-terminal emulation program"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+HOMEPAGE = "http://code.google.com/p/picocom/"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3000e4830620e310fe65c0eb69df9e8a"
+
+BASEPV = "2.2"
+PV = "${BASEPV}+git${SRCPV}"
+
+SRCREV = "deffd18c24145bd6f965f44e735a50b65810ccdc"
+
+SRC_URI = "git://github.com/npat-efault/picocom"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'LD=${CC}' 'VERSION=${BASEPV}' \
+		'CFLAGS=${CFLAGS}' 'LDFLAGS=${LDFLAGS}' "
+
+do_install () {
+    install -d ${D}${bindir}
+    install -m 0755 ${BPN} pcasc pcxm pcym pczm ${D}${bindir}/
+}
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
index b884b5a..47cdc72 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
@@ -4,7 +4,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=92fe174bad6da3763f6e9e9eaff6df24"
 DEPENDS = "libgcrypt libotr pidgin intltool-native"
 
-PNBLACKLIST[pidgin-otr] ?= "depends on blacklisted pidgin"
+PNBLACKLIST[pidgin-otr] ?= "depends on blacklisted pidgin - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://www.cypherpunks.ca/otr/${BP}.tar.gz \
            file://ignore_extra-portability_warnings.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
index e997146..462e21c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
@@ -2,7 +2,7 @@
 SECTION = "x11/network"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-DEPENDS = "python virtual/libintl intltool-native libxml2 gconf"
+DEPENDS = "python virtual/libintl intltool-native libxml2 gconf glib-2.0-native"
 
 inherit autotools gettext pkgconfig gconf perlnative
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
new file mode 100644
index 0000000..2d0ea02
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
@@ -0,0 +1,60 @@
+From 6245f18091cad11520c159248c1cf7a84f12857c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:15:43 -0700
+Subject: [PATCH] make: Respect variables from environement
+
+link with shared zlib
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.unx | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.unx b/Makefile.unx
+index 772da46..4ae7061 100644
+--- a/Makefile.unx
++++ b/Makefile.unx
+@@ -24,18 +24,16 @@ ZINC = -I$(ZPATH)
+ ZLIB = $(ZPATH)/libz.a
+ 
+ INCS = $(ZINC)
+-LIBS = $(ZLIB)
++LIBS = -lz
+ 
+-CC = gcc
+-LD = gcc
+-RM = rm
+-CFLAGS = -O -Wall $(INCS) -DUSE_ZLIB
++CC ?= gcc
++LD ?= gcc
++RM ?= rm
++CFLAGS += -O -Wall $(INCS) -DUSE_ZLIB
+ # [note that -Wall is a gcc-specific compilation flag ("all warnings on")]
+ O = .o
+ E =
+ 
+-LDFLAGS =
+-
+ PROG = pngcheck
+ PROG2 = pngsplit
+ PROG3 = png-fix-IDAT-windowsize
+@@ -57,13 +55,13 @@ EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E)
+ all:  $(EXES)
+ 
+ $(PROG)$(E): $(PROG).c
+-	$(CC) $(CFLAGS) -o $@ $(PROG).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(PROG).c $(LDFLAGS) $(LIBS)
+ 
+ $(PROG2)$(E): gpl/$(PROG2).c
+-	$(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LDFLAGS) $(LIBS)
+ 
+ $(PROG3)$(E): gpl/$(PROG3).c
+-	$(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LDFLAGS) $(LIBS)
+ 
+ 
+ # maintenance ---------------------------------------------------------------
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
new file mode 100644
index 0000000..6d4465f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
@@ -0,0 +1,36 @@
+From d4d8257953bd1e7be167aed24c0578362cc5f675 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:12:30 -0700
+Subject: [PATCH 1/2] png-fix-IDAT-windowsize: Fix format string errors in
+ fprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gpl/png-fix-IDAT-windowsize.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gpl/png-fix-IDAT-windowsize.c b/gpl/png-fix-IDAT-windowsize.c
+index 6d4ef9c..d212017 100644
+--- a/gpl/png-fix-IDAT-windowsize.c
++++ b/gpl/png-fix-IDAT-windowsize.c
+@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
+             fprintf(stderr, "  Compiled with zlib %s; using zlib %s.\n",
+               ZLIB_VERSION, zlib_version);
+             fprintf(stderr, "\n");
+-            fprintf(stderr, png_fix_IDAT_windowsize_usage);
++            fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+             fflush(stderr);
+             return 1;
+         }
+@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
+     fflush(stdout);
+ 
+     if ( argn == argc ) {
+-        fprintf(stderr, png_fix_IDAT_windowsize_usage);
++        fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+         fflush(stderr);
+         return 5;
+     } else {
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
new file mode 100644
index 0000000..f2c8668
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
@@ -0,0 +1,40 @@
+From: Jari Aalto <jari.aalto@cante.net>
+Subject: Correct fomat strings fro hardened build flags
+
+---
+ gpl/pngsplit.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/gpl/pngsplit.c
++++ b/gpl/pngsplit.c
+@@ -141,8 +141,8 @@
+                   0 == strncmp( argv[argn], "-quiet", 2 ) )
+             verbose = 0;
+         else {
+-            fprintf(stderr, pngsplit_hdr);
+-            fprintf(stderr, pngsplit_usage);
++            fprintf(stderr, "%s", pngsplit_hdr);
++            fprintf(stderr, "%s", pngsplit_usage);
+             fflush(stderr);
+             return 1;
+         }
+@@ -150,8 +150,8 @@
+     }
+ 
+     if ( argn == argc ) {
+-        fprintf(stderr, pngsplit_hdr);
+-        fprintf(stderr, pngsplit_usage);
++        fprintf(stderr, "%s", pngsplit_hdr);
++        fprintf(stderr, "%s", pngsplit_usage);
+         fflush(stderr);
+         return 5;
+     } else {
+@@ -162,7 +162,7 @@
+ 
+     /*=============================  MAIN LOOP  =============================*/
+ 
+-    fprintf(stdout, pngsplit_hdr);
++    fprintf(stdout, "%s", pngsplit_hdr);
+     fflush(stdout);
+ 
+     while (argn <= argc) {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
index 6d0dfff..9f617ec 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
@@ -4,15 +4,21 @@
 LIC_FILES_CHKSUM = "file://gpl/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 DEPENDS = "zlib libpng"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+           file://10-pngsplit-format-strings.patch \
+           file://0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch \
+           file://0001-make-Respect-variables-from-environement.patch \
+           "
 
 SRC_URI[md5sum] = "980bd6d9a3830fdce746d7fe3c9166ee"
 SRC_URI[sha256sum] = "77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+CFLAGS += "-DUSE_ZLIB"
+
+EXTRA_OEMAKE = "-f ${S}/Makefile.unx"
 
 do_compile() {
-    oe_runmake -f Makefile.unx INCS=-I${STAGING_DIR_HOST}${incdir} LIBS='${STAGING_DIR_HOST}${libdir}/libz.a ${LDFLAGS}'
+    oe_runmake
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb
similarity index 80%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb
index 0fc50e1..1b83735 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb
@@ -12,15 +12,16 @@
 
 BBCLASSEXTEND = "native"
 
-SRCREV = "7dfdcfb70d75ccdaaf2b43fa0b23f82599aebec3"
+SRCREV = "aae9c2e0f64caf019d31ba8f97635d5656b25ba5"
 SRC_URI = " \
-    git://github.com/pocoproject/poco.git \
+    git://github.com/pocoproject/poco.git;branch=poco-${PV} \
     file://run-ptest \
    "
 
 S = "${WORKDIR}/git"
 
 EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
+                  -DZLIB_LIBRARY_RELEASE:STRING=z -DPCRE_LIBRARY:STRING=pcre \
                  ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
 
 # For the native build we want to use the bundled version
@@ -34,16 +35,16 @@
 # these don't have dependencies outside oe-core
 PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto Data DataSQLite Zip"
 
-PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat"
+PACKAGECONFIG[XML] = "-DENABLE_XML=ON -DEXPAT_LIBRARY:STRING=expat,-DENABLE_XML=OFF,expat"
 PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
 PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
 PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
 PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
 PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
-PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl"
-PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
+PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_NETSSL=OFF,openssl"
+PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_CRYPTO=OFF,openssl"
 PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
-PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON,-DENABLE_DATA_SQLITE=OFF,sqlite3"
+PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
 PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
 
 # Additional components not build by default,
@@ -51,7 +52,7 @@
 # or they don't work on all architectures
 PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
 PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
-PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON,-DENABLE_DATA_MYSQL=OFF,mariadb"
+PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
 PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
 PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
 PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
@@ -62,12 +63,12 @@
 python __anonymous () {
     packages = []
     testrunners = []
-    components = d.getVar("PACKAGECONFIG", True).split()
+    components = d.getVar("PACKAGECONFIG").split()
     components.append("Foundation")
     for lib in components:
         pkg = ("poco-%s" % lib.lower()).replace("_","")
         packages.append(pkg)
-        if not d.getVar("FILES_%s" % pkg, True):
+        if not d.getVar("FILES_%s" % pkg):
             d.setVar("FILES_%s" % pkg, "${libdir}/libPoco%s.so.*" % lib)
         testrunners.append("%s" % lib)
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb
similarity index 84%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb
index 071cfb2..c1bfb31 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb
@@ -7,8 +7,8 @@
     file://0001-add-manadatory-options-to-find-qt4-qt5-moc.patch \
     file://0002-fix-gcc-6-math-ambiguous-errors.patch \
 "
-SRC_URI[md5sum] = "669b195ff24173d35cacf1d20b6fe4fa"
-SRC_URI[sha256sum] = "b872e7228fc34a71ce4b47a5aea2a57ae67528818fa846e1e0eda089319bd242"
+SRC_URI[md5sum] = "943679f1030b9bc19a989f24121a282a"
+SRC_URI[sha256sum] = "592bf72960c6b5948b67657594b05e72d9a278daf7613c9f3cdff9a5b73096a8"
 
 DEPENDS = "fontconfig zlib cairo lcms"
 
@@ -20,12 +20,11 @@
 PACKAGECONFIG[tiff] = "--enable-libtiff,--disable-libtiff,tiff"
 PACKAGECONFIG[curl] = "--enable-libcurl,--disable-libcurl,curl"
 PACKAGECONFIG[openjpeg] = "--enable-libopenjpeg=openjpeg2,--disable-libopenjpeg,openjpeg"
-PACKAGECONFIG[qt5] = "--enable-poppler-qt5 --with-moc-qt5=${STAGING_BINDIR_NATIVE}/qt5/moc,--disable-poppler-qt5,qtbase"
+PACKAGECONFIG[qt5] = "--enable-poppler-qt5 --with-moc-qt5=${STAGING_BINDIR_NATIVE}/qt5/moc,--disable-poppler-qt5,qtbase qttools-native"
 PACKAGECONFIG[qt4e] = "--enable-poppler-qt4 --with-moc-qt4=${STAGING_BINDIR_NATIVE}/moc4,--disable-poppler-qt4,qt4-embedded"
 PACKAGECONFIG[nss] = "--enable-libnss,--disable-libnss,nss"
 
-# Needed for qt5
-CXXFLAGS += "--std=c++11"
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
 
 EXTRA_OECONF = "\
     --enable-xpdf-headers \
@@ -34,7 +33,7 @@
 "
 
 do_compile_prepend() {
-        export GIR_EXTRA_LIBS_PATH="${B}/poppler/.libs"
+    export GIR_EXTRA_LIBS_PATH="${B}/poppler/.libs"
 }
 
 # Adjust library names when building for QT4e
@@ -43,7 +42,7 @@
 
 # check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
 def get_poppler_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', 1) in [ 'soft' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
         return "--enable-fixedpoint"
     return ""
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb
similarity index 75%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb
index 8f2b0db..489f8ad 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb
@@ -3,12 +3,12 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=26107732c2ab637c5710446fcfaf02df"
 
-PV = "v19+svnr1919"
+PV = "v190600"
 
-SRC_URI = "http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz \
+SRC_URI = "http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz \
            file://ldflags.patch"
-SRC_URI[md5sum] = "7f220406902af9dca009668e198cbd23"
-SRC_URI[sha256sum] = "8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57"
+SRC_URI[md5sum] = "4df8224e047529ca9ad42f0521bf81a8"
+SRC_URI[sha256sum] = "f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513"
 
 S = "${WORKDIR}/portaudio"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
index 454624c..812c2ae 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
@@ -20,7 +20,6 @@
 HOMEPAGE = "http://www.postgresql.com"
 LICENSE = "BSD"
 DEPENDS = "zlib readline tzcode-native"
-INC_PR = "r0"
 
 ARM_INSTRUCTION_SET = "arm"
 
@@ -38,9 +37,9 @@
 # LDFLAGS for shared libraries
 export LDFLAGS_SL = "${LDFLAGS}"
 
-inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
+inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd gettext
 
-CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR} -I${STAGING_INCDIR}/tcl8.6"
 
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
@@ -55,14 +54,13 @@
     fi
 }
 
-enable_pam = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+enable_pam = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl"
 PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
 PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
 PACKAGECONFIG[python] = "--with-python,--without-python,python,python"
 PACKAGECONFIG[uuid] = "--with-ossp-uuid,--without-ossp-uuid,ossp-uuid,"
-# when tcl native package  is fixed change WORKDIR to STAGING_BINDIR_CROSS
-PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl,"
+PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl tcl-native,"
 PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
 PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2"
 PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl"
@@ -91,7 +89,7 @@
             fpack="${PN}-" + name + "-dbg" + " " + fpack
         d.setVar('PACKAGES', fpack)
 
-    conf=(d.getVar('PACKAGECONFIG', True) or "").split()
+    conf=(d.getVar('PACKAGECONFIG') or "").split()
     pack=d.getVar('PACKAGES', False) or ""
     bb.debug(1, "PACKAGECONFIG=%s" % conf)
     bb.debug(1, "PACKAGES1=%s" % pack )
@@ -105,7 +103,7 @@
     if "python" in conf:
         fill_more("plpython")
 
-    pack=d.getVar('PACKAGES', True) or ""
+    pack=d.getVar('PACKAGES') or ""
     bb.debug(1, "PACKAGES2=%s" % pack)
 
 }
@@ -191,7 +189,7 @@
     # multiple server config directory
     install -d -m 700 ${D}${sysconfdir}/default/${BPN}
 
-    if [ "${@d.getVar('enable_pam', True)}" = "pam" ]; then
+    if [ "${@d.getVar('enable_pam')}" = "pam" ]; then
         install -d ${D}${sysconfdir}/pam.d
         install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql
     fi
@@ -221,7 +219,7 @@
     ${libdir}/${BPN}/libpqwalreceiver.so \
     ${libdir}/${BPN}/*_and_*.so \
     ${@'${sysconfdir}/pam.d/postgresql' \
-       if 'pam' == d.getVar('enable_pam', True) \
+       if 'pam' == d.getVar('enable_pam') \
        else ''} \
 "
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb
new file mode 100644
index 0000000..e4d2eda
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb
@@ -0,0 +1,11 @@
+require postgresql.inc
+
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=81b69ddb31a8be66baafd14a90146ee2"
+
+SRC_URI += "\
+    file://remove.autoconf.version.check.patch \
+    file://not-check-libperl.patch \
+"
+
+SRC_URI[md5sum] = "2fee03f2034034dbfcb3321a0bb0f829"
+SRC_URI[sha256sum] = "e3eb51d045c180b03d2de1f0c3af9356e10be49448e966ca01dfc2c6d1cc9d23"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb
deleted file mode 100644
index 7dba92c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require postgresql.inc
-
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3a9c1120056a102a8c8c4013cd828dce"
-
-PR = "${INC_PR}.0"
-
-SRC_URI += "\
-    file://remove.autoconf.version.check.patch \
-    file://not-check-libperl.patch \
-"
-
-SRC_URI[md5sum] = "a1a2e8014b2b4c49fc58fe2e2fe83681"
-SRC_URI[sha256sum] = "4a10640e180e0d9adb587bc25a82dcce6bf507b033637e7fb9d4eeffa33a6b4c"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
index 56656c4..aa474ce 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
@@ -38,7 +38,8 @@
 
 do_install() {
     install -d ${D}${bindir}
-    install -d ${D}${mandir}/man{1,5}
+    install -d ${D}${mandir}/man1
+    install -d ${D}${mandir}/man5
     oe_runmake -i BASENAME=${D}/usr MANDIR=${D}${mandir} install
     install -m 0644 debian/mailstat.1 ${D}${mandir}/man1
 }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
index 6e1c8ab..97326a2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
@@ -12,3 +12,5 @@
 
 SRC_URI[md5sum] = "4c6e0b22187d7bb1c998ffac89e50f6b"
 SRC_URI[sha256sum] = "9521f328bf28aaaf5c8488dc89792b614f9d6271742c0baf9bb41c97537764a8"
+
+PNBLACKLIST[psqlodbc] ?= "Depends on blacklisted postgresql - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch
new file mode 100644
index 0000000..7faeb13
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch
@@ -0,0 +1,34 @@
+From 3f97aac5a1f43ef57b02fb9ccdcadd41a6b69fa9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 27 Oct 2015 10:21:24 +0100
+Subject: [PATCH] configure.ac: do additional checks on libxml2 also when
+ detected by pkg-config
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Applied [1]
+
+[1] https://github.com/dajobe/raptor/pull/33
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 10ff870..35fa08e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -601,7 +601,7 @@ have_libxml=0
+ need_libxml=0
+ 
+ oCPPFLAGS="$CPPFLAGS"
+-if test "X$XML_CONFIG" != X; then
++if test "X$libxml_source" != X; then
+   CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS"
+   LIBS="$LIBS $LIBXML_LIBS"
+   AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no)
+-- 
+2.1.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb
new file mode 100644
index 0000000..dd00c14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library for parsing and serializing RDF syntaxes"
+LICENSE = "GPLv2 | LGPLv2.1 | Apache-2.0"
+LIC_FILES_CHKSUM = " \
+    file://LICENSE.txt;md5=b840e5ae3aeb897f45b473341348cd9c \
+    file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+"
+
+DEPENDS = "libxml2 libxslt curl yajl"
+
+SRC_URI = " \
+    http://download.librdf.org/source/${BPN}-${PV}.tar.gz \
+    file://0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch \
+"
+SRC_URI[md5sum] = "a39f6c07ddb20d7dd2ff1f95fa21e2cd"
+SRC_URI[sha256sum] = "ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = " \
+    --without-xml2-config \
+    --without-curl-config \
+    --without-xslt-config \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
index 082dc00..255754d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
@@ -13,7 +13,7 @@
 CLEANBROKEN = "1"
 
 do_compile() {
-    ${CC} ${CFLAGS} ${LDFLAGS} -static -o ${PN} gpio.c
+    ${CC} ${CFLAGS} ${LDFLAGS} -o ${PN} gpio.c
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
index bed0555..976a4f1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
@@ -12,7 +12,7 @@
 CLEANBROKEN = "1"
 
 do_compile() {
-    ${CC} ${CFLAGS} ${LDFLAGS} -static -o ${PN} gpio-s3c6410.c
+    ${CC} ${CFLAGS} ${LDFLAGS} -o ${PN} gpio-s3c6410.c
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
index 5405ed8..3fd85d9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
@@ -1,27 +1,31 @@
-[PATCH] make sysroot work
+From 15f0722bc5481cca5ba92adceab8c769112e4ea6 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Mon, 24 Oct 2016 07:28:13 +0000
+Subject: [PATCH] sdparm: make sysroot work
 
 Upstream-Status: Pending
 
 Add = before the included dir to make sysroot work
 
 Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  src/Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/Makefile.am b/src/Makefile.am
-index c83788c..9f62115 100644
+index 61dd9f8..42c911f 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -32,7 +32,7 @@ sglib_SOURCES =		../lib/sg_lib.c \
+@@ -41,7 +41,7 @@ sglib_SOURCES =		../lib/sg_lib.c \
  			../lib/sg_pt_common.c
  
  if HAVE_SGUTILS
--INCLUDES = -I/usr/include/scsi
+-INCLUDES = -I/scsi
 +INCLUDES = -I=@includedir@/scsi
  sdparm_LDADD = @GETOPT_O_FILES@ @os_libs@ @SGUTILS_LIBS@
  sdparm_DEPENDENCIES = @GETOPT_O_FILES@
  else
 -- 
-1.9.1
+2.7.4
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb
similarity index 83%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb
index ca11ca4..8ab2819 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb
@@ -14,8 +14,8 @@
 PACKAGES =+ "${PN}-scripts"
 RDEPENDS_${PN}-scripts += "bash ${PN}"
 
-SRC_URI[md5sum] = "e51b1fd41c3e4c9d1274a2e4f046eebf"
-SRC_URI[sha256sum] = "7294f44173ac0946f1de8af02b1bdb0bd648079245396589397a2b0d3abc42d3"
+SRC_URI[md5sum] = "bdae64375376ce8fe4bf9521c1db858f"
+SRC_URI[sha256sum] = "1ea1ed1bb1ee2aef62392618fa42da9ed027d5e655f174525c39235778292ab3"
 
 inherit autotools
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch
deleted file mode 100644
index 86a7da6..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 990234af84a5399017d1c4fe03c5c756a8e51e23 Mon Sep 17 00:00:00 2001
-From: Hongjun Yang <Hongjun.Yang@windriver.com>
-Date: Tue, 20 Aug 2013 09:41:43 +0800
-Subject: [PATCH] fix cross compiling issue
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com>
-
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 6ee98e0..8067f54 100755
---- a/configure
-+++ b/configure
-@@ -26965,7 +26965,7 @@ fi
- if test "$cross_compiling" = yes; then :
-   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
-+$as_echo "cannot run test program while cross compiling
- See \`config.log' for more details" "$LINENO" 5; }
- else
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--- 
-1.8.1.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch
new file mode 100644
index 0000000..7b627c1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch
@@ -0,0 +1,29 @@
+From fa8371d348f6a8b0799b2e6c38247dd1399d85e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 08:49:48 -0700
+Subject: [PATCH] Fix build with clang
+
+ATTRIBUTE_FORMAT_ARG macro gets computed to be empty with clang
+whereas it does support format attribute, we hard code it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/shar-opts.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shar-opts.h b/src/shar-opts.h
+index a287046..172676f 100644
+--- a/src/shar-opts.h
++++ b/src/shar-opts.h
+@@ -377,7 +377,7 @@ extern tOptions sharOptions;
+ #   define ATTRIBUTE_FORMAT_ARG(_a)
+ # endif
+ 
+-static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
++static inline char* aoGetsText(char const* pz) __attribute__ ((format_arg(1)));
+ static inline char* aoGetsText(char const* pz) {
+     if (pz == NULL) return NULL;
+     return (char*)gettext(pz);
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb
deleted file mode 100644
index d69e6ec..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "This is the set of GNU shar utilities."
-HOMEPAGE = "http://www.gnu.org/software/sharutils/"
-SECTION = "console/utils"
-LICENSE="GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-inherit gettext autotools-brokensep
-
-SRC_URI = "ftp://ftp.gnu.org/gnu/sharutils/sharutils-4.14.tar.gz \
-    file://fix-for-cross-compiling.patch \
-"
-
-SRC_URI[md5sum] = "5686c11131b4c4c0841f8f3ef34d136a"
-SRC_URI[sha256sum] = "90f5107c167cfd1b299bb211828d2586471087863dbed698f53109cd5f717208"
-
-do_configure () {
-    oe_runconf
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb
new file mode 100644
index 0000000..812fee9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "This is the set of GNU shar utilities."
+HOMEPAGE = "http://www.gnu.org/software/sharutils/"
+SECTION = "console/utils"
+LICENSE="GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit gettext autotools
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/${BPN}/${BP}.tar.gz \
+           file://0001-Fix-build-with-clang.patch \
+"
+SRC_URI[md5sum] = "32a51b23e25ad5e6af4b89f228be1800"
+SRC_URI[sha256sum] = "ee336e68549664e7a19b117adf02edfdeac6307f22e5ba78baca457116914637"
+
+do_install_append() {
+    if [ -e ${D}${libdir}/charset.alias ]
+    then
+        rm -rf ${D}${libdir}/charset.alias
+        rmdir --ignore-fail-on-non-empty ${D}${libdir}
+    fi
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch
new file mode 100644
index 0000000..c5d7c0c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch
@@ -0,0 +1,32 @@
+From 443980ddc82fb40e2e1f9544f2be169bd23dd246 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:49:24 -0700
+Subject: [PATCH] shell.c:  Fix format not a string literal warning
+
+src/shell.c:695:20: error: format not a string literal and no format arguments [-Werror=format-security]
+|      fprintf(stderr,zHelp);
+|                     ^~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shell.c b/src/shell.c
+index bb46c49..3c6fe0f 100644
+--- a/src/shell.c
++++ b/src/shell.c
+@@ -692,7 +692,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
+   }else
+ 
+   if( c=='h' && strncmp(azArg[0], "help", n)==0 ){
+-    fprintf(stderr,zHelp);
++    fprintf(stderr, "%s", zHelp);
+   }else
+ 
+   if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
index e6e14c2..501c0e3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
@@ -8,9 +8,11 @@
 PR = "r7"
 
 SRC_URI = "http://www.hwaci.com/sw/sqlite/sqlite-${PV}.tar.gz \
-    file://mainmk_build_dynamic.patch \
-    file://mainmk_no_tcl.patch \
-    file://sqlite.pc"
+           file://mainmk_build_dynamic.patch \
+           file://mainmk_no_tcl.patch \
+           file://sqlite.pc \
+           file://0001-shell.c-Fix-format-not-a-string-literal-warning.patch \
+           "
 
 SOURCES = "attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o \
            expr.o func.o hash.o insert.o main.o opcodes.o os.o pager.o \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch
new file mode 100644
index 0000000..9b2bd99
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch
@@ -0,0 +1,57 @@
+Add option to build this utility without a documentation.
+
+For full documentation building are necessary utilities like
+groff and ps2pdf. Full documentation can takes a lot of space.
+So it can be disabled by overloading makefile variable WITHOUT_DOC.
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index 9bdd8f1..a2b5494 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -141,6 +141,14 @@ GROFF = @GROFF@
+ #
+ SOELIM = @SOELIM@
+ 
++# Option to build this utility without building and installing the documentation.
++WITHOUT_DOC ?= 0
++ifeq ($(WITHOUT_DOC),0)
++	BUILD_DOC = all-doc
++	INST_DOC = install-doc
++	CLR_DOC = clean-doc
++endif
++
+ # ---------------------------------------------------------
+ # You should not need to change anything below this line.
+ 
+@@ -4090,7 +4098,7 @@ bin/test_url_decode: $(test_url_decode_obj) .bin srecord/libsrecord.la
+ 	$(LIBTOOL) --mode=link --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ \
+ 		$(test_url_decode_obj) srecord/libsrecord.la $(LDFLAGS) $(LIBS)
+ 
+-all: all-bin all-doc
++all: all-bin $(BUILD_DOC)
+ 
+ all-bin: bin/srec_cat bin/srec_cmp bin/srec_info bin/test_arglex_ambiguous \
+ 		bin/test_crc16 bin/test_fletcher16 bin/test_gecos \
+@@ -4156,7 +4164,7 @@ test_files = t0001a t0002a t0003a t0004a t0005a t0006a t0007a t0008a t0009a \
+ sure: $(test_files)
+ 	@echo Passed All Tests
+ 
+-clean: clean-bin clean-doc clean-misc clean-obj
++clean: clean-bin $(CLR_DOC) clean-misc clean-obj
+ 
+ clean-bin:
+ 	rm -f bin/srec_cat bin/srec_cmp bin/srec_info bin/test_arglex_ambiguous
+@@ -4443,7 +4451,7 @@ distclean-directories:
+ 	rm -rf test/fletcher16/.libs test/gecos/.libs test/hyphen/.libs
+ 	rm -rf test/url_decode/.libs
+ 
+-install: install-bin install-doc install-include install-libdir install-man
++install: install-bin $(INST_DOC) install-include install-libdir install-man
+ 
+ install-bin: $(bindir)/srec_cat $(bindir)/srec_cmp $(bindir)/srec_info
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb
new file mode 100644
index 0000000..fe1af47
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb
@@ -0,0 +1,23 @@
+SUMMARY = "A collection of powerful tools for manipulating EPROM load files."
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8dfcbf2f0a144b97f0931b6394debea7"
+
+SRC_URI = " \
+    http://srecord.sourceforge.net/srecord-${PV}.tar.gz \
+    file://add-option-to-remove-docs.patch \
+"
+
+SRC_URI[md5sum] = "4de4a7497472d7972645c2af91313769"
+SRC_URI[sha256sum] = "49a4418733c508c03ad79a29e95acec9a2fbc4c7306131d2a8f5ef32012e67e2"
+
+DEPENDS = "libtool-native boost groff-native"
+
+inherit autotools-brokensep
+
+EXTRA_OECONF = "--without-gcrypt LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# Set variable WITHOUT_DOC=0 to enable documentation generation
+EXTRA_OEMAKE = "WITHOUT_DOC=1"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
index e6057f4..f2063e4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
@@ -4,12 +4,13 @@
 LICENSE = "GPL-2.0"
 SECTION = "x11/utils"
 
-DEPENDS = "virtual/libx11 libxtst libxinerama unzip-native curl openssl"
+DEPENDS = "virtual/libx11 libxtst libxinerama curl openssl"
+do_unpack_extra[depends] = "unzip-native:do_populate_sysroot"
 
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI = "git://github.com/synergy/synergy.git;protocol=http"
+SRC_URI = "git://github.com/symless/synergy-core.git;protocol=https"
 
 # Version 1.7.4-rc8
 SRCREV ?= "588fb4b805dd452556d05dbc03fe29ea5b4e43c0"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch
deleted file mode 100644
index 89022aa..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Fix the memory leak problem for mutex
-
-Upstream-Status: Pending
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
----
- lib/logqueue.c               |    1 +
- modules/affile/affile-dest.c |    2 ++
- modules/dbparser/dbparser.c  |    1 +
- 3 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/lib/logqueue.c b/lib/logqueue.c
-index 337a3c1..10edcf0 100644
---- a/lib/logqueue.c
-+++ b/lib/logqueue.c
-@@ -188,6 +188,7 @@ log_queue_init_instance(LogQueue *self, const gchar *persist_name)
- void
- log_queue_free_method(LogQueue *self)
- {
-+  g_static_mutex_free(&self->lock);
-   g_free(self->persist_name);
-   g_free(self);
- }
-diff --git a/modules/affile/affile-dest.c b/modules/affile/affile-dest.c
-index a2bcdad..ce79f6f 100644
---- a/modules/affile/affile-dest.c
-+++ b/modules/affile/affile-dest.c
-@@ -305,6 +305,7 @@ affile_dw_free(LogPipe *s)
- {
-   AFFileDestWriter *self = (AFFileDestWriter *) s;
-   
-+  g_static_mutex_free(&self->lock);
-   log_pipe_unref((LogPipe *) self->writer);
-   self->writer = NULL;
-   g_free(self->filename);
-@@ -687,6 +688,7 @@ affile_dd_free(LogPipe *s)
-   /* NOTE: this must be NULL as deinit has freed it, otherwise we'd have circular references */
-   g_assert(self->single_writer == NULL && self->writer_hash == NULL);
- 
-+  g_static_mutex_free(&self->lock);
-   log_template_unref(self->filename_template);
-   log_writer_options_destroy(&self->writer_options);
-   log_dest_driver_free(s);
-diff --git a/modules/dbparser/dbparser.c b/modules/dbparser/dbparser.c
-index f1248b5..9775701 100644
---- a/modules/dbparser/dbparser.c
-+++ b/modules/dbparser/dbparser.c
-@@ -284,6 +284,7 @@ log_db_parser_free(LogPipe *s)
- {
-   LogDBParser *self = (LogDBParser *) s;
- 
-+  g_static_mutex_free(&self->lock);
-   if (self->db)
-     pattern_db_free(self->db);
- 
--- 
-1.7.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch
deleted file mode 100644
index 109f58c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: syslog-ng-3.5.4.1/configure.ac
-===================================================================
---- syslog-ng-3.5.4.1.orig/configure.ac	2014-07-18 13:49:36.794141441 +0000
-+++ syslog-ng-3.5.4.1/configure.ac	2014-07-18 14:23:57.738197606 +0000
-@@ -8,7 +8,8 @@ dnl SNAPSHOT_VERSION   - snapshot version to add to version number
- dnl BINARY_BRANCH      - the value is added to all source/binary packages
- dnl SOURCE_REVISION    - Revision of the source-tree, will added to the version string
- dnl
--AC_INIT(syslog-ng/main.c)
-+AC_INIT(syslog-ng, 3.5.4.1)
-+AC_CONFIG_SRCDIR(syslog-ng/main.c)
- AC_CONFIG_MACRO_DIR([m4])
- m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
- 
-@@ -53,7 +54,7 @@ else
-         CURRDATE=`date +"%a, %d %b %Y %H:%M:%S %Z"`
- fi
- 
--AM_INIT_AUTOMAKE($PACKAGE, $VERSION, [foreign no-define subdir-objects])
-+AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
- _AM_PROG_TAR([ustar])
- if test -n "$SNAPSHOT_VERSION"; then
- 	VERSION=$VERSION+$SNAPSHOT_VERSION
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch
deleted file mode 100644
index 15dfb68..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: syslog-ng-3.5.4.1/configure.ac
-===================================================================
---- syslog-ng-3.5.4.1.orig/configure.ac	2014-07-18 14:35:03.134215740 +0000
-+++ syslog-ng-3.5.4.1/configure.ac	2014-07-18 15:31:52.510308653 +0000
-@@ -576,13 +576,14 @@
- dnl ***************************************************************************
- 
- AC_CHECK_LIB(dl, dlsym, DL_LIBS="-ldl")
-+if test "x$enable_sql" != "xno"; then
- PKG_CHECK_MODULES(LIBDBI, dbi >= $LIBDBI_MIN_VERSION, libdbi_pkgconfig_not_found="0", libdbi_pkgconfig_not_found="1")
- 
- if test "$libdbi_pkgconfig_not_found" -eq 1; then
- 	dnl if libdbi has no .pc file, try it without one
- 	AC_CHECK_LIB(dbi, dbi_initialize, LIBDBI_LIBS="-ldbi"; LIBDBI_CFLAGS="-I/usr/include")
- fi
--
-+fi
- if test "x$enable_sql" = "xauto"; then
- 	AC_MSG_CHECKING(whether to enable SQL support)
- 	if test "x$LIBDBI_LIBS" != "x"; then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch
deleted file mode 100644
index 2603474..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From a269669ba3cb6d1c06a3322b4a6a035cb787d085 Mon Sep 17 00:00:00 2001
-From: Gergely Nagy <algernon@balabit.hu>
-Date: Tue, 14 Jan 2014 13:58:05 +0100
-Subject: [PATCH] driver: Fix a memory leak in log_driver_free()
-
-Upstream-Status: Backport
-
-After freeing up the members of self->plugins, free self->plugins itself
-too.
-
-Signed-off-by: Gergely Nagy <algernon@balabit.hu>
----
- lib/driver.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/driver.c b/lib/driver.c
-index d77fe57..a6867b9 100644
---- a/lib/driver.c
-+++ b/lib/driver.c
-@@ -91,6 +91,10 @@ log_driver_free(LogPipe *s)
-     {
-       log_driver_plugin_free((LogDriverPlugin *) l->data);
-     }
-+  if (self->plugins)
-+    {
-+      g_list_free(self->plugins);
-+    }
-   if (self->group)
-     g_free(self->group);
-   if (self->id)
--- 
-1.8.4.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index f0da2b7..0c6f543 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
-@version: 3.5
+@version: 3.8
 #
 # Syslog-ng configuration file, compatible with default Debian syslogd
 # installation. Originally written by anonymous (I can't find his name)
@@ -52,7 +52,7 @@
 destination d_newserr { file("/var/log/news/news.err"); };
 destination d_newsnotice { file("/var/log/news/news.notice"); };
 
-# Some `catch-all' logfiles.
+# Some 'catch-all' logfiles.
 #
 destination d_debug { file("/var/log/debug"); };
 destination d_error { file("/var/log/error"); };
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index f53c607..6b30c20 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -15,18 +15,17 @@
 index fc16f8d..8e09deb 100644
 --- a/contrib/systemd/syslog-ng.service
 +++ b/contrib/systemd/syslog-ng.service
-@@ -3,9 +3,8 @@ Description=System Logger Daemon
- Documentation=man:syslog-ng(8)
+@@ -4,8 +4,8 @@ Description=System Logger Daemon
  
  [Service]
--Type=notify
--ExecStart=/usr/sbin/syslog-ng -F
+ Type=notify
+-ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
 -ExecReload=/bin/kill -HUP $MAINPID
-+ExecStart=@SBINDIR@/syslog-ng -F -p @LOCALSTATEDIR@/run/syslogd.pid
++ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
 +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
+ EnvironmentFile=-/etc/default/syslog-ng
+ EnvironmentFile=-/etc/sysconfig/syslog-ng
  StandardOutput=journal
- StandardError=journal
- Restart=on-failure
 -- 
 1.8.4.2
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 898e9c2..0977f7e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -10,19 +10,19 @@
 HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system"
 
 LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408"
+LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
 
 # util-linux added to get libuuid
-DEPENDS = "libpcre flex eventlog glib-2.0 util-linux"
+DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
 
-SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz \
+SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
            file://syslog-ng.conf \
            file://initscript \
            file://volatiles.03_syslog-ng \
            file://configure.ac-add-option-enable-thread-tls-to-manage-.patch \
 "
 
-inherit autotools systemd pkgconfig update-alternatives update-rc.d
+inherit autotools gettext systemd pkgconfig update-rc.d
 
 EXTRA_OECONF = " \
     --enable-dynamic-linking \
@@ -32,32 +32,38 @@
     --sysconfdir=${sysconfdir}/${BPN} \
     --with-module-dir=${libdir}/${BPN} \
     --with-sysroot=${STAGING_DIR_HOST} \
-    --with-libmongo-client=no --disable-mongodb \
+    --without-mongoc --disable-mongodb \
     --with-librabbitmq-client=no \
+    --disable-python \
+    --disable-java --disable-java-modules \
     ${CONFIG_TLS} \
 "
 
 CONFIG_TLS = "--enable-thread-tls"
 CONFIG_TLS_arm = "${@base_conditional( "DEBUG_BUILD", "1", " --disable-thread-tls", " --enable-thread-tls", d )}"
 
-PACKAGECONFIG ??= "openssl \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+PACKAGECONFIG ??= " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
 "
-PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl,openssl,"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
 PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
 PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
-PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre,"
 PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
 PACKAGECONFIG[libnet] = "--enable-libnet --with-libnet=${STAGING_BINDIR_CROSS},--disable-libnet,libnet,"
+PACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
 PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
 PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
 PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
 PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
+PACKAGECONFIG[native] = "--enable-native,--disable-native,,"
 
 do_configure_prepend() {
-    eval "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
+	olddir=$(pwd)
+	cd ${AUTOTOOLS_SCRIPT_PATH}
+
+	ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed."
+
+	cd $olddir
 }
 
 do_install_prepend() {
@@ -70,7 +76,7 @@
     install -d ${D}/${sysconfdir}/${BPN}
     install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
     install -d ${D}/${sysconfdir}/init.d
-    install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${BPN}
+    install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog
     install -d ${D}/${sysconfdir}/default/volatiles/
     install -m 755 ${WORKDIR}/volatiles.03_syslog-ng ${D}/${sysconfdir}/default/volatiles/03_syslog-ng
     install -d ${D}/${localstatedir}/lib/${BPN}
@@ -86,7 +92,7 @@
 FILES_${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
 FILES_${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
 FILES_${PN}-libs-dbg = "${libdir}/${BPN}/.debug"
-FILES_${PN}-staticdev = "${libdir}/${BPN}/libtest/*.a"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
 INSANE_SKIP_${PN}-libs = "dev-so"
 RDEPENDS_${PN} += "${PN}-libs"
 
@@ -96,26 +102,12 @@
 # update-rc.d and update-alternatives is important
 RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
 
+RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
+
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
 SYSTEMD_SERVICE_${PN} = "${BPN}.service"
 
-# no syslog-init for systemd
-python () {
-    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
-        sysconfdir = d.getVar('sysconfdir', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
-        d.setVarFlag('ALTERNATIVE_PRIORITY', 'syslog-init', '200')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
-
-    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-        pn = d.getVar('PN', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/${BPN}.service' % (d.getVar('systemd_unitdir', True)))
-}
-
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb
deleted file mode 100644
index 73609af..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require syslog-ng.inc
-
-SRC_URI += " \
-    file://fix-a-memory-leak-in-log_driver_free.patch \
-    file://fix-config-libnet.patch \
-    file://fix-invalid-ownership.patch \
-    file://Fix-the-memory-leak-problem-for-mutex.patch \
-    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
-    file://configure.patch \
-    file://dbifix.patch \
-    file://syslog-ng.service-the-syslog-ng-service.patch \
-"
-
-SRC_URI[md5sum] = "e9f401615e92e5eb27396c995c1446ba"
-SRC_URI[sha256sum] = "7be11df31ac7d716f1f952e22b5ae8e2049edd633a41b223776a853d9106f4e7"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
new file mode 100644
index 0000000..91a0e46
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
@@ -0,0 +1,11 @@
+require syslog-ng.inc
+
+SRC_URI += " \
+    file://fix-config-libnet.patch \
+    file://fix-invalid-ownership.patch \
+    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
+    file://syslog-ng.service-the-syslog-ng-service.patch \
+"
+
+SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
+SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
index 078fcea..26b4412 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
@@ -5,10 +5,9 @@
 SRC_URI = "https://fedorahosted.org/releases/s/y/${BPN}/${BP}.tar.bz2"
 SRC_URI[md5sum] = "c267db0ee7a2131ba418399dc17f9e72"
 SRC_URI[sha256sum] = "218c883e4e2bfcc82bfe07e785707b5c2ece28df772f2155fd044b9bb1614284"
-inherit python-dir
 
 inherit python-dir gettext
-DEPENDS = "intltool-native"
+DEPENDS += "intltool-native gettext-native"
 
 EXTRA_OEMAKE = " \
     PYTHON='${STAGING_BINDIR_NATIVE}'/python-native/python \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
index fbbfa3d..0bd7af7 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
@@ -29,3 +29,5 @@
 }
 
 FILES_${PN} += "${systemd_unitdir}/system/${BPN}.service"
+
+PNBLACKLIST[system-setup-keyboard] ?= "Depends on blacklisted system-config-keyboard-native - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb
similarity index 72%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb
index 09ed6ec..35840fd 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb
@@ -4,23 +4,22 @@
     higher-level, task-based parallelism that abstracts platform details \
     and threading mechanism for performance and scalability."
 HOMEPAGE = "http://threadingbuildingblocks.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2c7f2caf277a3933e3acdf7f89d54cc1"
-PRDATE = "20130314"
-PR = "r${PRDATE}"
-
-SRC_URI = "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_${PRDATE}oss_src.tgz \
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+PRDATE = "20170118"
+PV = "${PRDATE}"
+SRC_URI = "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb2017_${PRDATE}oss_src.tgz \
            file://cross-compile.patch \
-           file://allow-to-build-for-older-arm-cores.patch \
            file://tbb.pc"
+SRC_URI[md5sum] = "26baa6fbcc8f03ee45c0641b91d9588a"
+SRC_URI[sha256sum] = "48bb526287fa8b4e7d1e1b2ba9e5fb9c3e372b497772c06ef9ccd7f93f344e74"
 
-S = "${WORKDIR}/tbb41_${PRDATE}oss/"
+S = "${WORKDIR}/tbb2017_${PRDATE}oss/"
 
-SRC_URI[md5sum] = "ed4af7ccfa122f16cf9920b241633a3a"
-SRC_URI[sha256sum] = "32fd5979971b772caa96d40646cee585ed0070516ba2dbbcb1f9b6033d08a92d"
-
+COMPILER ?= "gcc"
+COMPILER_toolchain-clang = "clang"
 do_compile() {
-    oe_runmake compiler=gcc arch=${HOST_ARCH} runtime=cc4
+    oe_runmake compiler=${COMPILER} arch=${HOST_ARCH} runtime=cc4
 }
 
 do_install() {
@@ -38,3 +37,4 @@
 # ...
 # | make[1]: *** [concurrent_queue.o] Error 1
 ARM_INSTRUCTION_SET = "arm"
+SECURITY_CFLAGS_append = " -fPIC"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch
deleted file mode 100644
index cd2ec94..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
-Description: Allow to build TBB for ARM cores older than ARMv7a
-
-| ../../include/tbb/machine/gcc_armv7.h:39:2: error: #error Threading
-Building Blocks ARM port requires an ARMv7-a architecture.
-| make[1]: *** [concurrent_hash_map.o] Error 1
-
-https://bugs.launchpad.net/linaro-oe/+bug/1167144
-
-Upstream-status: pending
-
----
- include/tbb/tbb_machine.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- tbb41_20130314oss.orig/include/tbb/tbb_machine.h
-+++ tbb41_20130314oss/include/tbb/tbb_machine.h
-@@ -237,11 +237,11 @@ template<> struct atomic_selector<8> {
-         #include "machine/linux_intel64.h"
-     #elif __ia64__
-         #include "machine/linux_ia64.h"
-     #elif __powerpc__
-         #include "machine/mac_ppc.h"
--    #elif __arm__
-+    #elif __ARM_ARCH_7A__
-         #include "machine/gcc_armv7.h"
-     #elif __TBB_GCC_BUILTIN_ATOMICS_PRESENT
-         #include "machine/gcc_generic.h"
-     #endif
-     #include "machine/linux_common.h"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
index b970a37..d54b307 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
@@ -5,14 +5,14 @@
  build/linux.gcc.inc |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
---- tbb41_20121003oss.orig/build/linux.gcc.inc
-+++ tbb41_20121003oss/build/linux.gcc.inc
-@@ -40,12 +40,13 @@ DYLIB_KEY = -shared
+Index: tbb2017_20170118oss/build/linux.gcc.inc
+===================================================================
+--- tbb2017_20170118oss.orig/build/linux.gcc.inc
++++ tbb2017_20170118oss/build/linux.gcc.inc
+@@ -32,8 +32,9 @@ DYLIB_KEY = -shared
  EXPORT_KEY = -Wl,--version-script,
  LIBDL = -ldl
  
- TBB_NOSTRICT = 1
- 
 -CPLUS = g++
 -CONLY = gcc
 +CPLUS = $(CXX)
@@ -20,6 +20,20 @@
 +CPLUS_FLAGS = $(CXXFLAGS)
  LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
  LIBS += -lpthread -lrt
- LINK_FLAGS = -Wl,-rpath-link=.
- C_FLAGS = $(CPLUS_FLAGS)
- # gcc 4.4 and higher support -std=c++0x
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
+Index: tbb2017_20170118oss/build/linux.clang.inc
+===================================================================
+--- tbb2017_20170118oss.orig/build/linux.clang.inc
++++ tbb2017_20170118oss/build/linux.clang.inc
+@@ -31,8 +31,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+ 
+-CPLUS = clang++
+-CONLY = clang
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch
new file mode 100644
index 0000000..3cc0400
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch
@@ -0,0 +1,91 @@
+From 32278297170ffb49116b5789e4a0588b99d02bd0 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Thu, 9 Feb 2017 11:02:53 +0200
+Subject: [PATCH] Make udev rules directory configurable.
+
+udev rules directory can be configurable via undevrulesdir variable. And use
+libdir, sbindir for installing librares and binaries.
+
+Upstream-Status: Inappropriate[Embedded specific]
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac            | 14 +++-----------
+ data/Makefile.am        |  1 -
+ src/probers/Makefile.am |  2 +-
+ tools/Makefile.am       |  2 +-
+ 4 files changed, 5 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8c4e4c2..a143397 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -227,15 +227,8 @@ if test "x$GCC" = "xyes"; then
+   LDFLAGS="-Wl,--as-needed $LDFLAGS"
+ fi
+ 
+-if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
+-  slashlibdir=/lib
+-  slashsbindir=/sbin
+-else
+-  slashlibdir=$prefix/lib
+-  slashsbindir=$prefix/sbin
+-fi
+-AC_SUBST(slashlibdir)
+-AC_SUBST(slashsbindir)
++udevrulesdir=/lib/udev/udev.d
++AC_SUBST(udevrulesdir)
+ 
+ # *************
+ # Remote Access
+@@ -299,8 +292,7 @@ echo "
+         sysconfdir:                 ${sysconfdir}
+         localstatedir:              ${localstatedir}
+         docdir:                     ${docdir}
+-        slashlibdir:                ${slashlibdir}
+-        slashsbindir:               ${slashsbindir}
++        udevrulesdir:               ${udevrulesdir}
+         systemdsystemunitdir:       ${systemdsystemunitdir}
+ 
+         compiler:                   ${CC}
+diff --git a/data/Makefile.am b/data/Makefile.am
+index 411ea0f..4834960 100644
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -34,7 +34,6 @@ $(systemdservice_DATA): $(systemdservice_in_files) Makefile
+ 	@sed -e "s|\@libexecdir\@|$(prefix)/lib/udisks|" $< > $@
+ endif
+ 
+-udevrulesdir = $(slashlibdir)/udev/rules.d
+ udevrules_DATA = 80-udisks.rules
+ 
+ pkgconfigdir = $(datadir)/pkgconfig
+diff --git a/src/probers/Makefile.am b/src/probers/Makefile.am
+index 01c693b..6a0361a 100644
+--- a/src/probers/Makefile.am
++++ b/src/probers/Makefile.am
+@@ -20,7 +20,7 @@ INCLUDES = \
+ # TODO: ideally move most of this to udev and/or util-linux
+ #
+ 
+-udevhelperdir = $(slashlibdir)/udev
++udevhelperdir = $(libdir)/udev
+ udevhelper_PROGRAMS =	udisks-part-id 			\
+ 			udisks-probe-sas-expander 	\
+ 			$(NULL)
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 18325f7..0aaec11 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -54,7 +54,7 @@ udisks_LDADD = 						\
+ 	$(DBUS_GLIB_LIBS)				\
+ 	$(POLKIT_DBUS_LIBS)
+ 
+-slashsbin_PROGRAMS = umount.udisks
++sbin_PROGRAMS = umount.udisks
+ 
+ umount_udisks_SOURCES = umount-udisks.c
+ umount_udisks_LDADD = $(DBUS_GLIB_LIBS) $(POLKIT_DBUS_LIBS)
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
index fbf6701..c784fd2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
@@ -2,8 +2,8 @@
 LICENSE = "GPLv2+ & LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=dd79f6dbbffdbc8e86b086a8f0c0ef43"
 
-DEPENDS = "acl libatasmart polkit libgudev dbus-glib glib-2.0 intltool-native gnome-common-native"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+DEPENDS = "acl libatasmart polkit libgudev dbus-glib glib-2.0 intltool-native gnome-common-native libxslt-native"
+DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 RDEPENDS_${PN} = "acl"
 
@@ -13,6 +13,8 @@
 SRC_URI[md5sum] = "8bccd36573b75286538bd5bd2c424f45"
 SRC_URI[sha256sum] = "abae2bb3bdc691ca13c1e4c244630b8c881c4f3b35c207299f1b39b7bec83785"
 
+CVE_PRODUCT = "udisks"
+
 inherit autotools systemd gtk-doc gobject-introspection
 
 S = "${WORKDIR}/udisks-${PV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
index eec6933..ffe2c26 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
@@ -2,16 +2,21 @@
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=73d83aebe7e4b62346afde80e0e94273"
 
-DEPENDS = "libatasmart sg3-utils polkit libgudev dbus-glib glib-2.0 intltool-native lvm2"
+DEPENDS = "libatasmart sg3-utils polkit libgudev dbus-glib glib-2.0 intltool-native lvm2 \
+    dbus-glib-native \
+"
 # optional dependencies: device-mapper parted
 
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+    dbus-glib-native \
+"
 
 SRC_URI = " \
     http://hal.freedesktop.org/releases/${BPN}-${PV}.tar.gz;name=${BPN} \
     file://optional-depends.patch \
     file://0001-fix-build-with-newer-glibc-versions.patch \
     file://udisks-1.0.5-fix-service-file.patch \
+    file://0001-Make-udev-rules-directory-configurable.patch \
 "
 
 SRC_URI[udisks.md5sum] = "70d48dcfe523a74cd7c7fbbc2847fcdd"
@@ -22,7 +27,8 @@
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[parted] = "--enable-parted,--disable-parted,parted"
 
-EXTRA_OECONF = "--disable-man-pages"
+EXTRA_OECONF = "--disable-man-pages --libdir=${base_libdir} --sbindir=${base_sbindir}"
+EXTRA_OEMAKE = "udevrulesdir=${nonarch_base_libdir}/udev/rules.d/"
 
 FILES_${PN} += "${libdir}/polkit-1/extensions/*.so \
                 ${datadir}/dbus-1/ \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch
new file mode 100644
index 0000000..4b12494
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch
@@ -0,0 +1,82 @@
+From 24fd52cc45f7b5ff45afe072f5fbe66485df8c8e Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Wed, 29 Oct 2014 14:18:28 +0100
+Subject: [PATCH] Add support for aarch64
+
+* include/private/gcconfig.h: Add support for aarch64.
+---
+ sigscheme/libgcroots/include/private/gcconfig.h | 37 +++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/sigscheme/libgcroots/include/private/gcconfig.h b/sigscheme/libgcroots/include/private/gcconfig.h
+index 4d42b03..0f13db6 100644
+--- a/sigscheme/libgcroots/include/private/gcconfig.h
++++ b/sigscheme/libgcroots/include/private/gcconfig.h
+@@ -62,6 +62,13 @@
+ # endif
+ 
+ /* Determine the machine type: */
++# if defined(__aarch64__)
++#    define AARCH64
++#    if !defined(LINUX)
++#      define NOSYS
++#      define mach_type_known
++#    endif
++# endif
+ # if defined(__arm__) || defined(__thumb__)
+ #    define ARM32
+ #    if !defined(LINUX) && !defined(NETBSD)
+@@ -231,6 +238,10 @@
+ #    define IA64
+ #    define mach_type_known
+ # endif
++# if defined(LINUX) && defined(__aarch64__)
++#    define AARCH64
++#    define mach_type_known
++# endif
+ # if defined(LINUX) && defined(__arm__)
+ #    define ARM32
+ #    define mach_type_known
+@@ -504,6 +515,7 @@
+ 		    /* 			running Amdahl UTS4		*/
+                     /*             S390       ==> 390-like machine      */
+ 		    /*                  running LINUX                   */
++                    /*             AARCH64    ==> ARM AArch64           */
+ 		    /* 		   ARM32      ==> Intel StrongARM	*/
+ 		    /* 		   IA64	      ==> Intel IPF		*/
+ 		    /*				  (e.g. Itanium)	*/
+@@ -1724,6 +1736,31 @@
+ #   endif
+ # endif
+ 
++# ifdef AARCH64
++#   define CPP_WORDSZ 64
++#   define MACH_TYPE "AARCH64"
++#   define ALIGNMENT 8
++#   ifndef HBLKSIZE
++#     define HBLKSIZE 4096
++#   endif
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern char _end[];
++#     define DATAEND ((ptr_t)(&_end))
++#   endif
++#   ifdef NOSYS
++      /* __data_start is usually defined in the target linker script.   */
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern void *__stack_base__;
++#     define STACKBOTTOM ((ptr_t)__stack_base__)
++#   endif
++# endif
++
+ # ifdef ARM32
+ #   define CPP_WORDSZ 32
+ #   define MACH_TYPE "ARM32"
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
index 76a4125..909756a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
@@ -8,6 +8,7 @@
 
 SRC_URI_append_class-target = " file://uim-module-manager.patch \
     file://0001-fix-bug-for-cross-compile.patch \
+    file://0001-Add-support-for-aarch64.patch \
 "
 SRC_URI[md5sum] = "ecea4c597bab1fd4ba98ea84edcece59"
 SRC_URI[sha256sum] = "7b1ea803c73f3478917166f04f67cce6e45ad7ea5ab6df99b948c17eb1cb235f"
@@ -42,7 +43,7 @@
     rm -rf ${D}/${datadir}/applications
 }
 
-PACKAGES += "uim-xim uim-utils uim-skk uim-gtk2.0 uim-gtk3 uim-fep uim-common uim-anthy libuim0 libuim-dev"
+PACKAGES =+ "uim-xim uim-utils uim-skk uim-gtk2.0 uim-gtk3 uim-fep uim-anthy uim-common libuim0 libuim-dev"
 
 FILES_${PN} = "${bindir}/uim-help \
     ${libdir}/uim/plugin/libuim-* \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
index 44a04de..3651e18 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
@@ -10,7 +10,7 @@
 
 inherit autotools pkgconfig gettext gobject-introspection systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[idevice] = "--with-idevice,--without-idevice,libimobiledevice libplist"
 PACKAGECONFIG[systemd] = "--with-systemdutildir=${systemd_unitdir} --with-systemdsystemunitdir=${systemd_system_unitdir}, \
                           --without-systemdutildir --without-systemdsystemunitdir,systemd"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb
similarity index 63%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb
index a265411..eeed5e2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb
@@ -4,14 +4,16 @@
 
 inherit allarch
 
+DEPENDS += "tcl-native"
+
 SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
-SRC_URI[md5sum] = "dff94177781298aaf0b3c2a3c3dea6b2"
-SRC_URI[sha256sum] = "53889157937109e04dafe897c098ec94f3f44f9c0c83fc6ec8417aa9a587e536"
+SRC_URI[md5sum] = "0cc107cd0c4c83df0d9400c999e21dfd"
+SRC_URI[sha256sum] = "e2dcfd9d28928d8d8f03381571a23442b3c50d48d343bc40a1a07d01662738d1"
 
 do_install() {
     oe_runmake install DESTDIR=${D}
 }
 
-RDEPENDS_${PN} = "usb-modeswitch (>= 2.2.0)"
+RDEPENDS_${PN} = "usb-modeswitch (>= 2.4.0)"
 FILES_${PN} += "${base_libdir}/udev/rules.d/ \
                 ${datadir}/usb_modeswitch"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb
similarity index 77%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb
index 425f66b..ff439f3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb
@@ -5,8 +5,10 @@
 DEPENDS = "libusb1"
 
 SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
-SRC_URI[md5sum] = "f323fe700edd6ea404c40934ddf32b22"
-SRC_URI[sha256sum] = "2752103de171ed5f6c8d6a6e3e73e16c9ee3e8e394dd39c5991f7680eb908a3a"
+SRC_URI[md5sum] = "38ad5c9d70e06227a00361bdc2b1e568"
+SRC_URI[sha256sum] = "31c0be280d49a99ec3dc0be3325bef320d9c04b50714ef0ce1e36a614d687633"
+
+inherit pkgconfig
 
 EXTRA_OEMAKE = "TCL=${bindir}/tclsh"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch
new file mode 100644
index 0000000..f3c8eeb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch
@@ -0,0 +1,29 @@
+From 08b17ec505e09e8f5a4d73ffc3aa61561ec2e0da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 00:27:54 -0700
+Subject: [PATCH] include sys/stat.h for fixing build issue on musl
+
+error: field has incomplete
+      type 'struct stat'
+        struct stat fs;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/utouch-frame-test-mtdev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/utouch-frame-test-mtdev.c b/tools/utouch-frame-test-mtdev.c
+index 5253320..2032af4 100644
+--- a/tools/utouch-frame-test-mtdev.c
++++ b/tools/utouch-frame-test-mtdev.c
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <sys/stat.h>
+ #include "common-defs.h"
+ 
+ struct frame_test {
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
index 6ec566d..39d46af 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
@@ -10,7 +10,9 @@
 inherit autotools pkgconfig
 
 SRC_URI = "git://bitmath.org/git/frame.git;protocol=http \
-           file://remove-man-page-creation.patch"
+           file://remove-man-page-creation.patch \
+           file://0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch \
+           "
 SRCREV = "95363d5a1f7394d71144bf3b408ef4e6db4350fc"
 
 PV = "1.1.2+git${SRCPV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
index ef0cfaf..1219cb8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
@@ -8,7 +8,7 @@
 PE = "1"
 PR = "r1"
 
-PNBLACKLIST[vala-terminal] ?= "BROKEN: Doesn't work with B!=S, touch: cannot touch `src/.stamp': No such file or directory"
+PNBLACKLIST[vala-terminal] ?= "BROKEN: Doesn't work with B!=S, touch: cannot touch `src/.stamp': No such file or directory - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit autotools perlnative vala
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
index f8a24a5..c7bae1c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
@@ -41,6 +41,10 @@
 # compile and install mount utility
 do_compile_append() {
     oe_runmake 'LD=${CC}' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils
+    if ! [ -e vboxguest.ko -a -e vboxsf.ko -a -e vboxvideo.ko ] ; then
+        echo "ERROR: One of vbox*.ko modules wasn't built"
+        exit 1
+    fi
 }
 
 module_do_install() {
@@ -65,4 +69,4 @@
 KERNEL_MODULE_AUTOLOAD += "vboxguest vboxsf vboxvideo"
 
 # http://errors.yoctoproject.org/Errors/Details/83333/
-PNBLACKLIST[vboxguestdrivers] ?= "BROKEN: not compatible with default kernel version 4.8"
+PNBLACKLIST[vboxguestdrivers] ?= "BROKEN: not compatible with default kernel version 4.8 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb
similarity index 86%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb
index 8665267..4085b9f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb
@@ -14,8 +14,8 @@
 SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \
            file://Makefile.utils \
 "
-SRC_URI[md5sum] = "8c2331a718cfc038963c1214c2ba9811"
-SRC_URI[sha256sum] = "2e0112b0d85841587b8f212e6ba8f6c35b31e1cce6b6999497dc917cd37e6911"
+SRC_URI[md5sum] = "1a7db64cd69ba6d39574fb333e031251"
+SRC_URI[sha256sum] = "7ed0959bbbd02826b86b3d5dc8348931ddfab267c31f8ed36ee53c12f5522cd9"
 
 S = "${WORKDIR}/vbox_module"
 
@@ -41,6 +41,10 @@
 # compile and install mount utility
 do_compile_append() {
     oe_runmake 'LD=${CC}' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils
+    if ! [ -e vboxguest.ko -a -e vboxsf.ko -a -e vboxvideo.ko ] ; then
+        echo "ERROR: One of vbox*.ko modules wasn't built"
+        exit 1
+    fi
 }
 
 module_do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
index 8f824e7..65e5f58 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
@@ -4,10 +4,10 @@
 
 Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
 ================================================
-diff --git a/src/configure.in b/src/configure.in
+diff --git a/src/configure.ac b/src/configure.ac
 index fb965e5..d734064 100644
---- a/src/configure.in
-+++ b/src/configure.in
+--- a/src/configure.ac
++++ b/src/configure.ac
 @@ -2511,7 +2511,7 @@ AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \
  	sys/systeminfo.h locale.h sys/stream.h termios.h \
  	libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
index 693d130..6c620f9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
@@ -7,13 +7,13 @@
 
 Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
 ---
- src/configure.in |    7 +++++++
+ src/configure.ac |    7 +++++++
  1 file changed, 7 insertions(+)
 
-diff --git a/src/configure.in b/src/configure.in
+diff --git a/src/configure.ac b/src/configure.ac
 index d734064..f504fa6 100644
---- a/src/configure.in
-+++ b/src/configure.in
+--- a/src/configure.ac
++++ b/src/configure.ac
 @@ -2483,11 +2483,18 @@ AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
  	AC_MSG_RESULT(no))
  
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0022.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0427.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0022.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0427.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb
similarity index 88%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb
index 112ae80..1f86fcd 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb
@@ -10,11 +10,11 @@
            file://disable_acl_header_check.patch;patchdir=.. \
            file://vim-add-knob-whether-elf.h-are-checked.patch;patchdir=.. \
 "
-SRCREV = "ec68a99464055029c01082762517e97245ddae0c"
+SRCREV = "ad4187e6fc9c8e1083a172852d958a70a689a75c"
 
 S = "${WORKDIR}/git/src"
 
-VIMDIR = "vim${@d.getVar('PV',1).split('.')[0]}${@d.getVar('PV',1).split('.')[1]}"
+VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
 
 inherit autotools update-alternatives
 inherit autotools-brokensep
@@ -32,8 +32,7 @@
 
 #Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
 PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
 
 PACKAGECONFIG[gtkgui] = "--enable-gtk2-test --enable-gui=gtk2,--enable-gui=no,gtk+,"
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
@@ -100,12 +99,14 @@
     ${datadir}/icons \
 "
 
-RDEPENDS_${PN} = "ncurses-terminfo-base"
+RDEPENDS_${BPN} = "ncurses-terminfo-base"
 # Recommend that runtime data is installed along with vim
-RRECOMMENDS_${PN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
+RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
 
 ALTERNATIVE_${PN} = "vi vim"
 ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
 ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
 ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"
 ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch
new file mode 100644
index 0000000..90eff5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch
@@ -0,0 +1,26 @@
+From 0378cbb323c662a565f7f3de2dee3d8a646e7bd1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:32:42 -0700
+Subject: [PATCH 1/2] makefile: Pass CFLAGS to compile
+
+Set CC if not already set
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ host/tools/wmiconfig/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/tools/wmiconfig/Makefile b/host/tools/wmiconfig/Makefile
+index c6738c5..3253a7e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,4 @@
+-CC :=$(ATH_CROSS_COMPILE_TYPE)gcc
++CC ?= $(ATH_CROSS_COMPILE_TYPE)gcc
+ 
+ all:
+-	$(CC) -Wall -DUSER_KEYS -g $(LDFLAGS) -I../../include -I../../../include -I../../wlan/include -I../../os/linux/include wmiconfig.c -o wmiconfig
++	$(CC) -Wall -DUSER_KEYS -g $(CFLAGS) $(LDFLAGS) -I../../include -I../../../include -I../../wlan/include -I../../os/linux/include wmiconfig.c -o wmiconfig
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch
new file mode 100644
index 0000000..f67f784
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch
@@ -0,0 +1,656 @@
+From 909ebdde4ee2233d65de8fa01fde8e9a3bec12b7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:33:26 -0700
+Subject: [PATCH 2/2] fix err() API to have format string
+
+Fixes errors with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ host/tools/wmiconfig/wmiconfig.c | 148 +++++++++++++++++++--------------------
+ 1 file changed, 74 insertions(+), 74 deletions(-)
+
+diff --git a/host/tools/wmiconfig/wmiconfig.c b/host/tools/wmiconfig/wmiconfig.c
+index 21c9dcd..a6ec481 100644
+--- a/wmiconfig.c
++++ b/wmiconfig.c
+@@ -483,7 +483,7 @@ main (int argc, char **argv)
+     strcpy(ifname, ethIf);
+     s = socket(AF_INET, SOCK_DGRAM, 0);
+     if (s < 0) {
+-        err(1, "socket");
++        err(1, "%s", "socket");
+     }
+ 
+     while (1) {
+@@ -1506,28 +1506,28 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)filterCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETBSSFILTER, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_POWER_MODE:
+         ifr.ifr_data = (void *)pwrCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETPWR, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_PM_PARAMS:
+         ifr.ifr_data = (void *)pmParamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_PMPARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_IBSS_PM_CAPS:
+         ifr.ifr_data = (void *)adhocPmCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_ERROR_DETECTION:
+@@ -1535,7 +1535,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_HB_CHALLENGE_RESP:
+@@ -1543,7 +1543,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+ #ifdef USER_KEYS
+@@ -1554,7 +1554,7 @@ main (int argc, char **argv)
+ 
+             if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+             {
+-                err(1, ifr.ifr_name);
++                err(1, "%s", ifr.ifr_name);
+             }
+ 
+             break;
+@@ -1575,7 +1575,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)sParamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETSCAN, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_VERSION:
+@@ -1586,7 +1586,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)revinfo;
+         if (ioctl(s, AR6000_IOCTL_WMI_GETREV, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Host Rev = 0x%x(%u.%u.%u.%u), Target Rev = 0x%x(%u.%u.%u.%u)\n",
+               revinfo->host_ver,
+@@ -1606,14 +1606,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)listenCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETLISTENINT, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BMISS_TIME:
+         ifr.ifr_data = (void *)bmissCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_BMISS_TIME, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_RSSI_THRESHOLDS:
+@@ -1621,14 +1621,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_SNR_THRESHOLDS:
+         ifr.ifr_data = (void *)snrThresholdParam;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_SNRTHRESHOLD, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_CLR_RSSISNR:
+@@ -1636,7 +1636,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_LQ_THRESHOLDS:
+@@ -1644,7 +1644,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_CHANNEL:
+@@ -1693,18 +1693,18 @@ main (int argc, char **argv)
+  
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_CHANNELPARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_SSID:
+         if (index > MAX_PROBED_SSID_INDEX) {
+             printf("num option for ssid command too large\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+             break;
+         }
+         if (strlen((char *)ssid) > sizeof (ssidCmd->ssid)) {
+             printf("ssid name too large\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+             break;
+         }
+         ssidCmd->entryIndex = index;
+@@ -1722,7 +1722,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)ssidCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_PROBEDSSID, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BADAP:
+@@ -1735,7 +1735,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)badApCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_BADAP, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_CREATE_QOS:
+@@ -1794,7 +1794,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)crePStreamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_CREATE_QOS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_TARGET_STATS:
+@@ -1807,7 +1807,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)&tgtStatsCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_GET_TARGET_STATS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printTargetStats(&(tgtStatsCmd.targetStats));
+         break;
+@@ -1815,7 +1815,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)pBitMask;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DELETE_QOS:
+@@ -1824,7 +1824,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)delPStreamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_DELETE_QOS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_QOS_QUEUE:
+@@ -1840,7 +1840,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)getQosQueueCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_GET_QOS_QUEUE, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+ 
+         printf("Active TSIDs \n");
+@@ -1855,7 +1855,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)ieInfo;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ASSOC_INFO, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_AC_PARAMS:
+@@ -1871,14 +1871,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)acParamsCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ACCESS_PARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_DISC_TIMEOUT:
+         ifr.ifr_data = (void *)discCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_DISC_TIMEOUT, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+      case WMI_SET_ADHOC_BSSID:
+@@ -1887,7 +1887,7 @@ main (int argc, char **argv)
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+             printf("fail to set adhoc bssid \n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_OPT_MODE:
+@@ -1895,7 +1895,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_OPT_SEND_FRAME:
+@@ -1903,7 +1903,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BEACON_INT:
+@@ -1911,7 +1911,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_VOICE_PKT_SIZE:
+@@ -1919,7 +1919,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_MAX_SP:
+@@ -1927,7 +1927,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_ROAM_TBL:
+@@ -1935,7 +1935,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_ROAM_CTRL:
+@@ -1943,7 +1943,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_POWERSAVE_TIMERS:
+@@ -1951,7 +1951,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_POWER_MODE:
+@@ -1959,7 +1959,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Power mode is %s\n",
+                (getPowerMode->powerMode == MAX_PERF_POWER) ? "maxperf" : "rec");
+@@ -1969,7 +1969,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_ROAM_DATA:
+@@ -1977,7 +1977,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BT_STATUS:
+@@ -1985,7 +1985,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BT_PARAMS:
+@@ -1993,7 +1993,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;   
+     case WMI_SET_RETRYLIMITS:
+@@ -2001,14 +2001,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_START_SCAN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_STARTSCAN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_FIX_RATES:
+@@ -2031,14 +2031,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_FIX_RATES:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GETFIXRATES;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         } else {
+             int i;
+             printf("Fix rate set index:");
+@@ -2057,7 +2057,7 @@ main (int argc, char **argv)
+         index--;
+         setAuthMode->mode = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_REASSOC_MODE:
+@@ -2067,42 +2067,42 @@ main (int argc, char **argv)
+         index--;
+         setReassocMode->mode = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_LPREAMBLE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_LPREAMBLE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_RTS:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_RTS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_WMM:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_WMM;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_TXOP:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_TXOP;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DIAG_READ:
+         ((int *)buf)[0] = AR6000_XIOCTL_DIAG_READ;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("diagdata: 0x%x\n", *diagdata);
+         break;
+@@ -2110,7 +2110,7 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_DIAG_WRITE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_RD:
+@@ -2118,7 +2118,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         else
+         {
+@@ -2139,14 +2139,14 @@ main (int argc, char **argv)
+         index--;
+         setKeepAlive->keepaliveInterval = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_KEEPALIVE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_KEEPALIVE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Keepalive interval is %d secs and AP is %s\n",
+                getKeepAlive->keepaliveInterval, (getKeepAlive->configured ?
+@@ -2156,63 +2156,63 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_APPIE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_MGMT_FRM_RX_FILTER:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DBGLOG_CFG_MODULE:
+         ((int *)buf)[0] = AR6000_XIOCTL_DBGLOG_CFG_MODULE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DBGLOG_GET_DEBUG_LOGS:
+         ((int *)buf)[0] = AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_HOST_SLEEP_MODE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_WOW_MODE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_WOW_MODE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_ADD_WOW_PATTERN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_ADD_WOW_PATTERN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DEL_WOW_PATTERN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_DEL_WOW_PATTERN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_WOW_LIST:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_WOW_LIST;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DIAG_DUMP_CHIP_MEM:
+@@ -2225,7 +2225,7 @@ main (int argc, char **argv)
+                 ((int *)buf)[0] = AR6000_XIOCTL_DIAG_READ;
+                 ifr.ifr_data = buf;
+                 if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-                    err(1, ifr.ifr_name);
++                    err(1, "%s", ifr.ifr_name);
+                 }
+                 printf("0x%04x:0x%04x\n", *diagaddr, *diagdata);
+             }
+@@ -2237,21 +2237,21 @@ main (int argc, char **argv)
+         index = optind - 1;
+         *connectCtrlFlags = strtoul(argv[index], NULL, 0);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DUMP_HTC_CREDITS:        
+         ((int *)buf)[0] = AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_AKMP_INFO:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_AKMP_PARAMS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_PMKID_LIST:
+@@ -2259,7 +2259,7 @@ main (int argc, char **argv)
+             ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_PMKID_LIST;
+             ifr.ifr_data = buf;
+             if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-                err(1, ifr.ifr_name);
++                err(1, "%s", ifr.ifr_name);
+             }
+         } else {
+             printf("No PMKIDs entered\n");
+@@ -2269,7 +2269,7 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_PMKID_LIST;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BSS_PMKID_INFO:
+@@ -2277,7 +2277,7 @@ main (int argc, char **argv)
+         iwr.u.data.length = sizeof(*pi_cmd);
+         if (ioctl(s, IEEE80211_IOCTL_ADDPMKID, &iwr) < 0) {
+             printf("ADDPMKID IOCTL Error\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     default:
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
index 596a4e6..c66572b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
@@ -6,7 +6,10 @@
 PV = "0.0.0+svnr${SRCPV}"
 PR = "r2"
 
-SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=AR6kSDK.build_sw.18;protocol=http"
+SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=AR6kSDK.build_sw.18;protocol=http \
+           file://0001-makefile-Pass-CFLAGS-to-compile.patch \
+           file://0002-fix-err-API-to-have-format-string.patch \
+           "
 S = "${WORKDIR}/AR6kSDK.build_sw.18/host/tools/wmiconfig"
 
 CLEANBROKEN = "1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
index 6da11cd..408c700 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
@@ -35,3 +35,5 @@
 
 SRC_URI[md5sum] = "6775c44f38e84d06c06c336b32c4a452"
 SRC_URI[sha256sum] = "0d6d69437b5e1e45f3e66270fe369344943de8a1190e498fafa5296315a27db0"
+
+PNBLACKLIST[xchat] ?= "Depends on blacklisted libsexy - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch
new file mode 100644
index 0000000..b2b0e49
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch
@@ -0,0 +1,31 @@
+From 41093d9634bfeddcaec866745d8d4022f4c6f8c1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Sun, 19 Feb 2017 21:01:39 +0100
+Subject: [PATCH] explicitly disable man generation --disable-documentation is
+ not enough
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index c01c54f..dcdf7a2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ NULL =
+ 
+-SUBDIRS=po man
++SUBDIRS=po
+ 
+ INCLUDES =					\
+ 	-I$(top_srcdir)				\
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
index b94e0cc..c056759 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
@@ -4,6 +4,7 @@
 
 SRC_URI = " \
     http://user-dirs.freedesktop.org/releases/${BPN}-${PV}.tar.gz \
+    file://0001-explicitly-disable-man-generation-disable-documentat.patch \
     file://xdg-user-dirs.desktop \
 "
 SRC_URI[md5sum] = "f5aaf5686ad7d8809a664bfb4566a54d"
@@ -11,6 +12,8 @@
 
 inherit autotools gettext
 
+EXTRA_OECONF = "--disable-documentation"
+
 do_install_append () {
     install -d ${D}${sysconfdir}/xdg/autostart
     install -m 644 ${WORKDIR}/xdg-user-dirs.desktop ${D}${sysconfdir}/xdg/autostart
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch
new file mode 100644
index 0000000..04239ba
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch
@@ -0,0 +1,32 @@
+From 224507bc4b6e58f7a6e445bfebfb59d6b8d78bd6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Dec 2016 17:38:51 -0800
+Subject: [PATCH] make relies GNU extentions
+
+We get errors like
+`%'-style pattern rules are a GNU make extension
+
+Disable this warning, since we use gmake with OE
+anyway
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 56d3dd0..9f85fd7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,7 +3,7 @@ AC_PREREQ([2.61])
+ AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2])
++AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-portability foreign subdir-objects std-options dist-bzip2])
+ AC_CONFIG_HEADERS([include/config.h])
+ AC_CONFIG_SRCDIR(zbar/scanner.c)
+ LT_PREREQ([2.2])
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch
new file mode 100644
index 0000000..f7d8ba1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch
@@ -0,0 +1,51 @@
+From f842872244219d9881fbec77054702412b1e16f8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Dec 2016 16:41:27 -0800
+Subject: [PATCH] undefine __va_arg_pack
+
+dprintf() is also a libc function. This fixes
+the compile errors
+
+/usr/include/bits/stdio2.h:140:1: error: expected identifier or '(' before '{' token
+|  {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ zbar/debug.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/zbar/debug.h b/zbar/debug.h
+index 482ca8d..68948f6 100644
+--- a/zbar/debug.h
++++ b/zbar/debug.h
+@@ -23,6 +23,7 @@
+ 
+ /* varargs variations on compile time debug spew */
+ 
++#undef __va_arg_pack
+ #ifndef DEBUG_LEVEL
+ 
+ # ifdef __GNUC__
+@@ -36,15 +37,14 @@
+ #else
+ 
+ # include <stdio.h>
+-
+ # ifdef __GNUC__
+-#  define dprintf(level, args...) \
++#  define dprintf(level, format, args...) \
+     if((level) <= DEBUG_LEVEL)    \
+-        fprintf(stderr, args)
++        fprintf(stderr, format, args)
+ # else
+-#  define dprintf(level, ...)     \
++#  define dprintf(level, format, ...)     \
+     if((level) <= DEBUG_LEVEL)    \
+-        fprintf(stderr, __VA_ARGS__)
++        fprintf(stderr, format, __VA_ARGS__)
+ # endif
+ 
+ #endif /* DEBUG_LEVEL */
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb
new file mode 100644
index 0000000..6b6e501
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb
@@ -0,0 +1,28 @@
+DESRIPTION = "2D barcode scanner toolkit."
+SECTION = "graphics"
+LICENSE = "LGPL-2.1"
+
+DEPENDS = "pkgconfig intltool-native libpng jpeg"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=42bafded1b380c6fefbeb6c5cd5448d9"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${P}.tar.bz2 \
+           file://0001-undefine-__va_arg_pack.patch \
+           file://0001-make-relies-GNU-extentions.patch \
+"
+
+SRC_URI[md5sum] = "0fd61eb590ac1bab62a77913c8b086a5"
+SRC_URI[sha256sum] = "234efb39dbbe5cef4189cc76f37afbe3cfcfb45ae52493bfe8e191318bdbadc6"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+
+PACKAGECONFIG[x11] = "--with-x,-without-x,libxcb libx11 libsm libxau libxext libxv libice libxdmcp"
+
+EXTRA_OECONF = " --without-imagemagick --without-qt --without-python --disable-video --without-gtk"
+
+do_install_append() {
+    #remove usr/bin if empty
+    rmdir ${D}${bindir}
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
index 49fbaea..d663f44b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
@@ -20,6 +20,6 @@
 }
 
 PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
 
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"