Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-initramfs/README b/import-layers/meta-openembedded/meta-initramfs/README
index 9c05e1fd..b7dbfef 100644
--- a/import-layers/meta-openembedded/meta-initramfs/README
+++ b/import-layers/meta-openembedded/meta-initramfs/README
@@ -12,7 +12,7 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: pyro
+branch: rocko
 revision: HEAD
 
 
@@ -20,12 +20,12 @@
 -----------
 
 Send patches / pull requests to openembedded-devel@lists.openembedded.org
-with '[meta-initramfs][pyro]' in the subject.
+with '[meta-initramfs][rocko]' in the subject.
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-initramfs][pyro][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-initramfs][rocko][PATCH'
 
-pyro Branch Maintainer:
+rocko Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
 
 
diff --git a/import-layers/meta-openembedded/meta-initramfs/classes/klibc.bbclass b/import-layers/meta-openembedded/meta-initramfs/classes/klibc.bbclass
index f864104..b7b72b7 100644
--- a/import-layers/meta-openembedded/meta-initramfs/classes/klibc.bbclass
+++ b/import-layers/meta-openembedded/meta-initramfs/classes/klibc.bbclass
@@ -3,13 +3,14 @@
 
 # Default for klcc is to build static binaries.
 # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version.
+CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
+CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
+CC_append_armv7ve = " ${@' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}"
+CC_append_armv7a = " ${@' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}"
 
-export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
-export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
-
-export CPP = "${CC} -E"
+CPP_forcevariable = "${CC} -E"
 
 # klcc uses own optimizations by default. See klcc(1) man file.
-export CFLAGS=""
-export CPPFLAGS=""
-export LDFLAGS=""
+export CFLAGS="${TUNE_CCARGS}"
+export CPPFLAGS="${TUNE_CCARGS}"
+export LDFLAGS="${TUNE_CCARGS}"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
index 835b307..2573eb4 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
@@ -1,7 +1,7 @@
 SUMMARY = "Initramfs image for kexecboot kernel"
 DESCRIPTION = "This image provides kexecboot (linux as bootloader) and helpers."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
 inherit image
 
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb
index b7defff..667690f 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb
@@ -1,6 +1,6 @@
 SUMMARY = "Extremely basic live image init script"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 SRC_URI = "file://init-debug.sh"
 
 S = "${WORKDIR}"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch
deleted file mode 100644
index 6d3270f..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 8519d61a7097498b0ee93fb8dc8262286825f3e5 Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Thu, 1 May 2014 23:58:51 +0200
-Subject: [PATCH 1/4] kexecboot: fix build when S != B
-
-* fatal error: ../config.h: No such file or directory
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- machine/zaurus.c | 2 +-
- res/theme-gui.h  | 2 +-
- res/theme-tui.h  | 4 ++--
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/machine/zaurus.c b/machine/zaurus.c
-index ea21047..83be13b 100644
---- a/machine/zaurus.c
-+++ b/machine/zaurus.c
-@@ -25,7 +25,7 @@
-  *
-  */
- 
--#include "../config.h"
-+#include "config.h"
- 
- #ifdef USE_ZAURUS
- 
-diff --git a/res/theme-gui.h b/res/theme-gui.h
-index f8fef7f..79bed39 100644
---- a/res/theme-gui.h
-+++ b/res/theme-gui.h
-@@ -15,7 +15,7 @@
-  *
-  */
- 
--#include "../config.h"
-+#include "config.h"
- 
- #ifdef USE_ICONS
- /** Icons **/
-diff --git a/res/theme-tui.h b/res/theme-tui.h
-index 94e7693..909be56 100644
---- a/res/theme-tui.h
-+++ b/res/theme-tui.h
-@@ -15,11 +15,11 @@
-  *
-  */
- 
--#include "../config.h"
-+#include "config.h"
- 
- #ifdef USE_TEXTUI
- /** TEXT UI colors **/
--#include "../termseq.h"
-+#include "termseq.h"
- 
- /* Background color pair */
- #define TUI_CLR_BG		TERM_CSI TERM_BG_BLACK ";" TERM_FG_WHITE TERM_SGR
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch
deleted file mode 100644
index ecf422b..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From b8938acc3f1ab35273fa9a2fa7728050ef72ff65 Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Fri, 2 May 2014 00:19:24 +0200
-Subject: [PATCH 2/4] kexecboot: fix configure warnings
-
-Makefile.am:5: warning: source file 'fstype/fstype.c' is in a subdirectory,
-Makefile.am:5: but option 'subdir-objects' is disabled
-automake: warning: possible forward-incompatibility.
-...
-Makefile.am:5: warning: source file 'machine/zaurus.c' is in a subdirectory,
-...
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0ca4b81..66ec54e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,7 +1,7 @@
- AC_PREREQ(2.53)
- AC_INIT([kexecboot], [0.6], [kexecboot-devel@linuxtogo.org])
- AC_CANONICAL_HOST
--AM_INIT_AUTOMAKE([-Wall foreign])
-+AM_INIT_AUTOMAKE([-Wall foreign] [subdir-objects])
- AC_CONFIG_SRCDIR(kexecboot.c)
- AC_CONFIG_HEADERS(config.h)
- AM_MAINTAINER_MODE
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch
deleted file mode 100644
index 4caa0d5..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 800dae0d34f8629a34c638a612166b76dda03e27 Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Sat, 2 Aug 2014 01:13:08 +0200
-Subject: [PATCH 3/4] kexecboot: do not hardcode MOUNTPOINT
-
-Avoid to hardcode it: could be requested as a new configure option.
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- cfgparser.c |  6 +++---
- kexecboot.c | 18 ++++++++++--------
- 2 files changed, 13 insertions(+), 11 deletions(-)
-
-diff --git a/cfgparser.c b/cfgparser.c
-index 8f6688c..dec27b1 100644
---- a/cfgparser.c
-+++ b/cfgparser.c
-@@ -141,7 +141,7 @@ static int set_kernel(struct cfgdata_t *cfgdata, char *value)
- 		return -1;
- 	}
- 
--	strcpy(sc->kernelpath, "/mnt");
-+	strcpy(sc->kernelpath, MOUNTPOINT);
- 	strcat(sc->kernelpath, value);
- 	return 0;
- }
-@@ -155,7 +155,7 @@ static int set_icon(struct cfgdata_t *cfgdata, char *value)
- 
- 	dispose(sc->iconpath);
- 	/* Add our mountpoint, since the enduser won't know it */
--	sc->iconpath = malloc(sizeof(MOUNTPOINT)+strlen(value));
-+	sc->iconpath = malloc(strlen(MOUNTPOINT)+strlen(value)+1);
- 	if (NULL == sc->iconpath) {
- 		DPRINTF("Can't allocate memory to store iconpath '%s'", value);
- 		return -1;
-@@ -194,7 +194,7 @@ static int set_initrd(struct cfgdata_t *cfgdata, char *value)
- 		return -1;
- 	}
- 
--	strcpy(sc->initrd, "/mnt");
-+	strcpy(sc->initrd, MOUNTPOINT);
- 	strcat(sc->initrd, value);
- 	return 0;
- }
-diff --git a/kexecboot.c b/kexecboot.c
-index d6657a0..7268d6b 100644
---- a/kexecboot.c
-+++ b/kexecboot.c
-@@ -57,20 +57,22 @@
- #endif
- 
- #ifdef USE_MACHINE_KERNEL
--/* Machine-dependent kernel patch */
-+/* Machine-dependent kernel path */
- char *machine_kernel = NULL;
- #endif
- 
-+#define PREPEND_MOUNTPATH(string) MOUNTPOINT""string
-+
- /* NULL-terminated array of kernel search paths
-  * First item should be filled with machine-dependent path */
- char *default_kernels[] = {
- #ifdef USE_ZIMAGE
--	"/mnt/boot/zImage",
--	"/mnt/zImage",
-+	PREPEND_MOUNTPATH("/boot/zImage"),
-+	PREPEND_MOUNTPATH("/zImage"),
- #endif
- #ifdef USE_UIMAGE
--	"/mnt/boot/uImage",
--	"/mnt/uImage",
-+	PREPEND_MOUNTPATH("/boot/uImage"),
-+	PREPEND_MOUNTPATH("/uImage"),
- #endif
- 	NULL
- };
-@@ -149,14 +151,14 @@ char *get_machine_kernelpath() {
- 			++tmp;
- 		}
- 
--		/* Prepend "/mnt/boot/zImage-" to hw */
--		tmp = malloc(strlen(hw) + 17 + 1);	/* strlen("/mnt/boot/zImage-") */
-+		/* Prepend  MOUNTPOINT"/boot/zImage-" to hw */
-+		tmp = malloc(strlen(PREPEND_MOUNTPATH("/boot/zImage-")) + strlen(hw) + 1);
- 		if (NULL == tmp) {
- 			DPRINTF("Can't allocate memory for machine-specific kernel path");
- 			return NULL;
- 		}
- 
--		strcpy(tmp, "/mnt/boot/zImage-");
-+		strcpy(tmp, PREPEND_MOUNTPATH("/boot/zImage-"));
- 		strcat(tmp, hw);
- 
- 		return tmp;
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch
deleted file mode 100644
index 6d81d83..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From de9a6284df8add6ec03e1d9981d0b6d0595bbc69 Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Mon, 10 Nov 2014 23:37:23 +0100
-Subject: [PATCH 4/4] kexecboot.c: workaround for absolute kernel and initrd
- symlinks
-
-Add MOUNTPOINT prefix if the kernel/initrd symlinks start with '/'.
-Do nothing if the path is a relative symbolic link or not a symlink.
-
-Fix following situation:
-
-root@mizar:/var/tmp# ls -al boot/
-total 2076
-drwxr-xr-x 2 root root    4096 lug  5 01:38 .
-drwxrwxrwt 4 root root    4096 lug  5 12:26 ..
--rw-r--r-- 1 root root     831 lug  5 01:24 boot.cfg
--rw-r--r-- 1 root root    1322 lug  5 01:24 icon.xpm
-lrwxrwxrwx 1 root root      34 lug  5 12:26 zImage ->
-/boot/zImage-3.14.5-yocto-standard
--rw-r--r-- 1 root root 2106832 lug  5 01:20 zImage-3.14.5-yocto-standard
-
-Cannot open `/mnt/boot/zImage': No such file or directory
-Nothing has been loaded!
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- kexecboot.c | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
- 1 file changed, 44 insertions(+), 9 deletions(-)
-
-diff --git a/kexecboot.c b/kexecboot.c
-index 7268d6b..8a7a7d2 100644
---- a/kexecboot.c
-+++ b/kexecboot.c
-@@ -208,11 +208,16 @@ void start_kernel(struct params_t *params, int choice)
- 	const char *load_argv[] = { NULL, "-l", NULL, NULL, NULL, NULL };
- 	const char *exec_argv[] = { NULL, "-e", NULL, NULL};
- 
--	char *cmdline_arg = NULL, *initrd_arg = NULL;
-+	char *cmdline_arg = NULL, *initrd_arg = NULL, *kernel_arg = NULL;
- 	int n, idx, u;
- 	struct stat sinfo;
- 	struct boot_item_t *item;
- 
-+	/* buffer for readlink (could be truncated) */
-+	char buf[512];
-+	int len;
-+
-+
- 	item = params->bootcfg->list[choice];
- 
- 	exec_argv[0] = kexec_path;
-@@ -306,10 +311,17 @@ void start_kernel(struct params_t *params, int choice)
- 		}
- 	}
- 
-+	/* Mount boot device */
-+	if ( -1 == mount(mount_dev, mount_point, mount_fstype,
-+			MS_RDONLY, NULL) ) {
-+		perror("Can't mount boot device");
-+		exit(-1);
-+	}
-+
- 	/* fill '--initrd' option */
- 	if (item->initrd) {
- 		/* allocate space */
--		n = sizeof(str_initrd_start) + strlen(item->initrd);
-+		n = sizeof(str_initrd_start) + strlen(item->initrd) + 1 + sizeof(mount_point) + sizeof(buf);
- 
- 		initrd_arg = (char *)malloc(n);
- 		if (NULL == initrd_arg) {
-@@ -317,24 +329,46 @@ void start_kernel(struct params_t *params, int choice)
- 		} else {
- 			strcpy(initrd_arg, str_initrd_start);	/* --initrd= */
- 			strcat(initrd_arg, item->initrd);
-+
-+			if ((len = readlink(item->initrd, buf, sizeof(buf)-1)) != -1) {
-+				buf[len] = '\0';
-+				/* Fix absolute symlinks: prepend MOUNTPOINT */
-+				if (buf[0] == '/') {
-+					strcpy(initrd_arg, str_initrd_start);	/* --initrd= */
-+					strcat(initrd_arg, mount_point);
-+					strcat(initrd_arg, buf);
-+				}
-+			}
- 			load_argv[idx] = initrd_arg;
- 			++idx;
- 		}
- 	}
- 
- 	/* Append kernelpath as last arg of kexec */
--	load_argv[idx] = item->kernelpath;
-+		/* allocate space */
-+		n = strlen(item->kernelpath) + 1 + sizeof(mount_point) + sizeof(buf);
-+
-+		kernel_arg = (char *)malloc(n);
-+		if (NULL == kernel_arg) {
-+			perror("Can't allocate memory for kernel_arg");
-+		} else {
-+			strcpy(kernel_arg, item->kernelpath);
-+
-+			if ((len = readlink(item->kernelpath, buf, sizeof(buf)-1)) != -1) {
-+				buf[len] = '\0';
-+				/* Fix absolute symlinks: prepend MOUNTPOINT */
-+				if (buf[0] == '/') {
-+					strcpy(kernel_arg, mount_point);
-+					strcat(kernel_arg, buf);
-+				}
-+			}
-+			load_argv[idx] = kernel_arg;
-+		}
- 
- 	DPRINTF("load_argv: %s, %s, %s, %s, %s", load_argv[0],
- 			load_argv[1], load_argv[2],
- 			load_argv[3], load_argv[4]);
- 
--	/* Mount boot device */
--	if ( -1 == mount(mount_dev, mount_point, mount_fstype,
--			MS_RDONLY, NULL) ) {
--		perror("Can't mount boot device");
--		exit(-1);
--	}
- 
- 	/* Load kernel */
- 	n = fexecw(kexec_path, (char *const *)load_argv, envp);
-@@ -347,6 +381,7 @@ void start_kernel(struct params_t *params, int choice)
- 
- 	dispose(cmdline_arg);
- 	dispose(initrd_arg);
-+	dispose(kernel_arg);
- 
- 	/* Check /proc/sys/net presence */
- 	if ( -1 == stat("/proc/sys/net", &sinfo) ) {
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch
deleted file mode 100644
index b54199b..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From b2c4fc69868a4831ec798ad98f5e7fce200cf0e3 Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Thu, 24 Sep 2015 00:02:48 +0200
-Subject: [PATCH] rgb.h: fix build with gcc 5 (C99 inline semantic)
-
-Building with gcc 5.2 we trigger the following error:
-
-rgb.h:55:1: warning: inline function 'rgba2comp' declared but never defined
-|  rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
-|  ^
-
-https://gcc.gnu.org/gcc-5/porting_to.html
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- rgb.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/rgb.h b/rgb.h
-index 0ba987a..4f64622 100644
---- a/rgb.h
-+++ b/rgb.h
-@@ -51,8 +51,7 @@ typedef struct {
- } kx_named_color;
- 
- /* Convert RGBA uint32 to red/green/blue/alpha components */
--inline void
--rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
-+void rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
- 		kx_ccomp *blue, kx_ccomp *alpha);
- 
- /* Convert hex rgb color to rgba color */
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
index 085955c..804ec32 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
@@ -2,7 +2,7 @@
 DESCRIPTION = "Default icon and boot.cfg for kexecboot linux-as-bootloader."
 SECTION = "base"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
 SRC_URI = "file://icon.xpm"
 
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
similarity index 81%
rename from import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb
rename to import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
index 45095f3..9f5dad7 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
@@ -36,21 +36,10 @@
 HOMEPAGE = "http://kexecboot.org"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-S = "${WORKDIR}/kexecboot-${PV}"
-SRC_URI = "https://github.com/kexecboot/kexecboot/archive/v${PV}.tar.gz"
-SRC_URI[md5sum] = "46b7c1a6f20531be56445ebb8669a2b8"
-SRC_URI[sha256sum] = "6b360b8aa59bc5d68a96705349a0dd416f8ed704e931fa0ac7849298258f0f15"
-
-SRC_URI += "\
-            file://0001-kexecboot-fix-build-when-S-B.patch \
-            file://0002-kexecboot-fix-configure-warnings.patch \
-            file://0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch \
-            file://0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch \
-            \
-            file://0005-rgb.h-fix-build-with-gcc5.patch \
-            "
-
+PV = "0.6+git${SRCPV}"
+S = "${WORKDIR}/git"
+SRC_URI = "git://github.com/kexecboot/kexecboot.git"
+SRCREV = "4c4f127e79ac5b8d6b6e2fbb938ccbf12b04c531"
 inherit autotools
 
 EXTRA_OECONF = "--enable-textui --enable-delay=2 --enable-evdev-rate=1000,250"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch
new file mode 100644
index 0000000..3271403
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch
@@ -0,0 +1,33 @@
+From 06011ce55b1e892e863568a73d64eebc6389544f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 17:14:05 -0700
+Subject: [PATCH] util.h: include <sys/reg.h> when libc != glibc
+
+For musl libc it is required to include <sys/reg.h> to
+have __WORDSIZE defined to e.g. 32 for arm*-musl.
+
+Taken from void-linux
+https://github.com/voidlinux/void-packages/blob/master/srcpkgs/dracut/patches/musl-__wordsize.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ install/util.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/install/util.h b/install/util.h
+index 2ad3254d..062626ec 100644
+--- a/install/util.h
++++ b/install/util.h
+@@ -36,6 +36,9 @@
+ #include <sys/stat.h>
+ #include <dirent.h>
+ #include <sys/resource.h>
++#if !defined(__GLIBC__)
++#include <sys/reg.h>
++#endif
+ 
+ #include "macro.h"
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
index b91f3fa..e18409d 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
@@ -1,17 +1,23 @@
 SUMMARY = "Initramfs generator using udev"
+HOMEPAGE = "https://dracut.wiki.kernel.org/index.php/Main_Page"
 DESCRIPTION = "Dracut is an event driven initramfs infrastructure. dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the dracut framework, usually found in /usr/lib/dracut/modules.d."
 
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 PE = "1"
-PV = "044+git${SRCREV}"
+PV = "045+git${SRCREV}"
 
-# v044 tag
-SRCREV = "1bc3e733f96033a508841e97fe08da7a12851782"
-SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http"
+# v045 tag
+SRCREV = "39c9b67f86145953aa30def9d77c68597a4ccfe8"
+SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \
+           file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
+           "
 
-inherit bash-completion
+DEPENDS += "kmod"
+DEPENDS_append_libc-musl = " fts"
+
+inherit bash-completion pkgconfig
 
 S = "${WORKDIR}/git"
 
@@ -30,7 +36,9 @@
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd"
 
-EXTRA_OEMAKE += 'libdir=${prefix}/lib'
+EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"'
+
+LDLIBS_append_libc-musl = " -lfts"
 
 do_configure() {
     ./configure ${EXTRA_OECONF}
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch
new file mode 100644
index 0000000..1b1a993
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch
@@ -0,0 +1,26 @@
+From 22afaa21b4b258082be591e54c99e1ba6fbd7748 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 10:19:22 -0700
+Subject: [PATCH 1/2] Add another variable LIBS to provides libraries from env
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index ac14404..92a8e73 100644
+--- a/Makefile
++++ b/Makefile
+@@ -27,7 +27,7 @@ RPM_OPT_FLAGS ?= -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
+ CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb
+ LDFLAGS := 
+ 
+-grubby_LIBS = -lblkid -lpopt
++grubby_LIBS = -lblkid -lpopt ${LIBS}
+ 
+ all: grubby
+ 
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch
new file mode 100644
index 0000000..de8133a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch
@@ -0,0 +1,25 @@
+From 8f844ac7f44b8dc428d06cd6958c5f32d383d01c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 10:19:50 -0700
+Subject: [PATCH 2/2] include paths.h for _PATH_MOUNTED
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ grubby.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/grubby.c b/grubby.c
+index 47a1a15..59f74a9 100644
+--- a/grubby.c
++++ b/grubby.c
+@@ -34,6 +34,7 @@
+ #include <libgen.h>
+ #include <execinfo.h>
+ #include <signal.h>
++#include <paths.h>
+ #include <blkid/blkid.h>
+ 
+ #include "log.h"
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb
index 0e93790..5a99824 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb
@@ -9,11 +9,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a"
 
 DEPENDS = "popt util-linux"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 SRC_URI = "https://github.com/rhinstaller/${BPN}/archive/${PV}-1.tar.gz;downloadfilename=${BPN}-${PV}-1.tar.gz \
            file://grubby-rename-grub2-editenv-to-grub-editenv.patch \
            file://run-ptest \
-"
+           file://0001-Add-another-variable-LIBS-to-provides-libraries-from.patch \
+           file://0002-include-paths.h-for-_PATH_MOUNTED.patch \
+           "
 
 SRC_URI[md5sum] = "1005907b275d6d93368d045274537d86"
 SRC_URI[sha256sum] = "85f1c678484f74c8978e8643451594967defce463a86c35cb1ee56d12767a9df"
@@ -24,8 +27,10 @@
 
 inherit autotools-brokensep ptest
 
-EXTRA_OEMAKE = "-e 'CC=${CC}' 'LDFLAGS=${LDFLAGS}'"
+EXTRA_OEMAKE = "-e 'CC=${CC}' 'LDFLAGS=${LDFLAGS}' LIBS='${LIBS}'"
 
+LIBS_libc-musl = "-lexecinfo"
+LIBS ?= ""
 do_install_ptest() {
     install -d ${D}${PTEST_PATH}
     cp -r ${S}/test ${S}/test.sh ${D}${PTEST_PATH}
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch
new file mode 100644
index 0000000..7cd4c0e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch
@@ -0,0 +1,30 @@
+From 10fb440795a7796140bd657ee028847ec7c34447 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Sep 2017 23:10:54 -0700
+Subject: [PATCH] Kbuild.klibc: Add path to compiler headers via -isystem
+
+We need to include this path so it can find compiler headers e.g.
+stdarg.h which is called from wrapper stdarg.h using include_next
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ scripts/Kbuild.klibc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
+index f500d535..1d5cdc43 100644
+--- a/scripts/Kbuild.klibc
++++ b/scripts/Kbuild.klibc
+@@ -105,7 +105,8 @@ KLIBCOBJCOPY     := $(OBJCOPY)
+ KLIBCOBJDUMP     := $(OBJDUMP)
+ 
+ # klibc include paths
+-KLIBCCPPFLAGS    := -nostdinc -iwithprefix include \
++KLIBCCPPFLAGS    := -nostdinc -iwithprefix include      \
++		    -isystem $(shell $(CC) -print-file-name=include) \
+ 		    -I$(KLIBCINC)/arch/$(KLIBCARCHDIR)	\
+                     -I$(KLIBCINC)/bits$(KLIBCBITSIZE)	\
+ 		    -I$(KLIBCOBJ)/../include		\
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch
new file mode 100644
index 0000000..41cc142
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch
@@ -0,0 +1,30 @@
+From f66edde8a704131d98e8783ea8d4c848e8119b20 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 26 Jul 2017 16:13:16 -0700
+Subject: [PATCH 1/3] Kbuild.klibc: Use -print-libgcc-file-name instead of
+ --print-libgcc
+
+-print-libgcc-file-name works with clang and gcc unlike --print-libgcc
+which is gcc specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ scripts/Kbuild.klibc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
+index f500d535..101f86f5 100644
+--- a/scripts/Kbuild.klibc
++++ b/scripts/Kbuild.klibc
+@@ -128,7 +128,7 @@ KLIBCCFLAGS      += $(KLIBCCPPFLAGS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS)  \
+ KLIBCAFLAGS      += -D__ASSEMBLY__ $(KLIBCCFLAGS)
+ KLIBCSTRIPFLAGS  += --strip-all -R .comment -R .note
+ 
+-KLIBCLIBGCC_DEF  := $(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-libgcc)
++KLIBCLIBGCC_DEF  := $(shell $(KLIBCCC) $(KLIBCCFLAGS) -print-libgcc-file-name)
+ KLIBCLIBGCC	 ?= $(KLIBCLIBGCC_DEF)
+ KLIBCCRT0        := $(KLIBCOBJ)/arch/$(KLIBCARCHDIR)/crt0.o
+ KLIBCLIBC        := $(KLIBCOBJ)/libc.a
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch
new file mode 100644
index 0000000..9c0ea63
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch
@@ -0,0 +1,33 @@
+From a46a144ac883898d9cedf7a0b13aec6d10116125 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Sep 2017 23:11:53 -0700
+Subject: [PATCH] arm: Do not set a fallback march and mtune
+
+In OE we pass the options explicitly, there is
+no need to set it inside the makefiles, we will
+need to compute values for CPU_ARCH and CPU_TUNE
+which is a bit harder in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ usr/klibc/arch/arm/MCONFIG | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG
+index 53bc1dc3..857e2f2d 100644
+--- a/usr/klibc/arch/arm/MCONFIG
++++ b/usr/klibc/arch/arm/MCONFIG
+@@ -10,7 +10,7 @@
+ CPU_ARCH ?= armv4
+ CPU_TUNE ?= strongarm
+ 
+-KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
++KLIBCOPTFLAGS += -Os
+ KLIBCBITSIZE  = 32
+ KLIBCREQFLAGS += -fno-exceptions
+ KLIBCSTRIPFLAGS += -R .ARM.exidx
+-- 
+2.14.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
index cd3f398..30294b1 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -17,6 +17,9 @@
            file://0001-include-linux-sysinfo.h-directly.patch \
            file://0001-mkfifo-Implement-mkfifo.patch \
            file://0001-always-use-bfd-linker.patch \
+           file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \
+           file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \
+           file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \
 "
 
 ARMPATCHES ?= ""
@@ -38,7 +41,8 @@
                 'INSTALLDIR=${libdir}/klibc' \
                 'SHLIBDIR=${libdir}' \
                 '${KLIBCTHUMB}' \
-                'KLIBCOPTFLAGS=${TUNE_CCARGS}' \
+                'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \
+                 V=1 \
                 "
 
 export FIX_ARMV4_EABI_BX = "${FIX_V4BX}"
@@ -48,6 +52,10 @@
     ln -sf "${STAGING_DIR_TARGET}${exec_prefix}" linux
 }
 
+do_compile_prepend_toolchain-clang() {
+    sed -i -e 's#$(KLIBCROSS)gcc#$(KLIBCROSS)clang#g' ${S}/Makefile
+}
+
 INHIBIT_PACKAGE_STRIP = "1"
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 INSANE_SKIP_${PN} = "already-stripped"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch
index 9d5e4eb..6e1b9ff 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch
@@ -25,11 +25,11 @@
  Makefile | 24 ++----------------------
  1 file changed, 2 insertions(+), 22 deletions(-)
 
-diff --git a/Makefile b/Makefile
-index eade234..2275865 100644
---- a/Makefile
-+++ b/Makefile
-@@ -16,28 +16,13 @@ endif
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -16,28 +16,11 @@ endif
  
  TESTS = tests
  
@@ -37,7 +37,7 @@
 -	ftl_format flash_erase nanddump doc_loadbios \
 -	ftl_check mkfs.jffs2 flash_lock flash_unlock \
 -	flash_otp_info flash_otp_dump flash_otp_lock flash_otp_write \
--	mtd_debug flashcp nandwrite nandtest \
+-	mtd_debug flashcp nandwrite nandtest mtdpart \
 -	jffs2dump \
 -	nftldump nftl_format docfdisk \
 -	rfddump rfdformat \
@@ -51,15 +51,15 @@
 -BINS += mkfs.ubifs/mkfs.ubifs
 -BINS += $(addprefix ubi-utils/,$(UBI_BINS))
 -SCRIPTS = flash_eraseall
-+BINS = $(addprefix ubi-utils/,$(UBI_BINS))
- 
- TARGETS = $(BINS)
+-
+-TARGETS = $(BINS)
 -TARGETS += lib/libmtd.a
 -TARGETS += ubi-utils/libubi.a
++BINS = $(addprefix ubi-utils/,$(UBI_BINS))
  
  OBJDEPS = $(BUILDDIR)/include/version.h
  
-@@ -61,12 +46,9 @@ endif
+@@ -61,12 +44,9 @@ endif
  	rm -f $(BUILDDIR)/include/version.h
  	$(MAKE) -C $(TESTS) clean
  
@@ -73,7 +73,7 @@
  
  tests::
  	$(MAKE) -C $(TESTS)
-@@ -91,8 +73,6 @@ LDLIBS_mkfs.jffs2  = -lz $(LZOLDLIBS)
+@@ -91,8 +71,6 @@ LDLIBS_mkfs.jffs2  = -lz $(LZOLDLIBS)
  LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
  LDLIBS_jffs2reader  = -lz $(LZOLDLIBS)
  
@@ -82,6 +82,3 @@
  #
  # Common libmtd
  #
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch
index 2e43d5d..6b09c14 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch
@@ -22,20 +22,11 @@
  include/common.h | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
 
-diff --git a/include/common.h b/include/common.h
-index 77f3f7d..2cbee0f 100644
---- a/include/common.h
-+++ b/include/common.h
-@@ -126,7 +126,7 @@ static char __PRIxoff_t_static_assert[sizeof(off_t) == 8 ? 1 : -1];
- 	fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
- } while(0)
- 
--#if defined(__UCLIBC__)
-+#if defined(__UCLIBC__) || defined(__KLIBC__)
- /* uClibc versions before 0.9.34 don't have rpmatch() */
- #if __UCLIBC_MAJOR__ == 0 && \
- 		(__UCLIBC_MINOR__ < 9 || \
-@@ -146,15 +146,17 @@ static inline int __rpmatch(const char *resp)
+Index: git/include/common.h
+===================================================================
+--- git.orig/include/common.h
++++ git/include/common.h
+@@ -161,15 +161,17 @@ static inline int __rpmatch(const char *
   */
  static inline bool prompt(const char *msg, bool def)
  {
@@ -56,6 +47,3 @@
  			printf("failed to read prompt; assuming '%s'\n",
  				def ? "yes" : "no");
  			break;
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.2.bb
similarity index 90%
rename from import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb
rename to import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.2.bb
index 8674077..518c02f 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.2.bb
@@ -9,7 +9,8 @@
 
 inherit klibc
 
-SRC_URI = "git://git.infradead.org/mtd-utils.git;tag=b7455d847ab4f9eeeb6a729efc306bfda7bddc99 \
+SRCREV = "aea36417067dade75192bafa03af70b6eb2677b1"
+SRC_URI = "git://git.infradead.org/mtd-utils.git \
              file://0001-Makefile-only-build-ubi-utils.patch \
              file://0002-common.mk-for-klibc-CC-is-klcc.patch \
              file://0003-libubi.c-add-klibc-specific-fixes.patch \
@@ -21,13 +22,9 @@
 S = "${WORKDIR}/git/"
 
 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
-CFLAGS += "${TUNE_CCARGS}"
 
 do_install () {
-
-    install -d ${D}${sbindir}
-    oe_runmake DESTDIR="${D}" install
-
+	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
 }
 
 PACKAGES = "ubi-utils-klibc-dbg"