Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
new file mode 100644
index 0000000..037d161
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
@@ -0,0 +1,93 @@
+blktrace: obey LDFLAGS
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+the patch was imported from meta-mentor layer on yoctoproject git server
+http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor as of commit id
+aed463414e2e2bf8ca44ba54ee5973e7ed599e57
+
+Signed-off-by: Fahad Usman <fahad_usman@mentor.com>
+---
+ Makefile          |   11 ++++++-----
+ btreplay/Makefile |    3 ++-
+ btt/Makefile      |    3 ++-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+--- git.orig/Makefile
++++ git/Makefile
+@@ -1,5 +1,6 @@
+ CC	= gcc
+ CFLAGS	= -Wall -O2 -g -W
++LDFLAGS =
+ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PROGS	= blkparse blktrace verify_blkparse blkrawverify blkiomon
+ LIBS	= -lpthread
+@@ -23,19 +24,19 @@ btreplay/btreplay:
+ 	$(CC) -o $*.o -c $(ALL_CFLAGS) $<
+ 
+ blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blktrace: blktrace.o act_mask.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ verify_blkparse: verify_blkparse.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blkrawverify: blkrawverify.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blkiomon: blkiomon.o rbtree.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt $(LDFLAGS)
+ 
+ $(PROGS): | depend
+ 
+--- git.orig/btreplay/Makefile
++++ git/btreplay/Makefile
+@@ -7,6 +7,7 @@
+ 
+ CC	= gcc
+ CFLAGS	= -Wall -W -O2 -g
++LDFLAGS =
+ INCS	= -I. -I.. -I../btt
+ OCFLAGS	= -UCOUNT_IOS -UDEBUG -DNDEBUG
+ XCFLAGS	= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+@@ -32,10 +33,10 @@ clean: docsclean
+	$(CC) $(CFLAGS) -c -o $*.o $<
+
+ btrecord: btrecord.o
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ btreplay: btreplay.o
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ depend:
+ 	@$(CC) -MM $(CFLAGS) *.c 1> .depend
+--- git.orig/btt/Makefile
++++ git/btt/Makefile
+@@ -7,6 +7,7 @@
+ 
+ CC	= gcc
+ CFLAGS	= -Wall -W -O2 -g
++LDFLAGS =
+ INCS	= -I. -I..
+ XCFLAGS	= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ override CFLAGS += $(INCS) $(XCFLAGS)
+@@ -38,7 +39,7 @@ clean: docsclean
+ 	$(CC) $(CFLAGS) -c -o $*.o $<
+ 
+ btt: $(OBJS)
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/meta/recipes-kernel/blktrace/blktrace_git.bb b/meta/recipes-kernel/blktrace/blktrace_git.bb
new file mode 100644
index 0000000..5b0be42
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Generates traces of I/O traffic on block devices"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "libaio"
+
+SRCREV = "43fc870ce04e963def45dfc0d1ed4ea21ef10d4b"
+
+PV = "1.1.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.dk/blktrace.git \
+           file://ldflags.patch"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "\
+    'CC=${CC}' \
+    'CFLAGS=${CFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+"
+
+# There are a few parallel issues:
+# 1) ../rbtree.o: error adding symbols: Invalid operation
+# collect2: error: ld returned 1 exit status
+# Makefile:42: recipe for target 'btt' failed
+# 2) git/blkiomon.c:216: undefined reference to `rb_insert_color'
+# collect2: error: ld returned 1 exit status
+# Makefile:27: recipe for target 'blkparse' failed
+# 3) ld: rbtree.o: invalid string offset 128 >= 125 for section `.strtab'
+# 4) btreplay.o: file not recognized: File truncated
+# collect2: error: ld returned 1 exit status
+# btreplay/btreplay.c:47:18: fatal error: list.h: No such file or directory
+PARALLEL_MAKE = ""
+
+do_install() {
+	oe_runmake ARCH="${ARCH}" prefix=${prefix} \
+		mandir=${mandir} DESTDIR=${D} install
+}
+
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb
new file mode 100644
index 0000000..a33841d
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb
@@ -0,0 +1,13 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A /dev/crypto device driver header file"
+
+do_compile[noexec] = "1"
+
+# Just install cryptodev.h which is the only header file needed to be exported
+do_install() {
+	install -D ${S}/crypto/cryptodev.h ${D}${includedir}/crypto/cryptodev.h
+}
+
+ALLOW_EMPTY_${PN} = "1"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb
new file mode 100644
index 0000000..5cd52eb
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb
@@ -0,0 +1,18 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A /dev/crypto device driver kernel module"
+
+inherit module
+
+# Header file provided by a separate package
+DEPENDS += "cryptodev-linux"
+
+SRC_URI += " \
+file://0001-Disable-installing-header-file-provided-by-another-p.patch \
+file://0001-ioctl.c-Fix-build-on-3.19.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+RCONFLICTS_${PN} = "ocf-linux"
+RREPLACES_${PN} = "ocf-linux"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb
new file mode 100644
index 0000000..efc41ae
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb
@@ -0,0 +1,23 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A test suite for /dev/crypto device driver"
+
+DEPENDS += "openssl"
+
+SRC_URI += " \
+file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
+file://0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+do_compile() {
+	oe_runmake testprogs
+}
+
+do_install() {
+	oe_runmake install_tests
+}
+
+FILES_${PN}-dbg += "${bindir}/tests_cryptodev/.debug"
+FILES_${PN} = "${bindir}/tests_cryptodev/*"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc b/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc
new file mode 100644
index 0000000..cca6925
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc
@@ -0,0 +1,13 @@
+HOMEPAGE = "http://cryptodev-linux.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://download.gna.org/cryptodev-linux/cryptodev-linux-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0b63b3481cf2c90386b35f057481d36b"
+SRC_URI[sha256sum] = "41880533b53de4d7b3f054e230f576988dafb8eed7bef5ebcf6422bb2e3a3b25"
+
+S = "${WORKDIR}/cryptodev-linux-${PV}"
+
+CLEANBROKEN = "1"
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
new file mode 100644
index 0000000..3f0298b
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
@@ -0,0 +1,66 @@
+From 1980a8f4779a955e73285e7a0d86549b69bea5c8 Mon Sep 17 00:00:00 2001
+From: Yu Zongchun <b40527@freescale.com>
+Date: Sun, 28 Apr 2013 14:39:22 +0800
+Subject: [PATCH] Add the compile and install rules for cryptodev tests folder
+
+This is required to install the cryptodev tests folder to rootfs
+
+Signed-off-by: Yu Zongchun <b40527@freescale.com>
+
+Upstream-Status: Pending
+
+---
+ Makefile       |    6 ++++++
+ tests/Makefile |    8 ++++++++
+ 2 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 31c4b3f..2ecf2a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,6 +34,9 @@ modules_install:
+ 	@echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+ 	@install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+ 
++install_tests:
++	make -C tests install DESTDIR=$(PREFIX)
++
+ clean:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+ 	rm -f $(hostprogs) *~
+@@ -42,6 +45,9 @@ clean:
+ check:
+ 	CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) make -C tests check
+ 
++testprogs:
++	KERNEL_DIR=$(KERNEL_DIR) make -C tests testprogs
++
+ CPOPTS =
+ ifneq (${SHOW_TYPES},)
+ CPOPTS += --show-types
+diff --git a/tests/Makefile b/tests/Makefile
+index c9f04e8..cd202af 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -19,6 +19,12 @@ example-async-hmac-objs := async_hmac.o
+ example-async-speed-objs := async_speed.o
+ example-hashcrypt-speed-objs := hashcrypt_speed.c
+ 
++install:
++	install -d  $(DESTDIR)/usr/bin/tests_cryptodev
++	for bin in $(hostprogs); do \
++		install -m 755 $${bin} $(DESTDIR)/usr/bin/tests_cryptodev/; \
++	done
++
+ check: $(hostprogs)
+ 	./cipher
+ 	./hmac
+@@ -28,6 +34,8 @@ check: $(hostprogs)
+ 	./cipher-gcm
+ 	./cipher-aead
+ 
++testprogs: $(hostprogs)
++
+ clean:
+ 	rm -f *.o *~ $(hostprogs)
+ 
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
new file mode 100644
index 0000000..a580fc6
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
@@ -0,0 +1,28 @@
+From 8a884f55bd1527baa82fab68c186ba546273860c Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 19:51:39 -0400
+Subject: [PATCH] Disable installing header file provided by another package
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Inappropriate [ OE specific ]
+---
+ Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d66ef26..8e97c6a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,8 +23,6 @@ install: modules_install
+ 
+ modules_install:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
+-	@echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+-	@install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+ 
+ clean:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch b/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch
new file mode 100644
index 0000000..74c8972
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch
@@ -0,0 +1,29 @@
+From 7d71124991030f99965e6e6aaed421115f185adb Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Date: Mon, 9 Feb 2015 13:51:56 +0100
+Subject: [PATCH] ioctl.c: Fix build on 3.19
+
+get_unused_fd() MACRO has been removed on kernel 3.19. Replace by the
+actual output of the macro.
+
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+---
+ ioctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ioctl.c b/ioctl.c
+index f26cf93..cf8cc17 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -529,7 +529,7 @@ static int
+ clonefd(struct file *filp)
+ {
+ 	int ret;
+-	ret = get_unused_fd();
++	ret = get_unused_fd_flags(0);
+ 	if (ret >= 0) {
+ 			get_file(filp);
+ 			fd_install(ret, filp);
+-- 
+2.1.4
+
diff --git a/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch
new file mode 100644
index 0000000..f5ab8b4
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch
@@ -0,0 +1,29 @@
+From 47ff1eb9bb4f872c1d731b93d334ee5865bf3439 Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 22:16:30 -0400
+Subject: [PATCH] Fix tests Makefile usage of LDLIBS vs. LDFLAGS
+
+Libraries must come after objects, as link order matters, especially
+when using linker flags like -Wl,--as-needed.
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Pending
+---
+ tests/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index cd202af..67c3c83 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -39,5 +39,5 @@ testprogs: $(hostprogs)
+ clean:
+ 	rm -f *.o *~ $(hostprogs)
+ 
+-${comp_progs}: LDFLAGS += -lssl -lcrypto
++${comp_progs}: LDLIBS += -lssl -lcrypto
+ ${comp_progs}: %: %.o openssl_wrapper.o
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
new file mode 100644
index 0000000..0c409b0
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -0,0 +1,22 @@
+SUMMARY = "Device Tree Compiler"
+DESCRIPTION = "The Device Tree Compiler is a tool used to manipulate the Open-Firmware-like device tree used by PowerPC kernels."
+SECTION = "bootloader"
+LICENSE = "GPLv2 | BSD"
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
+           file://make_install.patch \
+	  "
+
+EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
+
+S = "${WORKDIR}/git"
+
+do_install () {
+	oe_runmake install
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
+
+RDEPENDS_${PN}-misc += "bash"
diff --git a/meta/recipes-kernel/dtc/dtc/make_install.patch b/meta/recipes-kernel/dtc/dtc/make_install.patch
new file mode 100644
index 0000000..1120617
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/make_install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile	2011-11-02 14:52:17.243104779 -0700
++++ git/Makefile	2011-11-02 15:06:01.555104982 -0700
+@@ -161,8 +161,8 @@
+ 	$(INSTALL) -d $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
+-	ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++	$(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++	ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/$(notdir $(LIBFDT_lib))
+ 	ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
+ 	$(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
+ 	$(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
diff --git a/meta/recipes-kernel/dtc/dtc_git.bb b/meta/recipes-kernel/dtc/dtc_git.bb
new file mode 100644
index 0000000..4446142
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc_git.bb
@@ -0,0 +1,11 @@
+require dtc.inc
+
+LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+		    file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
+
+SRCREV = "302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2"
+PV = "1.4.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
new file mode 100644
index 0000000..4753094
--- /dev/null
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for managing Yocto Project style branched kernels"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70cd5f52972f8884b80743d"
+
+DEPENDS = "git-native"
+
+SRCREV = "bd144d43ca5b1eaf9e727bced4ce3b61b642297c"
+PR = "r12"
+PV = "0.2+git${SRCPV}"
+
+inherit native
+
+SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git"
+S = "${WORKDIR}"
+
+do_compile() { 
+	:
+}
+
+do_install() {
+	cd ${S}/git
+	make DESTDIR=${D}${bindir} install
+}
diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc
new file mode 100644
index 0000000..7797a25
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Kexec fast reboot tools"
+DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
+AUTHOR = "Eric Biederman"
+HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
+SECTION = "kernel/userland"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
+                    file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
+DEPENDS = "zlib xz"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz"
+
+PR = "r1"
+
+inherit autotools
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
+
+INSANE_SKIP_${PN} = "arch"
+
+do_compile_prepend() {
+    # Remove the '*.d' file to make sure the recompile is OK
+    for dep in `find ${B} -type f -name '*.d'`; do
+        dep_no_d="`echo $dep | sed 's#.d$##'`"
+        # Remove file.d when there is a file.o
+        if [ -f "$dep_no_d.o" ]; then
+            rm -f $dep
+        fi
+    done
+}
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
new file mode 100644
index 0000000..bfd077d
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
@@ -0,0 +1,32 @@
+From a1135b3170963ba956f2364c1283864c35541295 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:59:45 +0000
+Subject: [PATCH] purgatory: Pass -r directly to linker
+
+This helps compiling with clang since -r is not a known option for clang
+where as gcc knows how to deal with it and passes it down to linker
+unfiltered
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ purgatory/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/purgatory/Makefile b/purgatory/Makefile
+index 2b5c061..b251353 100644
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -61,7 +61,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ 			-I$(shell $(CC) -print-file-name=include)
+ $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+ 			-Wl,--no-undefined -nostartfiles -nostdlib \
+-			-nodefaultlibs -e purgatory_start -r \
++			-nodefaultlibs -e purgatory_start -Wl,-r \
+ 			-Wl,-Map=$(PURGATORY_MAP)
+ 
+ $(PURGATORY): $(PURGATORY_OBJS)
+-- 
+2.5.1
+
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
new file mode 100644
index 0000000..dc97d93
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
@@ -0,0 +1,35 @@
+From b19b68eab567aa534cf8dec79fe18e3dc0e14043 Mon Sep 17 00:00:00 2001
+From: Quanyang Wang <quanyang.wang@windriver.com>
+Date: Tue, 16 Jun 2015 12:59:57 +0800
+Subject: [PATCH] powerpc: change the memory size limit
+
+When run "kexec" in powerpc board, the kexec has a limit that
+the kernel text and bss size must be less than 24M. But now
+some kernel size exceed the limit. So we need to change the limit,
+else will get the error log as below:
+
+my_load:669: do
+Could not find a free area of memory of 0x12400 bytes...
+Could not find a free area of memory of 0x13000 bytes...
+locate_hole failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
+---
+ kexec/arch/ppc/kexec-ppc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/kexec-ppc.h
++++ kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+@@ -42,7 +42,7 @@ void dol_ppc_usage(void);
+  * During inital setup the kernel does not map the whole memory but a part of
+  * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible).
+  */
+-#define KERNEL_ACCESS_TOP (24 * 1024 * 1024)
++#define KERNEL_ACCESS_TOP (36 * 1024 * 1024)
+ 
+ /* boot block version 17 as defined by the linux kernel */
+ struct bootblock {
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
new file mode 100644
index 0000000..b03f582
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
@@ -0,0 +1,801 @@
+From: Geoff Levand <geoff@infradead.org>
+Date: Mon, 15 Jul 2013 23:32:36 +0000 (-0700)
+Subject: Add arm64 support
+X-Git-Url: https://git.linaro.org/gitweb?p=people%2Fgeoff%2Fkexec-tools.git;a=commitdiff_plain;h=fbf5ac6c2c70ec0f6da2b9ff563e573999752c01
+
+Add arm64 support
+
+Signed-off-by: Geoff Levand <geoff@infradead.org>
+
+Get patch from:
+https://fedorapeople.org/~hrw/aarch64/for-fedora/kexec-aarch64.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+
+---
+ configure.ac                            |    3 
+ kexec/Makefile                          |    1 
+ kexec/arch/arm64/Makefile               |   13 +
+ kexec/arch/arm64/crashdump-arm64.c      |  305 ++++++++++++++++++++++++++++++++
+ kexec/arch/arm64/include/arch/options.h |   26 ++
+ kexec/arch/arm64/kexec-arm64.c          |  177 ++++++++++++++++++
+ kexec/arch/arm64/kexec-arm64.h          |   20 ++
+ kexec/arch/arm64/kexec-elf-arm64.c      |  114 +++++++++++
+ kexec/kexec-syscall.h                   |    9 
+ kexec/kexec.c                           |    2 
+ purgatory/arch/arm64/Makefile           |    7 
+ 11 files changed, 675 insertions(+), 2 deletions(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -36,6 +36,9 @@ case $target_cpu in
+ 		ARCH="ppc64"
+ 		SUBARCH="LE"
+ 		;;
++	aarch64* )
++		ARCH="arm64"
++		;;
+ 	arm* )
+ 		ARCH="arm"
+ 		;;
+Index: kexec-tools-2.0.10/kexec/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/Makefile
++++ kexec-tools-2.0.10/kexec/Makefile
+@@ -71,6 +71,7 @@ KEXEC_SRCS			+= $($(ARCH)_FS2DT)
+ 
+ include $(srcdir)/kexec/arch/alpha/Makefile
+ include $(srcdir)/kexec/arch/arm/Makefile
++include $(srcdir)/kexec/arch/arm64/Makefile
+ include $(srcdir)/kexec/arch/i386/Makefile
+ include $(srcdir)/kexec/arch/ia64/Makefile
+ include $(srcdir)/kexec/arch/m68k/Makefile
+Index: kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+@@ -0,0 +1,13 @@
++
++arm64_KEXEC_SRCS += \
++	kexec/arch/arm64/kexec-arm64.c \
++	kexec/arch/arm64/kexec-elf-arm64.c \
++	kexec/arch/arm64/crashdump-arm64.c
++
++arm64_ARCH_REUSE_INITRD =
++arm64_ADD_SEGMENT =
++arm64_VIRT_TO_PHYS =
++
++dist += $(arm64_KEXEC_SRCS) \
++	kexec/arch/arm64/Makefile \
++	kexec/arch/arm64/kexec-arm64.h
+Index: kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+@@ -0,0 +1,305 @@
++/*
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation (version 2 of the License).
++ */
++
++#include "../../kexec.h"
++#include "../../kexec-elf.h"
++#include "../../crashdump.h"
++
++int is_crashkernel_mem_reserved(void)
++{
++	return 0;
++}
++
++#if 0
++/*
++ * Used to save various memory ranges/regions needed for the captured
++ * kernel to boot. (lime memmap= option in other archs)
++ */
++static struct memory_range crash_memory_ranges[CRASH_MAX_MEMORY_RANGES];
++struct memory_ranges usablemem_rgns = {
++    .size = 0,
++    .ranges = crash_memory_ranges,
++};
++
++/* memory range reserved for crashkernel */
++static struct memory_range crash_reserved_mem;
++
++static struct crash_elf_info elf_info = {
++	.class		= ELFCLASS32,
++	.data		= ELFDATA2LSB,
++	.machine	= EM_ARM,
++	.page_offset	= PAGE_OFFSET,
++};
++
++unsigned long phys_offset;
++
++/**
++ * crash_range_callback() - callback called for each iomem region
++ * @data: not used
++ * @nr: not used
++ * @str: name of the memory region
++ * @base: start address of the memory region
++ * @length: size of the memory region
++ *
++ * This function is called once for each memory region found in /proc/iomem. It
++ * locates system RAM and crashkernel reserved memory and places these to
++ * variables: @crash_memory_ranges and @crash_reserved_mem. Number of memory
++ * regions is placed in @crash_memory_nr_ranges.
++ */
++static int crash_range_callback(void *UNUSED(data), int UNUSED(nr),
++				char *str, unsigned long base,
++				unsigned long length)
++{
++	struct memory_range *range;
++
++	if (usablemem_rgns.size >= CRASH_MAX_MEMORY_RANGES)
++		return 1;
++
++	range = usablemem_rgns.ranges + usablemem_rgns.size;
++
++	if (strncmp(str, "System RAM\n", 11) == 0) {
++		range->start = base;
++		range->end = base + length - 1;
++		range->type = RANGE_RAM;
++		usablemem_rgns.size++;
++	} else if (strncmp(str, "Crash kernel\n", 13) == 0) {
++		crash_reserved_mem.start = base;
++		crash_reserved_mem.end = base + length - 1;
++		crash_reserved_mem.type = RANGE_RAM;
++	}
++
++	return 0;
++}
++
++/**
++ * crash_exclude_range() - excludes memory region reserved for crashkernel
++ *
++ * Function locates where crashkernel reserved memory is and removes that region
++ * from the available memory regions.
++ */
++static void crash_exclude_range(void)
++{
++	const struct memory_range *range = &crash_reserved_mem;
++	int i;
++
++	for (i = 0; i < usablemem_rgns.size; i++) {
++		struct memory_range *r = usablemem_rgns.ranges + i;
++
++		/*
++		 * We assume that crash area is fully contained in
++		 * some larger memory area.
++		 */
++		if (r->start <= range->start && r->end >= range->end) {
++			struct memory_range *new;
++			/*
++			 * Let's split this area into 2 smaller ones and
++			 * remove excluded range from between. First create
++			 * new entry for the remaining area.
++			 */
++			new = usablemem_rgns.ranges + usablemem_rgns.size;
++			new->start = range->end + 1;
++			new->end = r->end;
++			usablemem_rgns.size++;
++			/*
++			 * Next update this area to end before excluded range.
++			 */
++			r->end = range->start - 1;
++			break;
++		}
++	}
++}
++
++static int range_cmp(const void *a1, const void *a2)
++{
++	const struct memory_range *r1 = a1;
++	const struct memory_range *r2 = a2;
++
++	if (r1->start > r2->start)
++		return 1;
++	if (r1->start < r2->start)
++		return -1;
++
++	return 0;
++}
++
++/**
++ * crash_get_memory_ranges() - read system physical memory
++ *
++ * Function reads through system physical memory and stores found memory regions
++ * in @crash_memory_ranges. Number of memory regions found is placed in
++ * @crash_memory_nr_ranges. Regions are sorted in ascending order.
++ *
++ * Returns %0 in case of success and %-1 otherwise (errno is set).
++ */
++static int crash_get_memory_ranges(void)
++{
++	/*
++	 * First read all memory regions that can be considered as
++	 * system memory including the crash area.
++	 */
++	kexec_iomem_for_each_line(NULL, crash_range_callback, NULL);
++
++	if (usablemem_rgns.size < 1) {
++		errno = EINVAL;
++		return -1;
++	}
++
++	/*
++	 * Exclude memory reserved for crashkernel (this may result a split memory
++	 * region).
++	 */
++	crash_exclude_range();
++
++	/*
++	 * Make sure that the memory regions are sorted.
++	 */
++	qsort(usablemem_rgns.ranges, usablemem_rgns.size,
++	      sizeof(*usablemem_rgns.ranges), range_cmp);
++
++	return 0;
++}
++
++/**
++ * cmdline_add_elfcorehdr() - adds elfcorehdr= to @cmdline
++ * @cmdline: buffer where parameter is placed
++ * @elfcorehdr: physical address of elfcorehdr
++ *
++ * Function appends 'elfcorehdr=start' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (inclunding %NUL).
++ */
++static void cmdline_add_elfcorehdr(char *cmdline, unsigned long elfcorehdr)
++{
++	char buf[COMMAND_LINE_SIZE];
++	int buflen;
++
++	buflen = snprintf(buf, sizeof(buf), "%s elfcorehdr=%#lx",
++			  cmdline, elfcorehdr);
++	if (buflen < 0)
++		die("Failed to construct elfcorehdr= command line parameter\n");
++	if (buflen >= sizeof(buf))
++		die("Command line overflow\n");
++
++	(void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++	cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++/**
++ * cmdline_add_mem() - adds mem= parameter to kernel command line
++ * @cmdline: buffer where parameter is placed
++ * @size: size of the kernel reserved memory (in bytes)
++ *
++ * This function appends 'mem=size' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (including %NUL).
++ */
++static void cmdline_add_mem(char *cmdline, unsigned long size)
++{
++	char buf[COMMAND_LINE_SIZE];
++	int buflen;
++
++	buflen = snprintf(buf, sizeof(buf), "%s mem=%ldK", cmdline, size >> 10);
++	if (buflen < 0)
++		die("Failed to construct mem= command line parameter\n");
++	if (buflen >= sizeof(buf))
++		die("Command line overflow\n");
++
++	(void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++	cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++static unsigned long long range_size(const struct memory_range *r)
++{
++	return r->end - r->start + 1;
++}
++
++static void dump_memory_ranges(void)
++{
++	int i;
++
++	if (!kexec_debug)
++		return;
++
++	dbgprintf("crashkernel: [%#llx - %#llx] (%ldM)\n",
++		  crash_reserved_mem.start, crash_reserved_mem.end,
++		  (unsigned long)range_size(&crash_reserved_mem) >> 20);
++
++	for (i = 0; i < usablemem_rgns.size; i++) {
++		struct memory_range *r = usablemem_rgns.ranges + i;
++		dbgprintf("memory range: [%#llx - %#llx] (%ldM)\n",
++			  r->start, r->end, (unsigned long)range_size(r) >> 20);
++	}
++}
++
++/**
++ * load_crashdump_segments() - loads additional segments needed for kdump
++ * @info: kexec info structure
++ * @mod_cmdline: kernel command line
++ *
++ * This function loads additional segments which are needed for the dump capture
++ * kernel. It also updates kernel command line passed in @mod_cmdline to have
++ * right parameters for the dump capture kernel.
++ *
++ * Return %0 in case of success and %-1 in case of error.
++ */
++int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
++{
++	unsigned long elfcorehdr;
++	unsigned long bufsz;
++	void *buf;
++	int err;
++
++	/*
++	 * First fetch all the memory (RAM) ranges that we are going to pass to
++	 * the crashdump kernel during panic.
++	 */
++	err = crash_get_memory_ranges();
++	if (err)
++		return err;
++
++	/*
++	 * Now that we have memory regions sorted, we can use first memory
++	 * region as PHYS_OFFSET.
++	 */
++	phys_offset = usablemem_rgns.ranges->start;
++	dbgprintf("phys_offset: %#lx\n", phys_offset);
++
++	err = crash_create_elf32_headers(info, &elf_info,
++					 usablemem_rgns.ranges,
++					 usablemem_rgns.size, &buf, &bufsz,
++					 ELF_CORE_HEADER_ALIGN);
++	if (err)
++		return err;
++
++	/*
++	 * We allocate ELF core header from the end of the memory area reserved
++	 * for the crashkernel. We align the header to SECTION_SIZE (which is
++	 * 1MB) so that available memory passed in kernel command line will be
++	 * aligned to 1MB. This is because kernel create_mapping() wants memory
++	 * regions to be aligned to SECTION_SIZE.
++	 */
++	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++					  crash_reserved_mem.start,
++					  crash_reserved_mem.end, -1, 0);
++
++	dbgprintf("elfcorehdr: %#lx\n", elfcorehdr);
++	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
++
++	/*
++	 * Add 'mem=size' parameter to dump capture kernel command line. This
++	 * prevents the dump capture kernel from using any other memory regions
++	 * which belong to the primary kernel.
++	 */
++	cmdline_add_mem(mod_cmdline, elfcorehdr - crash_reserved_mem.start);
++
++	dump_memory_ranges();
++	dbgprintf("kernel command line: \"%s\"\n", mod_cmdline);
++
++	return 0;
++}
++
++#endif
++
+Index: kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+@@ -0,0 +1,26 @@
++#ifndef KEXEC_ARCH_ARM64_OPTIONS_H
++#define KEXEC_ARCH_ARM64_OPTIONS_H
++
++//#define OPT_ARCH_MAX	((OPT_MAX)+0)
++
++#define OPT_APPEND	((OPT_MAX)+0)
++#define OPT_RAMDISK	((OPT_MAX)+1)
++#define OPT_DTB		((OPT_MAX)+2)
++
++#define OPT_ARCH_MAX	((OPT_MAX)+3)
++
++
++#define KEXEC_ARCH_OPTIONS \
++	KEXEC_OPTIONS \
++	{ "append",       1, NULL, OPT_APPEND }, \
++	{ "command-line", 1, NULL, OPT_APPEND }, \
++	{ "dtb",          1, NULL, OPT_DTB }, \
++	{ "initrd",       1, NULL, OPT_RAMDISK }, \
++	{ "ramdisk",      1, NULL, OPT_RAMDISK }, \
++
++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */
++
++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS
++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR
++
++#endif /* KEXEC_ARCH_ARM64_OPTIONS_H */
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+@@ -0,0 +1,177 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <errno.h>
++#include <stddef.h>
++
++//#include <linux/kexec.h>
++
++#include "../../kexec.h"
++#include "../../kexec-syscall.h"
++#include "kexec-arm64.h"
++
++
++void arch_usage(void)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++	printf(
++"     --append=STRING       Set the kernel command line to STRING.\n"
++"     --command-line=STRING Set the kernel command line to STRING.\n"
++"     --dtb=FILE            Use FILE as the device tree blob.\n"
++"     --initrd=FILE         Use FILE as the kernel initial ramdisk.\n"
++"     --ramdisk=FILE        Use FILE as the kernel initial ramdisk.\n");
++
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++int arch_process_options(int UNUSED(argc), char **UNUSED(argv))
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++const struct arch_map_entry arches[] = {
++	{ "aarch64", KEXEC_ARCH_ARM64 },
++	{ NULL, 0 },
++};
++
++void arch_update_purgatory(struct kexec_info *UNUSED(info))
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
++
++unsigned long virt_to_phys(unsigned long addr)
++{
++	fprintf(stderr, "%s:%d: %016lx -> %016lx\n", __func__, __LINE__, addr,
++		addr + 0x080000000UL);
++	return addr + 0x080000000UL;
++}
++
++void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
++	unsigned long base, size_t memsz)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++static int get_memory_ranges_1(struct memory_range **range, int *ranges,
++			unsigned long kexec_flags)
++{
++	static struct memory_range memory_range[KEXEC_SEGMENT_MAX];
++	const char *iomem;
++	int range_count = 0;
++	char line[MAX_LINE];
++	FILE *fp;
++
++	iomem = proc_iomem();
++	fp = fopen(iomem, "r");
++
++	if (!fp) {
++		fprintf(stderr, "Cannot open %s: %s\n",
++			iomem, strerror(errno));
++		return -1;
++	}
++
++	dbgprintf("memory ranges:\n");
++
++	while(fgets(line, sizeof(line), fp) != 0) {
++		struct memory_range r;
++		char *str;
++		int consumed;
++
++		if (range_count >= KEXEC_SEGMENT_MAX)
++			break;
++
++		if (sscanf(line, "%Lx-%Lx : %n", &r.start, &r.end, &consumed)
++			!= 2)
++			continue;
++
++		str = line + consumed;
++		r.end++;
++
++		if (memcmp(str, "System RAM\n", 11)) {
++			dbgprintf(" Skip: %016Lx - %016Lx : %s", r.start, r.end,
++				str);
++			continue;
++		}
++
++		r.type = RANGE_RAM;
++		memory_range[range_count] = r;
++		range_count++;
++
++		dbgprintf(" Add:  %016Lx - %016Lx : %s", r.start, r.end, str);
++	}
++
++	fclose(fp);
++	*range = memory_range;
++	*ranges = range_count;
++
++	return 0;
++}
++
++static int get_memory_ranges_2(struct memory_range **range, int *ranges,
++		      unsigned long UNUSED(kexec_flags))
++{
++	static struct memory_range memory_range[2];
++
++	memory_range[0].start = 0x080000000;
++	memory_range[0].end   = 0x100000000;
++	memory_range[0].type = RANGE_RAM;
++
++	memory_range[1].start = 0x900000000;
++	memory_range[1].end   = 0x880000000;
++	memory_range[1].type = RANGE_RAM;
++
++	*range = memory_range;
++	*ranges = sizeof(memory_range) / sizeof(memory_range[0]);
++
++	return 0;
++}
++
++int get_memory_ranges(struct memory_range **range, int *ranges,
++			unsigned long kexec_flags)
++{
++	/* FIXME: Should get this info from device tree. */
++	
++	return get_memory_ranges_1(range, ranges, kexec_flags);
++}
++
++struct file_type file_type[] = {
++	{ "elf-arm64", elf_arm64_probe, elf_arm64_load, elf_arm64_usage },
++};
++
++int file_types = sizeof(file_type) / sizeof(file_type[0]);
++
++int arch_compat_trampoline(struct kexec_info *info)
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++void arch_reuse_initrd(void)
++{
++}
++
++int machine_verify_elf_rel(struct mem_ehdr *ehdr)
++{
++	(void)ehdr;
++
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
++	void *location, unsigned long address, unsigned long value)
++{
++	(void)ehdr;
++	(void)r_type;
++	(void)location;
++	(void)address;
++	(void)value;
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+@@ -0,0 +1,20 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#if !defined(KEXEC_ARM64_H)
++#define KEXEC_ARM64_H
++
++/* #include <linux/kexec.h> FIXME: this is broken */
++#include <sys/types.h>
++
++#include "../../kexec.h"
++
++#define KEXEC_SEGMENT_MAX 16 /* FIXME: this should come from <linux/kexec.h> */
++
++int elf_arm64_probe(const char *buf, off_t len);
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++	struct kexec_info *info);
++void elf_arm64_usage(void);
++
++#endif
+\ No newline at end of file
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -0,0 +1,114 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <elf.h>
++#include <getopt.h>
++
++#include "../../kexec-syscall.h"
++
++#include "kexec-arm64.h"
++#include "arch/options.h"
++
++#if !defined(EM_AARCH64)
++# define EM_AARCH64 183
++#endif
++
++int elf_arm64_probe(const char *buf, off_t len)
++{
++	int result;
++	struct mem_ehdr ehdr;
++
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	
++	result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++	if (result < 0) {
++		dbgprintf("Not an ELF executable\n");
++		goto out;
++	}
++
++	if (ehdr.e_machine != EM_AARCH64) {
++		dbgprintf("Not an AARCH64 executable\n");
++		result = -1;
++		goto out;
++	}
++
++	result = 0;
++
++out:
++	free_elf_info(&ehdr);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++	return result;
++}
++
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++			struct kexec_info *info)
++{
++	static const struct option options[] = {
++		KEXEC_ARCH_OPTIONS
++		{ 0 }
++	};
++	static const char short_options[] = KEXEC_OPT_STR "";
++	const char *command_line = NULL;
++	unsigned int command_line_len = 0;
++	const char *ramdisk = NULL;
++	const char *dtb = NULL;
++	int opt;
++	struct mem_ehdr ehdr;
++	int result;
++
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++	while ((opt = getopt_long(argc, argv, short_options, options, 0))
++		!= -1) {
++		switch (opt) {
++		default:
++			if (opt < OPT_MAX) /* Ignore core options */
++				break;
++		case OPT_APPEND:
++			command_line = optarg;
++			command_line_len = strlen(command_line) + 1;
++			break;
++		case OPT_RAMDISK:
++			ramdisk = optarg;
++			break;
++		case OPT_DTB:
++			dtb = optarg;
++			break;
++		}
++	}
++
++	fprintf(stderr, "%s:%d: command_line: %s\n", __func__, __LINE__, command_line);
++	fprintf(stderr, "%s:%d: ramdisk: %s\n", __func__, __LINE__, ramdisk);
++	fprintf(stderr, "%s:%d: dtb: %s\n", __func__, __LINE__, dtb);
++
++	if (info->kexec_flags & KEXEC_ON_CRASH) {
++		fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
++		return -1;
++	}
++
++	result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++	if (result < 0) {
++		free_elf_info(&ehdr);
++		fprintf(stderr, "%s:%d: free_elf_info failed\n", __func__,
++			__LINE__);
++		return result;
++	}
++
++	elf_exec_build_load(info, &ehdr, buf, len, 0);
++
++	info->entry = (void*)0x80080000UL;  // FIXME
++
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++	return 0;
++}
++
++void elf_arm64_usage(void)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
+Index: kexec-tools-2.0.10/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h
++++ kexec-tools-2.0.10/kexec/kexec-syscall.h
+@@ -39,8 +39,8 @@
+ #ifdef __s390__
+ #define __NR_kexec_load		277
+ #endif
+-#ifdef __arm__
+-#define __NR_kexec_load		__NR_SYSCALL_BASE + 347  
++#if defined(__arm__) || defined(__arm64__)
++#define __NR_kexec_load		__NR_SYSCALL_BASE + 347
+ #endif
+ #if defined(__mips__)
+ #define __NR_kexec_load                4311
+@@ -108,6 +108,8 @@ static inline long kexec_file_load(int k
+ #define KEXEC_ARCH_PPC64   (21 << 16)
+ #define KEXEC_ARCH_IA_64   (50 << 16)
+ #define KEXEC_ARCH_ARM     (40 << 16)
++#define KEXEC_ARCH_ARM64   (183 << 16)
++/* #define KEXEC_ARCH_AARCH64 (183 << 16) */
+ #define KEXEC_ARCH_S390    (22 << 16)
+ #define KEXEC_ARCH_SH      (42 << 16)
+ #define KEXEC_ARCH_MIPS_LE (10 << 16)
+@@ -153,5 +155,8 @@ static inline long kexec_file_load(int k
+ #ifdef __m68k__
+ #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_68K
+ #endif
++#if defined(__arm64__)
++#define KEXEC_ARCH_NATIVE	KEXEC_ARCH_ARM64
++#endif
+ 
+ #endif /* KEXEC_SYSCALL_H */
+Index: kexec-tools-2.0.10/kexec/kexec.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec.c
++++ kexec-tools-2.0.10/kexec/kexec.c
+@@ -664,6 +664,8 @@ static int my_load(const char *type, int
+ 	memset(&info, 0, sizeof(info));
+ 	info.kexec_flags = kexec_flags;
+ 
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++
+ 	result = 0;
+ 	if (argc - fileind <= 0) {
+ 		fprintf(stderr, "No kernel specified\n");
+Index: kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+@@ -0,0 +1,7 @@
++#
++# Purgatory arm64
++#
++
++arm64_PURGATORY_SRCS =
++
++dist += purgatory/arch/arm64/Makefile $(arm64_PURGATORY_SRCS)
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
new file mode 100644
index 0000000..e198eb6
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
@@ -0,0 +1,48 @@
+kexec-tools: Refine kdump device_tree sort
+
+The commit b02d735bf was to rearrange the device-tree entries, and
+assumed that these entries are sorted in the ascending order. but
+acctually when I was validating kexec and kdump, the order of
+serial node still is changed. So the patch is to sort these entries
+by the directory name in ascending order.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ kexec/arch/ppc/fs2dt.c |   13 ++++++++++---
+ kexec/fs2dt.c          |   13 ++++++++++---
+ 2 files changed, 20 insertions(+), 6 deletions(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/fs2dt.c
++++ kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+@@ -296,6 +296,9 @@ static int comparefunc(const void *dentr
+ {
+ 	char *str1 = (*(struct dirent **)dentry1)->d_name;
+ 	char *str2 = (*(struct dirent **)dentry2)->d_name;
++	char* ptr1 = strchr(str1, '@');
++	char* ptr2 = strchr(str2, '@');
++	int len1, len2;
+ 
+ 	/*
+ 	 * strcmp scans from left to right and fails to idetify for some
+@@ -303,9 +306,13 @@ static int comparefunc(const void *dentr
+ 	 * Therefore, we get the wrong sorted order like memory@10000000 and
+ 	 * memory@f000000.
+ 	 */
+-	if (strchr(str1, '@') && strchr(str2, '@') &&
+-		(strlen(str1) > strlen(str2)))
+-		return 1;
++	if (ptr1 && ptr2) {
++		len1 = ptr1 - str1;
++		len2 = ptr2 - str2;
++		if (!strncmp(str1, str2, len1 >len2 ? len1: len2) &&
++					(strlen(str1) > strlen(str2)))
++				return 1;
++	}
+ 
+ 	return strcmp(str1, str2);
+ }
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
new file mode 100644
index 0000000..26d18eb
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
@@ -0,0 +1,88 @@
+x86_64: Add support to build kexec-tools with x32 ABI
+
+Summary of changes,
+
+configure.ac: Add test for detect x32 ABI.
+purgatory/arch/x86_64/Makefile: Not use mcmodel large when
+	x32 ABI is set.
+kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set
+	use ELFCLASS32 instead of ELFCLASS64.
+kexec/kexec-syscall.h: Add correct syscall number for x32 ABI.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
+
+---
+ configure.ac                             | 9 +++++++++
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++
+ kexec/kexec-syscall.h                    | 4 ++++
+ purgatory/arch/x86_64/Makefile           | 4 +++-
+ 4 files changed, 20 insertions(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -56,6 +56,15 @@ case $target_cpu in
+ 		;;
+ 	ia64|x86_64|alpha|m68k )
+ 		ARCH="$target_cpu"
++
++		dnl ---Test for x32 ABI in x86_64
++		if test "x$ARCH" = "xx86_64" ; then
++			AC_EGREP_CPP(x32_test,
++			[#if defined(__x86_64__) && defined (__ILP32__)
++				x32_test
++			#endif
++			], SUBARCH='x32', SUBARCH='64')
++		fi
+ 		;;
+ 	* )
+ 		AC_MSG_ERROR([unsupported architecture $target_cpu])
+Index: kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_eh
+ 	if (ehdr->ei_data != ELFDATA2LSB) {
+ 		return 0;
+ 	}
++#ifdef __ILP32__
++	if (ehdr->ei_class != ELFCLASS32) {
++#else
+ 	if (ehdr->ei_class != ELFCLASS64) {
++#endif
+ 		return 0;
+ 	}
+ 	if (ehdr->e_machine != EM_X86_64) {
+Index: kexec-tools-2.0.10/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h
++++ kexec-tools-2.0.10/kexec/kexec-syscall.h
+@@ -31,8 +31,12 @@
+ #define __NR_kexec_load		268
+ #endif
+ #ifdef __x86_64__
++#ifdef __ILP32__
++#define __NR_kexec_load		528
++#else
+ #define __NR_kexec_load		246
+ #endif
++#endif
+ #ifdef __s390x__
+ #define __NR_kexec_load		277
+ #endif
+Index: kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/purgatory/arch/x86_64/Makefile
++++ kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
+ 
+-x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++ifeq ($(SUBARCH),64)
++        x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++endif
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb
new file mode 100644
index 0000000..ffdb983
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb
@@ -0,0 +1,22 @@
+require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \
+            file://kexec-aarch64.patch \
+            file://kexec-x32.patch \
+            file://0002-powerpc-change-the-memory-size-limit.patch \
+            file://0001-purgatory-Pass-r-directly-to-linker.patch \
+         "
+
+SRC_URI[md5sum] = "6cb4d22bcec71b6e070aa8e9d990a5e6"
+SRC_URI[sha256sum] = "c31bb83deef9547a28e8cfc1f0916e70f8e6b92a6bd2ef7077e12e3338239af3"
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump"
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
new file mode 100644
index 0000000..8acb3a8
--- /dev/null
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+# The kernel and the staging dir for it is machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# We need the following for the sstate code to process the wrapper
+SSTATE_SCAN_FILES += "depmodwrapper"
+
+do_install() {
+	install -d ${D}${bindir_crossscripts}/
+
+	cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
+#!/bin/sh
+# Expected to be called as: depmodwrapper -a KERNEL_VERSION
+if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
+    echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
+    exit 1
+fi
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then
+    echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2
+else
+    kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion)
+    if [ "\$kernelabi" != "\$4" ]; then
+        echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
+        exit 1
+    fi
+fi
+
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ]; then
+    echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
+    exec env depmod "\$1" "\$2" "\$3" "\$4"
+else
+    exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+fi
+EOF
+	chmod +x ${D}${bindir_crossscripts}/depmodwrapper
+}
+
+SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
+
+depmodwrapper_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
new file mode 100644
index 0000000..f0e274e
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -0,0 +1,18 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib-native"
+
+inherit native
+
+SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
+           "
+
+do_install_append (){
+	for tool in depmod insmod lsmod modinfo modprobe rmmod
+	do
+		ln -s kmod ${D}${bindir}/$tool
+	done
+}
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc
new file mode 100644
index 0000000..e9aa67d
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod.inc
@@ -0,0 +1,43 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Tools for managing Linux kernel modules"
+DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
+               insert, remove, list, check properties, resolve dependencies and aliases."
+HOMEPAGE = "http://packages.profusion.mobi/kmod/"
+LICENSE = "GPL-2.0+ & LGPL-2.1+"
+LICENSE_libkmod = "LGPL-2.1+"
+SECTION = "base"
+
+DEPENDS += "pkgconfig-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                   "
+inherit autotools gtk-doc
+
+SRCREV = "0d833715eaa65636dda2705b89359a1e0154dc58"
+# Lookout for PV bump too when SRCREV is changed
+PV = "21+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
+           file://depmod-search.conf \
+           file://avoid_parallel_tests.patch \
+           file://fix-O_CLOEXEC.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+EXTRA_AUTORECONF += "--install --symlink"
+EXTRA_OECONF +=" --enable-tools --disable-manpages --with-zlib"
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
+
+do_configure_prepend () {
+        gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make
+}
+
+do_configure_append () {
+	sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool
+}
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 0000000..b722183
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,39 @@
+Subject: Change to calling bswap_* instead of htobe* and be*toh
+
+We can't use htobe* and be*toh functions because they are not
+available on older versions of glibc, For example, shipped on Centos 5.5.
+
+Change to directly calling bswap_* as defined in+byteswap.h.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ libkmod/libkmod-signature.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
+index 6fc06fc..912185a 100644
+--- a/libkmod/libkmod-signature.c
++++ b/libkmod/libkmod-signature.c
+@@ -18,6 +18,7 @@
+  */
+ 
+ #include <endian.h>
++#include <byteswap.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -127,7 +128,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
+ 			modsig->hash >= PKEY_HASH__LAST ||
+ 			modsig->id_type >= PKEY_ID_TYPE__LAST)
+ 		return false;
+-	sig_len = be32toh(get_unaligned(&modsig->sig_len));
++	sig_len = bswap_32(get_unaligned(&modsig->sig_len));
+ 	if (sig_len == 0 ||
+ 	    size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
+ 		return false;
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
new file mode 100644
index 0000000..feafcb9
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -0,0 +1,29 @@
+Avoid parallel-tests as it remove
+buildtest-TESTS and runtest-TESTS targets required by ptest.
+In automake 1.13.4 parallel-tests is assumed by defauls.
+In order to have buildtest-TESTS and runtest-TESTS targets
+serial-tests is now required
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate (disable feature incompatible with ptest) 
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index eb0f9d1..a539968 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ AC_PREFIX_DEFAULT([/usr])
+ AM_MAINTAINER_MODE([enable])
+-AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
++AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests])
+ AM_SILENT_RULES([yes])
+ LT_INIT([disable-static pic-only])
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
new file mode 100644
index 0000000..527c0bb
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
@@ -0,0 +1,6 @@
+#
+# /etc/depmod.d/depmod.conf
+#
+
+search updates extramodules built-in
+
diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
new file mode 100644
index 0000000..8161d61
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
@@ -0,0 +1,38 @@
+From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 22 Jan 2014 01:06:40 -0500
+Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is
+ defined or not
+
+O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
+it, we need check before use.
+
+This patch is much more like a workaround, since it may need fcntl() use
+FD_CLOEXEC to replace.
+
+This problem was reported by "Ting Liu <b28495@freescale.com>"
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ libkmod/libkmod-internal.h |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
+index 0180124..100b40f 100644
+--- a/libkmod/libkmod-internal.h
++++ b/libkmod/libkmod-internal.h
+@@ -9,6 +9,10 @@
+ #include "macro.h"
+ #include "libkmod.h"
+ 
++#ifndef O_CLOEXEC
++#define O_CLOEXEC 0
++#endif
++
+ static _always_inline_ _printf_format_(2, 3) void
+ 	kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644
index 0000000..831dbcb
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/ptest.patch
@@ -0,0 +1,25 @@
+Add 'install-ptest' rule.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-07-12 17:11:05.278331557 +0200
++++ b/Makefile.am	2013-07-12 17:14:27.033788016 +0200
+@@ -204,6 +204,16 @@
+ 
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ 
++install-ptest:
++	@$(MKDIR_P) $(DESTDIR)/testsuite
++	@for file in $(TESTSUITE); do \
++		install $$file $(DESTDIR)/testsuite; \
++	done;
++	@sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
++	@$(MKDIR_P) $(DESTDIR)/tools
++	@cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools
++	@cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite
++
+ # ------------------------------------------------------------------------------
+ # custom release helpers
+ # ------------------------------------------------------------------------------
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755
index 0000000..598dd2c
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+touch testsuite/stamp-rootfs
+tar xf testmodule.tar
+make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
+find testsuite -name *.ko -exec rm -f {} \;
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb
new file mode 100644
index 0000000..ba4d85e
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod_git.bb
@@ -0,0 +1,63 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib"
+PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# to force user to remove old module-init-tools and replace them with kmod variants
+RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# autotools set prefix to /usr, however we want them in /bin and /sbin
+bindir = "${base_bindir}"
+sbindir = "${base_sbindir}"
+# libdir = "${base_libdir}"
+
+do_install_append () {
+        install -dm755 ${D}${base_bindir}
+        install -dm755 ${D}${base_sbindir}
+        # add symlinks to kmod
+        ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod
+        for tool in insmod rmmod depmod modinfo modprobe; do
+                ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}
+        done
+        # configuration directories
+        install -dm755 ${D}${base_libdir}/depmod.d
+        install -dm755 ${D}${base_libdir}/modprobe.d
+        install -dm755 ${D}${sysconfdir}/depmod.d
+        install -dm755 ${D}${sysconfdir}/modprobe.d
+
+        # install depmod.d file for search/ dir
+        install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
+}
+
+do_compile_prepend() {
+            sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
+
+ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
+ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
+ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
+ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
+ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
+
+ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
+ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
+
+ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
+
+PACKAGES =+ "libkmod ${PN}-bash-completion"
+
+FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
+FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"
+FILES_${PN}-bash-completion = "${datadir}/bash-completion"
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
new file mode 100644
index 0000000..b248133
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
@@ -0,0 +1,64 @@
+From db112739dc4f608a968b8104b382955dc3d96ca3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:40:10 +0000
+Subject: [PATCH] Rectify the function signatures to fix prototype mismatches
+
+clang is less forgiving when it comes to coding standards, correct the
+function signatures to reflect the function logic
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ fsync.c      | 7 ++++---
+ latencytop.h | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/fsync.c b/fsync.c
+index 82dff0e..5cefba9 100644
+--- a/fsync.c
++++ b/fsync.c
+@@ -51,7 +51,7 @@ struct fsync_files {
+ static GList *fsync_data;
+ 
+ 
+-static chain_file(struct fsync_process *proc, char *filename)
++static void chain_file(struct fsync_process *proc, char *filename)
+ {
+ 	struct fsync_files *file;
+ 	GList *item;
+@@ -75,7 +75,7 @@ static chain_file(struct fsync_process *proc, char *filename)
+ 	proc->files = g_list_append(proc->files, file);
+ }
+ 
+-static report_file(char *process, char *file)
++static void report_file(char *process, char *file)
+ {
+ 	struct fsync_process *proc;
+ 	GList *item;
+@@ -157,9 +157,10 @@ int enable_fsync_tracer(void)
+ 	write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");	
+ 	write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");	
+ 	write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
++	return ret;
+ }
+ 
+-int disable_fsync_tracer(void)
++void disable_fsync_tracer(void)
+ {
+ 	write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+diff --git a/latencytop.h b/latencytop.h
+index 5394d73..9d107a8 100644
+--- a/latencytop.h
++++ b/latencytop.h
+@@ -54,5 +54,5 @@ extern char *translate(char *line);
+ extern void init_translations(char *filename);
+ extern int fsync_display(int duration);
+ extern int enable_fsync_tracer(void);
+-extern int disable_fsync_tracer(void);
++extern void disable_fsync_tracer(void);
+ extern void update_list(void);
+-- 
+2.5.1
+
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
new file mode 100644
index 0000000..7848ccf
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
@@ -0,0 +1,49 @@
+linux: sysfs: use tracing_on as tracing_enabled is deprecated
+
+tracing_enabled use in the kernel is being deprecated as per commit
+6752ab4a9c30 [tracing: Deprecate tracing_enabled for tracing_on] in
+the linux mainline kernel. tracing_enabled use will generate a warning
+and may no longer function as expected, therefore move to use tracing_on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dennis Hall <dennis.hall@windriver.com>
+
+Index: latencytop-0.5/fsync.c
+===================================================================
+--- latencytop-0.5.orig/fsync.c	2012-08-03 10:45:49.000000000 -0400
++++ latencytop-0.5/fsync.c	2012-08-03 10:48:39.000000000 -0400
+@@ -149,19 +149,19 @@
+  * cd /sys/kernel/debug/tracing
+  * echo fsync > current_tracer
+  * echo ftrace_printk > iter_ctrl 
+- * echo 1 > tracing_enabled
++ * echo 1 > tracing_on
+  */
+ 	ret = system("/bin/mount -t debugfs none /sys/kernel/debug/");
+ 	if (!ret) 
+ 		return -1;
+ 	write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");	
+ 	write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");	
+-	write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++	write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ }
+ 
+ int disable_fsync_tracer(void)
+ {
+-	write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
++	write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+ 
+ 
+@@ -339,8 +339,8 @@
+ 		if (curduration > 5)
+ 			curduration = 5;
+ 		/* clear the ftrace buffer */
+-		write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
+-		write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++		write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
++		write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ 		key = select(1, &rfds, NULL, NULL, &end);
+ 		parse_ftrace();
+ 		print_global_list();
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
new file mode 100644
index 0000000..0cf217f
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
@@ -0,0 +1,39 @@
+diff --git a/Makefile.orig b/Makefile
+index 16a2369..fa797a2 100644
+--- a/Makefile.orig
++++ b/Makefile
+@@ -1,10 +1,11 @@
+-# FIXME: Use autoconf ?
+-HAS_GTK_GUI = 1
++# Upstream-Status: Inappropriate [configuration]
++# Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
+ 
+ DESTDIR =
+ SBINDIR = /usr/sbin
+ XCFLAGS = -W  -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare
+-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0`   -lncursesw 
++LDF = -Wl,--as-needed `pkg-config --libs glib-2.0`   -lncurses
++CC ?= gcc
+ 
+ OBJS= latencytop.o text_display.o translate.o fsync.o
+ 
+@@ -26,16 +27,17 @@ endif
+ 
+ # We write explicity this "implicit rule"
+ %.o : %.c
+-	gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@
++	$(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@
+ 
+ latencytop:  $(OBJS) latencytop.h Makefile
+-	gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop 
++	$(CC) $(CFLAGS) $(OBJS) $(LDF) -o latencytop
+ 
+ clean:
+ 	rm -f *~ latencytop DEADJOE *.o
+ 
+ install: latencytop
+ 	mkdir -p $(DESTDIR)/usr/share/latencytop
++	mkdir -p $(DESTDIR)/$(SBINDIR)
+ 	install -m 0644 latencytop.trans $(DESTDIR)/usr/share/latencytop/latencytop.trans
+ 	install -m 0644 *.png $(DESTDIR)/usr/share/latencytop/
+ 	install -m 0755 latencytop $(DESTDIR)$(SBINDIR)/
diff --git a/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
new file mode 100644
index 0000000..f31f1bb
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Linux tool for measuring and fixing latency"
+HOMEPAGE = "http://www.latencytop.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
+
+DEPENDS = "virtual/libintl ncurses glib-2.0"
+
+PR = "r3"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.gz/73bb3371c6ee0b0e68e25289027e865c/${BP}.tar.gz \
+            file://latencytop-makefile.patch \
+            file://latencytop-fsync.patch \
+            file://0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch \
+"
+
+SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
+SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
+PACKAGECONFIG[x11] = ",,gtk+"
+
+EXTRA_OEMAKE_X = "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'HAS_GTK_GUI=1', '', d)}"
+
+#CFLAGS += "${LDFLAGS}"
+
+do_install() {
+    oe_runmake install DESTDIR=${D} ${EXTRA_OEMAKE_X}
+}
diff --git a/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch b/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
new file mode 100644
index 0000000..d59a7f7
--- /dev/null
+++ b/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
@@ -0,0 +1,31 @@
+From 272a8a069a8f5f06a1e5dfa0ef12f5f92984728b Mon Sep 17 00:00:00 2001
+From: Noor <noor_ahsan@mentor.com>
+Date: Wed, 12 Aug 2015 20:54:00 +0500
+Subject: [PATCH] Makefile: Add LDFLAGS variable to SLDFLAGS.
+
+* Add LDFLAGS variable to SLDFLAGS so that extra linker
+  flags can be sent via this variable.
+
+Upstream-Status: Submitted [perfmon2-libpfm4-commits@lists.sourceforge.net]
+
+Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
+---
+ lib/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 1cc8765..4bd92ef 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -187,7 +187,7 @@ CFLAGS += -DCONFIG_PFMLIB_CELL
+ endif
+ 
+ ifeq ($(SYS),Linux)
+-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBPFM)
++SLDFLAGS=$(LDFLAGS) -shared -Wl,-soname -Wl,$(VLIBPFM)
+ SLIBPFM=libpfm.so.$(VERSION).$(REVISION).$(AGE)
+ VLIBPFM=libpfm.so.$(VERSION)
+ SOLIBEXT=so
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb b/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
new file mode 100644
index 0000000..2dfda90
--- /dev/null
+++ b/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Monitoring tools exploiting the performance monitoring events"
+DESCRIPTION = "This package provides a library, called libpfm4 which is used to develop \
+monitoring tools exploiting the performance monitoring events such as those \
+provided by the Performance Monitoring Unit (PMU) of modern processors."
+HOMEPAGE = "http://perfmon2.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=144822&atid=759953&source=navbar"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0de488f3bd4424e308e2e399cb99c788"
+
+SECTION = "devel"
+
+COMPATIBLE_HOST = "powerpc64"
+
+SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/${BPN}/libpfm-${PV}.tar.gz \
+           file://0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch \
+          "
+
+SRC_URI[md5sum] = "5077b9022440e4951d96f2d0e73bd487"
+SRC_URI[sha256sum] = "5ab1e5b0472550f9037a8800834f6bc3b927690070f69fac0b67284b4b05fd5f"
+
+EXTRA_OEMAKE = "DESTDIR=\"${D}\" PREFIX=\"${prefix}\" LIBDIR=\"${libdir}\" LDCONFIG=\"true\""
+EXTRA_OEMAKE_append_powerpc = " ARCH=\"powerpc\""
+EXTRA_OEMAKE_append_powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\""
+
+S = "${WORKDIR}/libpfm-${PV}"
+
+do_install () {
+	oe_runmake install
+}
diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
new file mode 100644
index 0000000..ef8117c
--- /dev/null
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -0,0 +1,433 @@
+SUMMARY = "Firmware files for use with Linux kernel"
+SECTION = "kernel"
+
+LICENSE = "\
+    Firmware-Abilis \
+    & Firmware-agere \
+    & Firmware-amd-ucode \
+    & Firmware-atheros_firmware \
+    & Firmware-broadcom_bcm43xx \
+    & Firmware-ca0132 \
+    & Firmware-chelsio_firmware \
+    & Firmware-cw1200 \
+    & Firmware-dib0700 \
+    & Firmware-ene_firmware \
+    & Firmware-fw_sst_0f28 \
+    & Firmware-go7007 \
+    & Firmware-i2400m \
+    & Firmware-ibt_firmware \
+    & Firmware-it913x \
+    & Firmware-iwlwifi_firmware \
+    & Firmware-IntcSST2 \
+    & Firmware-Marvell \
+    & Firmware-mwl8335 \
+    & Firmware-myri10ge_firmware \
+    & Firmware-OLPC \
+    & Firmware-phanfw \
+    & Firmware-qat_dh895xcc_firmware \
+    & Firmware-qla2xxx \
+    & Firmware-r8a779x_usb3 \
+    & Firmware-radeon \
+    & Firmware-ralink_a_mediatek_company_firmware \
+    & Firmware-ralink-firmware \
+    & Firmware-rtlwifi_firmware \
+    & Firmware-tda7706-firmware \
+    & Firmware-ti-connectivity \
+    & Firmware-ueagle-atm4-firmware \
+    & Firmware-via_vt6656 \
+    & Firmware-wl1251 \
+    & Firmware-xc4000 \
+    & Firmware-xc5000 \
+    & Firmware-xc5000c \
+    & Firmware-siano \
+"
+
+LIC_FILES_CHKSUM = "\
+    file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
+    file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
+    file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
+    file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
+    file://LICENCE.ca0132;md5=209b33e66ee5be0461f13d31da392198 \
+    file://LICENCE.chelsio_firmware;md5=819aa8c3fa453f1b258ed8d168a9d903 \
+    file://LICENCE.cw1200;md5=f0f770864e7a8444a5c5aa9d12a3a7ed \
+    file://LICENCE.ene_firmware;md5=ed67f0f62f8f798130c296720b7d3921 \
+    file://LICENCE.fw_sst_0f28;md5=6353931c988ad52818ae733ac61cd293 \
+    file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \
+    file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
+    file://LICENCE.ibt_firmware;md5=fdbee1ddfe0fb7ab0b2fcd6b454a366b \
+    file://LICENCE.it913x;md5=1fbf727bfb6a949810c4dbfa7e6ce4f8 \
+    file://LICENCE.iwlwifi_firmware;md5=3fd842911ea93c29cd32679aa23e1c88 \
+    file://LICENCE.IntcSST2;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+    file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
+    file://LICENCE.mwl8335;md5=9a6271ee0e644404b2ff3c61fd070983 \
+    file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+    file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \
+    file://LICENCE.phanfw;md5=954dcec0e051f9409812b561ea743bfa \
+    file://LICENCE.qat_dh895xcc_firmware;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+    file://LICENCE.qla2xxx;md5=f5ce8529ec5c17cb7f911d2721d90e91 \
+    file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \
+    file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \
+    file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
+    file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
+    file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \
+    file://LICENCE.ti-connectivity;md5=186e7a43cf6c274283ad81272ca218ea \
+    file://LICENCE.ueagle-atm4-firmware;md5=4ed7ea6b507ccc583b9d594417714118 \
+    file://LICENCE.via_vt6656;md5=e4159694cba42d4377a912e78a6e850f \
+    file://LICENCE.wl1251;md5=ad3f81922bb9e197014bb187289d3b5b \
+    file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
+    file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
+    file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
+    file://LICENSE.amd-ucode;md5=3a0de451253cc1edbf30a3c621effee3 \
+    file://LICENSE.dib0700;md5=f7411825c8a555a1a3e5eab9ca773431 \
+    file://LICENSE.radeon;md5=6c7f97c6c62bdd9596d0238bb205118c \
+    file://LICENCE.siano;md5=602c79ae3f98f1e73d880fd9f940a418 \
+"
+
+# These are not common licenses, set NO_GENERIC_LICENSE for them
+# so that the license files will be copied from fetched source
+NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENCE.Abilis"
+NO_GENERIC_LICENSE[Firmware-agere] = "LICENCE.agere"
+NO_GENERIC_LICENSE[Firmware-atheros_firmware] = "LICENCE.atheros_firmware"
+NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx] = "LICENCE.broadcom_bcm43xx"
+NO_GENERIC_LICENSE[Firmware-ca0132] = "LICENCE.ca0132"
+NO_GENERIC_LICENSE[Firmware-chelsio_firmware] = "LICENCE.chelsio_firmware"
+NO_GENERIC_LICENSE[Firmware-cw1200] = "LICENCE.cw1200"
+NO_GENERIC_LICENSE[Firmware-ene_firmware] = "LICENCE.ene_firmware"
+NO_GENERIC_LICENSE[Firmware-fw_sst_0f28] = "LICENCE.fw_sst_0f28"
+NO_GENERIC_LICENSE[Firmware-go7007] = "LICENCE.go7007"
+NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m"
+NO_GENERIC_LICENSE[Firmware-ibt_firmware] = "LICENCE.ibt_firmware"
+NO_GENERIC_LICENSE[Firmware-it913x] = "LICENCE.it913x"
+NO_GENERIC_LICENSE[Firmware-iwlwifi_firmware] = "LICENCE.iwlwifi_firmware"
+NO_GENERIC_LICENSE[Firmware-IntcSST2] = "LICENCE.IntcSST2"
+NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell"
+NO_GENERIC_LICENSE[Firmware-mwl8335] = "LICENCE.mwl8335"
+NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC"
+NO_GENERIC_LICENSE[Firmware-phanfw] = "LICENCE.phanfw"
+NO_GENERIC_LICENSE[Firmware-qat_dh895xcc_firmware] = "LICENCE.qat_dh895xcc_firmware"
+NO_GENERIC_LICENSE[Firmware-qla2xxx] = "LICENCE.qla2xxx"
+NO_GENERIC_LICENSE[Firmware-r8a779x_usb3] = "LICENCE.r8a779x_usb3"
+NO_GENERIC_LICENSE[Firmware-ralink_a_mediatek_company_firmware] = "LICENCE.ralink_a_mediatek_company_firmware"
+NO_GENERIC_LICENSE[Firmware-ralink-firmware] = "LICENCE.ralink-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-rtlwifi_firmware] = "LICENCE.rtlwifi_firmware.txt"
+NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity"
+NO_GENERIC_LICENSE[Firmware-ueagle-atm4-firmware] = "LICENCE.ueagle-atm4-firmware"
+NO_GENERIC_LICENSE[Firmware-via_vt6656] = "LICENCE.via_vt6656"
+NO_GENERIC_LICENSE[Firmware-wl1251] = "LICENCE.wl1251"
+NO_GENERIC_LICENSE[Firmware-xc4000] = "LICENCE.xc4000"
+NO_GENERIC_LICENSE[Firmware-xc5000] = "LICENCE.xc5000"
+NO_GENERIC_LICENSE[Firmware-xc5000c] = "LICENCE.xc5000c"
+NO_GENERIC_LICENSE[Firmware-amd-ucode] = "LICENSE.amd-ucode"
+NO_GENERIC_LICENSE[Firmware-dib0700] = "LICENSE.dib0700"
+NO_GENERIC_LICENSE[Firmware-radeon] = "LICENSE.radeon"
+NO_GENERIC_LICENSE[Firmware-siano] = "LICENCE.siano"
+
+SRCREV = "75cc3ef8ba6712fd72c073b17a790282136cc743"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
+
+S = "${WORKDIR}/git"
+
+inherit allarch update-alternatives
+
+CLEANBROKEN = "1"
+
+do_compile() {
+	:
+}
+
+do_install() {
+	install -d  ${D}/lib/firmware/
+	cp -r * ${D}/lib/firmware/
+
+	# Avoid Makefile to be deployed
+	rm ${D}/lib/firmware/Makefile
+
+	# Remove unbuild firmware which needs cmake and bash
+	rm ${D}/lib/firmware/carl9170fw -rf
+
+	# Remove pointless bash script
+	rm ${D}/lib/firmware/configure
+
+	# Libertas sd8686
+	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+
+	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
+	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+}
+
+
+PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
+             ${PN}-radeon-license ${PN}-radeon \
+             ${PN}-marvell-license ${PN}-sd8686 ${PN}-sd8787 ${PN}-sd8797 \
+             ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \
+             ${PN}-vt6656-license ${PN}-vt6656 \
+             ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su \
+             ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 \
+             ${PN}-atheros-license ${PN}-ar9170 ${PN}-ar3k ${PN}-ath6k ${PN}-ath9k \
+             \
+             ${PN}-iwlwifi-license ${PN}-iwlwifi-135-6 \
+             ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \
+             ${PN}-iwlwifi-6000-4 ${PN}-iwlwifi-6000g2a-5 ${PN}-iwlwifi-6000g2a-6 \
+             ${PN}-iwlwifi-6000g2b-5 ${PN}-iwlwifi-6000g2b-6 \
+             ${PN}-iwlwifi-6050-4 ${PN}-iwlwifi-6050-5 \
+             ${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9 \
+             ${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9 \
+             \
+             ${PN}-license \
+             "
+
+# For atheros
+LICENSE_${PN}-ar9170 = "Firmware-atheros_firmware"
+LICENSE_${PN}-ar3k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
+
+FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-ar9170 = " \
+  /lib/firmware/ar9170*.fw \
+"
+FILES_${PN}-ar3k = " \
+  /lib/firmware/ar3k \
+"
+FILES_${PN}-ath6k = " \
+  /lib/firmware/ath6k \
+"
+FILES_${PN}-ath9k = " \
+  /lib/firmware/ar9271.fw \
+  /lib/firmware/ar7010*.fw \
+  /lib/firmware/htc_9271.fw \
+  /lib/firmware/htc_7010.fw \
+"
+
+RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-ar3k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
+
+# For ralink
+LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
+
+FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink = " \
+  /lib/firmware/rt*.bin \
+"
+
+RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
+
+# For radeon
+LICENSE_${PN}-radeon = "Firmware-radeon"
+
+FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon = " \
+  /lib/firmware/radeon \
+"
+
+RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
+
+# For marvell
+LICENSE_${PN}-sd8686 = "Firmware-Marvell"
+LICENSE_${PN}-sd8787 = "Firmware-Marvell"
+LICENSE_${PN}-sd8797 = "Firmware-Marvell"
+
+FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-sd8686 = " \
+  /lib/firmware/libertas/sd8686_v9* \
+  /lib/firmware/sd8686* \
+"
+FILES_${PN}-sd8787 = " \
+  /lib/firmware/mrvl/sd8787_uapsta.bin \
+"
+FILES_${PN}-sd8797 = " \
+  /lib/firmware/mrvl/sd8797_uapsta.bin \
+"
+
+RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license"
+
+# For rtl
+LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
+
+FILES_${PN}-rtl-license = " \
+  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+"
+FILES_${PN}-rtl8192cu = " \
+  /lib/firmware/rtlwifi/rtl8192cufw.bin \
+"
+FILES_${PN}-rtl8192ce = " \
+  /lib/firmware/rtlwifi/rtl8192cfw.bin \
+"
+FILES_${PN}-rtl8192su = " \
+  /lib/firmware/rtlwifi/rtl8712u.bin \
+"
+
+RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
+
+# For ti-connectivity
+LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
+LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
+
+FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-wl12xx = " \
+  /lib/firmware/wl12* \
+  /lib/firmware/TI* \
+  /lib/firmware/ti-connectivity \
+"
+FILES_${PN}-wl18xx = " \
+  /lib/firmware/wl18* \
+  /lib/firmware/TI* \
+  /lib/firmware/ti-connectivity \
+"
+
+RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
+RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
+
+# For vt6656
+LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
+
+FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656 = " \
+  /lib/firmware/vntwusb.fw \
+"
+
+RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
+
+# For broadcom
+#
+# WARNING: The ALTERNATIVE_* variables are not using ${PN} because of
+# a bug in bitbake; when this is fixed and bitbake learns how to proper
+# pass variable flags with expansion we can rework this patch.
+
+LICENSE_${PN}-bcm4329 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4330 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx"
+
+FILES_${PN}-broadcom-license = " \
+  /lib/firmware/LICENCE.broadcom_bcm43xx \
+"
+FILES_${PN}-bcm4329 = " \
+  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+"
+FILES_${PN}-bcm4330 = " \
+  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+"
+FILES_${PN}-bcm4334 = " \
+  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+"
+
+ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
+
+ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330-sdio.bin"
+
+RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license"
+
+# For iwlwifi
+LICENSE_${PN}-iwlwifi-135-6     = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-7    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-9    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000-4    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2b-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-4    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-5    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-7    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-9    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265-9    = "Firmware-iwlwifi_firmware"
+
+FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260-7 = "/lib/firmware/iwlwifi-7260-7.ucode"
+FILES_${PN}-iwlwifi-7260-8 = "/lib/firmware/iwlwifi-7260-8.ucode"
+FILES_${PN}-iwlwifi-7260-9 = "/lib/firmware/iwlwifi-7260-9.ucode"
+FILES_${PN}-iwlwifi-7265-8 = "/lib/firmware/iwlwifi-7265-8.ucode"
+FILES_${PN}-iwlwifi-7265-9 = "/lib/firmware/iwlwifi-7265-9.ucode"
+
+RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-9    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000-4    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2b-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-4    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-5    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-7    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-9    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265-9    = "${PN}-iwlwifi-license"
+
+# For other firmwares
+# Maybe split out to separate packages when needed.
+LICENSE_${PN} = "\
+    Firmware-Abilis \
+    & Firmware-agere \
+    & Firmware-amd-ucode \
+    & Firmware-ca0132 \
+    & Firmware-chelsio_firmware \
+    & Firmware-cw1200 \
+    & Firmware-dib0700 \
+    & Firmware-ene_firmware \
+    & Firmware-fw_sst_0f28 \
+    & Firmware-go7007 \
+    & Firmware-i2400m \
+    & Firmware-ibt_firmware \
+    & Firmware-it913x \
+    & Firmware-mwl8335 \
+    & Firmware-myri10ge_firmware \
+    & Firmware-OLPC \
+    & Firmware-phanfw \
+    & Firmware-qat_dh895xcc_firmware \
+    & Firmware-qla2xxx \
+    & Firmware-r8a779x_usb3 \
+    & Firmware-ralink_a_mediatek_company_firmware \
+    & Firmware-tda7706-firmware \
+    & Firmware-ueagle-atm4-firmware \
+    & Firmware-wl1251 \
+    & Firmware-xc4000 \
+    & Firmware-xc5000 \
+    & Firmware-xc5000c \
+"
+FILES_${PN}-license += "/lib/firmware/LICEN*"
+FILES_${PN} += "/lib/firmware/*"
+RDEPENDS_${PN} += "${PN}-license"
+
+# Make linux-firmware depend on all of the split-out packages.
+python populate_packages_prepend () {
+    firmware_pkgs = oe.utils.packages_filter_out_system(d)
+    d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
+}
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
new file mode 100644
index 0000000..566bc1e
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -0,0 +1,75 @@
+SUMMARY = "Sanitized set of kernel headers for the C library's use"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+#########################################################################
+####                        PLEASE READ 
+#########################################################################
+#
+# You're probably looking here thinking you need to create some new copy
+# of linux-libc-headers since you have your own custom kernel. To put 
+# this simply, you DO NOT.
+#
+# Why? These headers are used to build the libc. If you customise the 
+# headers you are customising the libc and the libc becomes machine
+# specific. Most people do not add custom libc extensions to the kernel
+# and have a machine specific libc.
+#
+# But you have some kernel headers you need for some driver? That is fine
+# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
+# This will make the package using them machine specific but this is much
+# better than having a machine specific C library. This does mean your 
+# recipe needs a DEPENDS += "virtual/kernel" but again, that is fine and
+# makes total sense.
+#
+# There can also be a case where your kernel extremely old and you want
+# an older libc ABI for that old kernel. The headers installed by this
+# recipe should still be a standard mainline kernel, not your own custom 
+# one.
+#
+# -- RP
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+python __anonymous () {
+    major = d.getVar("PV",True).split('.')[0]
+    if major == "3":
+        d.setVar("HEADER_FETCH_VER", "3.0")
+    elif major == "4":
+        d.setVar("HEADER_FETCH_VER", "4.x")
+    else:
+        d.setVar("HEADER_FETCH_VER", "2.6")
+}
+
+inherit kernel-arch
+
+KORG_ARCHIVE_COMPRESSION ?= "bz2"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+
+S = "${WORKDIR}/linux-${PV}"
+
+do_configure() {
+	oe_runmake allnoconfig
+}
+
+do_compile () {
+}
+
+do_install() {
+	oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}
+	# Kernel should not be exporting this header
+	rm -f ${D}${exec_prefix}/include/scsi/scsi.h
+
+	# The ..install.cmd conflicts between various configure runs
+	find ${D}${includedir} -name ..install.cmd | xargs rm -f
+}
+
+BBCLASSEXTEND = "nativesdk"
+
+#DEPENDS = "cross-linkage"
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS += "unifdef-native"
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
new file mode 100644
index 0000000..d816e5e
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
@@ -0,0 +1,7 @@
+KORG_ARCHIVE_COMPRESSION = "xz"
+
+require linux-libc-headers.inc
+
+SRC_URI[md5sum] = "fe9dc0f6729f36400ea81aa41d614c37"
+SRC_URI[sha256sum] = "caf51f085aac1e1cea4d00dbbf3093ead07b551fc07b31b2a989c05f8ea72d9f"
+
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
new file mode 100644
index 0000000..196c8c7
--- /dev/null
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Linux kernel Development Source"
+DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \
+source of the preferred virtual/kernel provider and makes it available for full kernel \
+development or external module builds"
+
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit linux-kernel-base
+
+# Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
+inherit module-base
+
+# We need the kernel to be staged (unpacked, patched and configured) before
+# we can grab the source and make the source package. We also need the bits from
+# ${B} not to change while we install, so virtual/kernel must finish do_compile.
+do_install[depends] += "virtual/kernel:do_shared_workdir"
+# Need the source, not just the output of populate_sysroot
+do_install[depends] += "virtual/kernel:do_install"
+
+# There's nothing to do here, except install the source where we can package it
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+S = "${STAGING_KERNEL_DIR}"
+B = "${STAGING_KERNEL_BUILDDIR}"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+        kerneldir=${D}${KERNEL_SRC_PATH}
+        install -d $kerneldir
+
+        #
+        # Copy the staging dir source (and module build support) into the devsrc structure.
+        # We can keep this copy simple and take everything, since a we'll clean up any build
+        # artifacts afterwards, and the extra i/o is not significant
+        #
+        cd ${B}
+        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+        cd ${S}
+        find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+
+        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
+        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
+        # architecture (since scripts and helpers are native format).
+        KBUILD_OUTPUT="$kerneldir"
+        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
+
+        # As of Linux kernel version 3.0.1, the clean target removes
+        # arch/powerpc/lib/crtsavres.o which is present in
+        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+        if [ ${ARCH} = "powerpc" ]; then
+                mkdir -p $kerneldir/arch/powerpc/lib/
+                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+        fi
+
+        chown -R root:root ${D}
+}
+# Ensure we don't race against "make scripts" during cpio
+do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
+
+PACKAGES = "kernel-devsrc"
+FILES_${PN} = "${KERNEL_SRC_PATH}"
+RDEPENDS_${PN} = "bc"
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 0000000..ee3a5e1
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,79 @@
+# Support for device tree generation
+FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*"
+
+python __anonymous () {
+    d.appendVar("PACKAGES", " kernel-devicetree")
+}
+
+do_compile_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			oe_runmake ${DTB}
+		done
+	fi
+}
+
+do_install_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			DTB_BASE_NAME=`basename ${DTB} .dtb`
+			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
+			install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+		done
+	fi
+}
+
+do_deploy_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			DTB_BASE_NAME=`basename ${DTB} .dtb`
+			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
+			install -d ${DEPLOYDIR}
+			install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
+			cd ${DEPLOYDIR}
+			ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+			cd -
+		done
+	fi
+}
+
+pkg_postinst_kernel-devicetree () {
+	cd /${KERNEL_IMAGEDEST}
+	for DTB_FILE in ${KERNEL_DEVICETREE}
+	do
+		DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
+		DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+		update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+	done
+}
+
+pkg_postrm_kernel-devicetree () {
+	cd /${KERNEL_IMAGEDEST}
+	for DTB_FILE in ${KERNEL_DEVICETREE}
+	do
+		DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
+		DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+		update-alternatives --remove ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+	done
+}
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
new file mode 100644
index 0000000..cc0e4e6
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Dummy Linux kernel"
+DESCRIPTION = "Dummy Linux kernel, to be selected as the preferred \
+provider for virtual/kernel to satisfy dependencies for situations \
+where you wish to build the kernel externally from the build system."
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+PROVIDES += "virtual/kernel"
+
+PACKAGES_DYNAMIC += "^kernel-module-.*"
+PACKAGES_DYNAMIC += "^kernel-image-.*"
+PACKAGES_DYNAMIC += "^kernel-firmware-.*"
+
+PACKAGES += "kernel-modules"
+FILES_kernel-modules = ""
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+
+#COMPATIBLE_MACHINE = "your_machine"
+
+PR = "r1"
+
+SRC_URI = "file://COPYING.GPL"
+S = "${WORKDIR}"
+
+do_configure() {
+	:
+}
+
+do_compile () {
+	:
+}
+
+do_shared_workdir () {
+	:
+}
+
+do_install() {
+	:
+}
+
+do_bundle_initramfs() {
+	:
+}
+
+do_deploy() {
+	:
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+addtask deploy after do_install
+addtask shared_workdir after do_compile before do_install
diff --git a/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
new file mode 100644
index 0000000..afe482a
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -0,0 +1,51 @@
+# This recipe tracks the linux-yocto-dev repository as its upstream source.
+# Since this tree is frequently updated, and periodically rebuilt, AUTOREV is
+# used to track its contents.
+#
+# This recipe is just like other linux-yocto variants, with the only difference
+# being that to avoid network access during initial parsing, static SRCREVs are
+# provided and overridden if the preferred kernel provider is linux-yocto-dev.
+#
+# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+# provide this .inc to set specific revisions
+include recipes-kernel/linux/linux-yocto-dev-revisions.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids network access required
+# by the use of AUTOREV SRCREVs, which are the default for this recipe.
+python () {
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-dev":
+        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-dev to enable it")
+}
+
+KBRANCH = "standard/base"
+KMETA = "kernel-meta"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-dev.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=master;destsuffix=${KMETA}"
+
+# Set default SRCREVs. Both the machine and meta SRCREVs are statically set
+# to the korg v3.7 tag, and hence prevent network access during parsing. If
+# linux-yocto-dev is the preferred provider, they will be overridden to
+# AUTOREV in following anonymous python routine and resolved when the
+# variables are finalized.
+SRCREV_machine ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+SRCREV_meta ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+
+LINUX_VERSION ?= "4.2-rc+"
+LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
+
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb b/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb
new file mode 100644
index 0000000..4d3d5c8
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb
@@ -0,0 +1,28 @@
+KBRANCH ?= "standard/preempt-rt/base"
+KBRANCH_qemuppc ?= "standard/preempt-rt/qemuppc"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "8281915527ba8d79e59906c02f28e7aa11424723"
+SRCREV_machine_qemuppc ?= "5e7d372ebc327f28656fc972fab55605eea8aec3"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.14.36"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
new file mode 100644
index 0000000..06483c3
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
@@ -0,0 +1,26 @@
+KBRANCH ?= "standard/preempt-rt"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.6"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
new file mode 100644
index 0000000..412c817
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "3.14.36"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb
new file mode 100644
index 0000000..a6a58a2
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "3.19.5"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_meta ?= "1016714868249d64fc16692fd7679672b1efa17b"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.19.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.19;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
new file mode 100644
index 0000000..061205e
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.1.6"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
new file mode 100644
index 0000000..3b41a61
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -0,0 +1,51 @@
+DESCRIPTION = "Yocto Kernel"
+SECTION = "kernel"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+INC_PR = "r4"
+
+DEPENDS += "xz-native bc-native"
+DEPENDS_append_aarch64 = " libgcc"
+KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+
+# A KMACHINE is the mapping of a yocto $MACHINE to what is built
+# by the kernel. This is typically the branch that should be built,
+# and it can be specific to the machine or shared
+# KMACHINE = "UNDEFINED"
+
+LINUX_KERNEL_TYPE ?= "standard"
+
+# KMETA ?= ""
+KBRANCH ?= "master"
+KMACHINE ?= "${MACHINE}"
+SRCREV_FORMAT ?= "meta_machine" 
+
+# LEVELS:
+#   0: no reporting
+#   1: report options that are specified, but not in the final config
+#   2: report options that are not hardware related, but set by a BSP
+KCONF_AUDIT_LEVEL ?= "1"
+KCONF_BSP_AUDIT_LEVEL ?= "0"
+
+LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"
+
+# Pick up shared functions
+inherit kernel
+inherit kernel-yocto
+require linux-dtb.inc
+
+B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
+
+do_install_append(){
+	if [ -n "${KMETA}" ]; then
+		rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
+	fi
+}
+
+# extra tasks
+addtask kernel_link_vmlinux after do_compile before do_install
+addtask validate_branches before do_patch after do_kernel_checkout
+addtask kernel_configcheck after do_configure before do_compile
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.14.bb b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
new file mode 100644
index 0000000..b6b2e5a
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/common-pc/base"
+KBRANCH_qemux86-64 ?= "standard/common-pc-64/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "4817747912b5c50ce5c31ef25658340ca615e1b4"
+SRCREV_machine_qemuarm64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_machine_qemumips ?= "6ed76ec26b120f65f8547c8612b7334bd2745ec9"
+SRCREV_machine_qemuppc ?= "a86ade84b2e142c0fd7536d96477107b6d07db5c"
+SRCREV_machine_qemux86 ?= "af1f7f586bd32d39c057f17606991b887eadb389"
+SRCREV_machine_qemux86-64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_machine_qemumips64 ?= "a63d40b860a6d255005a541894d53729090b40ea"
+SRCREV_machine ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.14.36"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.19.bb b/meta/recipes-kernel/linux/linux-yocto_3.19.bb
new file mode 100644
index 0000000..e8c1640
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.19.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/common-pc"
+KBRANCH_qemux86-64 ?= "standard/common-pc-64/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "963b4df663dba2584ac864e0c016825de0046558"
+SRCREV_machine_qemuarm64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemumips ?= "cedbbc7b5e72df2e820bb9e7885f12132c5e2fff"
+SRCREV_machine_qemuppc ?= "23a83386e10986a63e6cef712a045445499d002b"
+SRCREV_machine_qemux86 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemux86-64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemumips64 ?= "3eb70cea3532e22ab1b6da9864446621229e6616"
+SRCREV_machine ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_meta ?= "1016714868249d64fc16692fd7679672b1efa17b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.19.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.19;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.19.5"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.1.bb b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
new file mode 100644
index 0000000..46d4616
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/base"
+KBRANCH_qemux86-64 ?= "standard/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "3c1245d162ccb55de1af42bcf3dbf690457bf9e4"
+SRCREV_machine_qemuarm64 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemumips ?= "4132a691d0908d10b8f07ce7ece02e6dc94e17bc"
+SRCREV_machine_qemuppc ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemux86 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemux86-64 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemumips64 ?= "033e1aa633465449edf544eb81adda0caf16ec60"
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.6"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch b/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
new file mode 100644
index 0000000..3e2c4e1
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
@@ -0,0 +1,44 @@
+From e4cad900994cf286d971796a947fea782dfc6651 Mon Sep 17 00:00:00 2001
+From: Francis Giraldeau <francis.giraldeau@gmail.com>
+Date: Mon, 15 Jun 2015 11:43:02 -0400
+Subject: [PATCH] Fix invalid pointer free with trace collection
+
+Upstream-Status: Submitted
+
+Patch proposed by Li RongQing related to bug# 790
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
+---
+ lib/context.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/lib/context.c b/lib/context.c
+index 45aab34..8d3770f 100644
+--- a/lib/context.c
++++ b/lib/context.c
+@@ -79,7 +79,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ 	struct bt_trace_descriptor *td;
+ 	struct bt_format *fmt;
+ 	struct bt_trace_handle *handle;
+-	int ret, closeret;
++	int ret;
+ 
+ 	if (!ctx || !format_name || (!path && !stream_list))
+ 		return -EINVAL;
+@@ -159,10 +159,8 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ 	return handle->id;
+ 
+ error:
+-	closeret = fmt->close_trace(td);
+-	if (closeret) {
+-		fprintf(stderr, "Error in close_trace callback\n");
+-	}
++	if (handle)
++		bt_context_remove_trace(ctx, handle->id);
+ end:
+ 	return ret;
+ }
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb b/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb
new file mode 100644
index 0000000..536be41
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Babeltrace - Trace Format Babel Tower"
+DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
+HOMEPAGE = "http://www.efficios.com/babeltrace/"
+BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
+
+LICENSE = "MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
+
+inherit autotools pkgconfig
+
+DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
+
+SRCREV = "90395824efc007de88787a6b8e400a07c980be1c"
+PV = "1.2.4+git${SRCPV}"
+
+SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.2 \
+           file://0001-Fix-invalid-pointer-free-with-trace-collection.patch \
+"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+	( cd ${S}; ${S}/bootstrap )
+}
diff --git a/meta/recipes-kernel/lttng/lttng-modules_git.bb b/meta/recipes-kernel/lttng/lttng-modules_git.bb
new file mode 100644
index 0000000..54544fe
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules_git.bb
@@ -0,0 +1,33 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
+DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
+LICENSE = "LGPLv2.1 & GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
+                    file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
+                    file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+inherit module
+
+SRCREV = "7a88f8b50696dd71e80c08661159caf8e119bf51"
+PV = "2.6.2+git${SRCPV}"
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|arm).*-linux'
+
+SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.6"
+
+export INSTALL_MOD_DIR="kernel/lttng-modules"
+
+EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
+
+S = "${WORKDIR}/git"
+
+do_install_append() {
+	# Delete empty directories to avoid QA failures if no modules were built
+	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+    if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
+        bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
+}
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
new file mode 100644
index 0000000..199ef57
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
@@ -0,0 +1,442 @@
+This make the declarations to be extern so they dont end up
+in duplicates in data.rel.ro sections
+
+avoid errors like
+
+| ../../../src/common/.libs/libcommon.a(mi-lttng.o):(.data.rel.ro.local+0x0): multiple definition of `mi_lttng_element_snapshots'
+| commands/enable_events.o:(.bss+0x48): first defined here
+| collect2: error: ld returned 1 exit status
+| Makefile:502: recipe for target 'lttng' failed
+| make[3]: *** [lttng] Error 1
+
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: git/src/common/config/config-session-abi.h
+===================================================================
+--- git.orig/src/common/config/config-session-abi.h
++++ git/src/common/config/config-session-abi.h
+@@ -18,95 +18,95 @@
+ #ifndef CONFIG_SESSION_INTERNAL_H
+ #define CONFIG_SESSION_INTERNAL_H
+ 
+-const char * const config_element_channel;
+-const char * const config_element_channels;
+-const char * const config_element_domain;
+-const char * const config_element_domains;
+-const char * const config_element_event;
+-const char * const config_element_events;
+-const char * const config_element_context;
+-const char * const config_element_contexts;
+-const char * const config_element_attributes;
+-const char * const config_element_exclusion;
+-const char * const config_element_exclusions;
+-const char * const config_element_function_attributes;
+-const char * const config_element_probe_attributes;
+-const char * const config_element_symbol_name;
+-const char * const config_element_address;
+-const char * const config_element_offset;
+-const char * const config_element_name;
+-const char * const config_element_enabled;
+-const char * const config_element_overwrite_mode;
+-const char * const config_element_subbuf_size;
+-const char * const config_element_num_subbuf;
+-const char * const config_element_switch_timer_interval;
+-const char * const config_element_read_timer_interval;
+-const char * const config_element_output;
+-const char * const config_element_output_type;
+-const char * const config_element_tracefile_size;
+-const char * const config_element_tracefile_count;
+-const char * const config_element_live_timer_interval;
+-const char * const config_element_type;
+-const char * const config_element_buffer_type;
+-const char * const config_element_session;
+-const char * const config_element_sessions;
+-const char * const config_element_perf;
+-const char * const config_element_config;
+-const char * const config_element_started;
+-const char * const config_element_snapshot_mode;
+-const char * const config_element_loglevel;
+-const char * const config_element_loglevel_type;
+-const char * const config_element_filter;
+-const char * const config_element_snapshot_outputs;
+-const char * const config_element_consumer_output;
+-const char * const config_element_destination;
+-const char * const config_element_path;
+-const char * const config_element_net_output;
+-const char * const config_element_control_uri;
+-const char * const config_element_data_uri;
+-const char * const config_element_max_size;
+-
+-const char * const config_domain_type_kernel;
+-const char * const config_domain_type_ust;
+-const char * const config_domain_type_jul;
+-const char * const config_domain_type_log4j;
+-
+-const char * const config_buffer_type_per_pid;
+-const char * const config_buffer_type_per_uid;
+-const char * const config_buffer_type_global;
+-
+-const char * const config_overwrite_mode_discard;
+-const char * const config_overwrite_mode_overwrite;
+-
+-const char * const config_output_type_splice;
+-const char * const config_output_type_mmap;
+-
+-const char * const config_loglevel_type_all;
+-const char * const config_loglevel_type_range;
+-const char * const config_loglevel_type_single;
+-
+-const char * const config_event_type_all;
+-const char * const config_event_type_tracepoint;
+-const char * const config_event_type_probe;
+-const char * const config_event_type_function;
+-const char * const config_event_type_function_entry;
+-const char * const config_event_type_noop;
+-const char * const config_event_type_syscall;
+-const char * const config_event_type_kprobe;
+-const char * const config_event_type_kretprobe;
+-
+-const char * const config_event_context_pid;
+-const char * const config_event_context_procname;
+-const char * const config_event_context_prio;
+-const char * const config_event_context_nice;
+-const char * const config_event_context_vpid;
+-const char * const config_event_context_tid;
+-const char * const config_event_context_vtid;
+-const char * const config_event_context_ppid;
+-const char * const config_event_context_vppid;
+-const char * const config_event_context_pthread_id;
+-const char * const config_event_context_hostname;
+-const char * const config_event_context_ip;
+-const char * const config_event_context_perf_thread_counter;
++extern const char * const config_element_channel;
++extern const char * const config_element_channels;
++extern const char * const config_element_domain;
++extern const char * const config_element_domains;
++extern const char * const config_element_event;
++extern const char * const config_element_events;
++extern const char * const config_element_context;
++extern const char * const config_element_contexts;
++extern const char * const config_element_attributes;
++extern const char * const config_element_exclusion;
++extern const char * const config_element_exclusions;
++extern const char * const config_element_function_attributes;
++extern const char * const config_element_probe_attributes;
++extern const char * const config_element_symbol_name;
++extern const char * const config_element_address;
++extern const char * const config_element_offset;
++extern const char * const config_element_name;
++extern const char * const config_element_enabled;
++extern const char * const config_element_overwrite_mode;
++extern const char * const config_element_subbuf_size;
++extern const char * const config_element_num_subbuf;
++extern const char * const config_element_switch_timer_interval;
++extern const char * const config_element_read_timer_interval;
++extern const char * const config_element_output;
++extern const char * const config_element_output_type;
++extern const char * const config_element_tracefile_size;
++extern const char * const config_element_tracefile_count;
++extern const char * const config_element_live_timer_interval;
++extern const char * const config_element_type;
++extern const char * const config_element_buffer_type;
++extern const char * const config_element_session;
++extern const char * const config_element_sessions;
++extern const char * const config_element_perf;
++extern const char * const config_element_config;
++extern const char * const config_element_started;
++extern const char * const config_element_snapshot_mode;
++extern const char * const config_element_loglevel;
++extern const char * const config_element_loglevel_type;
++extern const char * const config_element_filter;
++extern const char * const config_element_snapshot_outputs;
++extern const char * const config_element_consumer_output;
++extern const char * const config_element_destination;
++extern const char * const config_element_path;
++extern const char * const config_element_net_output;
++extern const char * const config_element_control_uri;
++extern const char * const config_element_data_uri;
++extern const char * const config_element_max_size;
++
++extern const char * const config_domain_type_kernel;
++extern const char * const config_domain_type_ust;
++extern const char * const config_domain_type_jul;
++extern const char * const config_domain_type_log4j;
++
++extern const char * const config_buffer_type_per_pid;
++extern const char * const config_buffer_type_per_uid;
++extern const char * const config_buffer_type_global;
++
++extern const char * const config_overwrite_mode_discard;
++extern const char * const config_overwrite_mode_overwrite;
++
++extern const char * const config_output_type_splice;
++extern const char * const config_output_type_mmap;
++
++extern const char * const config_loglevel_type_all;
++extern const char * const config_loglevel_type_range;
++extern const char * const config_loglevel_type_single;
++
++extern const char * const config_event_type_all;
++extern const char * const config_event_type_tracepoint;
++extern const char * const config_event_type_probe;
++extern const char * const config_event_type_function;
++extern const char * const config_event_type_function_entry;
++extern const char * const config_event_type_noop;
++extern const char * const config_event_type_syscall;
++extern const char * const config_event_type_kprobe;
++extern const char * const config_event_type_kretprobe;
++
++extern const char * const config_event_context_pid;
++extern const char * const config_event_context_procname;
++extern const char * const config_event_context_prio;
++extern const char * const config_event_context_nice;
++extern const char * const config_event_context_vpid;
++extern const char * const config_event_context_tid;
++extern const char * const config_event_context_vtid;
++extern const char * const config_event_context_ppid;
++extern const char * const config_event_context_vppid;
++extern const char * const config_event_context_pthread_id;
++extern const char * const config_event_context_hostname;
++extern const char * const config_event_context_ip;
++extern const char * const config_event_context_perf_thread_counter;
+ 
+ #endif /* CONFIG_SESSION_INTERNAL_H */
+Index: git/src/common/mi-lttng.h
+===================================================================
+--- git.orig/src/common/mi-lttng.h
++++ git/src/common/mi-lttng.h
+@@ -49,133 +49,133 @@ struct mi_lttng_version {
+ };
+ 
+ /* Strings related to command */
+-const char * const mi_lttng_element_command;
+-const char * const mi_lttng_element_command_action;
+-const char * const mi_lttng_element_command_add_context;
+-const char * const mi_lttng_element_command_calibrate;
+-const char * const mi_lttng_element_command_create;
+-const char * const mi_lttng_element_command_destroy;
+-const char * const mi_lttng_element_command_disable_channel;
+-const char * const mi_lttng_element_command_disable_event;
+-const char * const mi_lttng_element_command_enable_channels;
+-const char * const mi_lttng_element_command_enable_event;
+-const char * const mi_lttng_element_command_list;
+-const char * const mi_lttng_element_command_load;
+-const char * const mi_lttng_element_command_name;
+-const char * const mi_lttng_element_command_output;
+-const char * const mi_lttng_element_command_save;
+-const char * const mi_lttng_element_command_set_session;
+-const char * const mi_lttng_element_command_snapshot;
+-const char * const mi_lttng_element_command_snapshot_add;
+-const char * const mi_lttng_element_command_snapshot_del;
+-const char * const mi_lttng_element_command_snapshot_list;
+-const char * const mi_lttng_element_command_snapshot_record;
+-const char * const mi_lttng_element_command_start;
+-const char * const mi_lttng_element_command_stop;
+-const char * const mi_lttng_element_command_success;
+-const char * const mi_lttng_element_command_version;
++extern const char * const mi_lttng_element_command;
++extern const char * const mi_lttng_element_command_action;
++extern const char * const mi_lttng_element_command_add_context;
++extern const char * const mi_lttng_element_command_calibrate;
++extern const char * const mi_lttng_element_command_create;
++extern const char * const mi_lttng_element_command_destroy;
++extern const char * const mi_lttng_element_command_disable_channel;
++extern const char * const mi_lttng_element_command_disable_event;
++extern const char * const mi_lttng_element_command_enable_channels;
++extern const char * const mi_lttng_element_command_enable_event;
++extern const char * const mi_lttng_element_command_list;
++extern const char * const mi_lttng_element_command_load;
++extern const char * const mi_lttng_element_command_name;
++extern const char * const mi_lttng_element_command_output;
++extern const char * const mi_lttng_element_command_save;
++extern const char * const mi_lttng_element_command_set_session;
++extern const char * const mi_lttng_element_command_snapshot;
++extern const char * const mi_lttng_element_command_snapshot_add;
++extern const char * const mi_lttng_element_command_snapshot_del;
++extern const char * const mi_lttng_element_command_snapshot_list;
++extern const char * const mi_lttng_element_command_snapshot_record;
++extern const char * const mi_lttng_element_command_start;
++extern const char * const mi_lttng_element_command_stop;
++extern const char * const mi_lttng_element_command_success;
++extern const char * const mi_lttng_element_command_version;
+ 
+ /* Strings related to version command */
+-const char * const mi_lttng_element_version;
+-const char * const mi_lttng_element_version_commit;
+-const char * const mi_lttng_element_version_description;
+-const char * const mi_lttng_element_version_license;
+-const char * const mi_lttng_element_version_major;
+-const char * const mi_lttng_element_version_minor;
+-const char * const mi_lttng_element_version_patch_level;
+-const char * const mi_lttng_element_version_str;
+-const char * const mi_lttng_element_version_web;
++extern const char * const mi_lttng_element_version;
++extern const char * const mi_lttng_element_version_commit;
++extern const char * const mi_lttng_element_version_description;
++extern const char * const mi_lttng_element_version_license;
++extern const char * const mi_lttng_element_version_major;
++extern const char * const mi_lttng_element_version_minor;
++extern const char * const mi_lttng_element_version_patch_level;
++extern const char * const mi_lttng_element_version_str;
++extern const char * const mi_lttng_element_version_web;
+ 
+ /* String related to a lttng_event_field */
+-const char * const mi_lttng_element_event_field;
+-const char * const mi_lttng_element_event_fields;
++extern const char * const mi_lttng_element_event_field;
++extern const char * const mi_lttng_element_event_fields;
+ 
+ /* String related to lttng_event_context */
+-const char * const mi_lttng_context_type_perf_counter;
+-const char * const mi_lttng_context_type_perf_cpu_counter;
+-const char * const mi_lttng_context_type_perf_thread_counter;
++extern const char * const mi_lttng_context_type_perf_counter;
++extern const char * const mi_lttng_context_type_perf_cpu_counter;
++extern const char * const mi_lttng_context_type_perf_thread_counter;
+ 
+ /* String related to lttng_event_perf_counter_ctx */
+-const char * const mi_lttng_element_perf_counter_context;
++extern const char * const mi_lttng_element_perf_counter_context;
+ 
+ /* Strings related to pid */
+-const char * const mi_lttng_element_pids;
+-const char * const mi_lttng_element_pid;
+-const char * const mi_lttng_element_pid_id;
++extern const char * const mi_lttng_element_pids;
++extern const char * const mi_lttng_element_pid;
++extern const char * const mi_lttng_element_pid_id;
+ 
+ /* Strings related to save command */
+-const char * const mi_lttng_element_save;
++extern const char * const mi_lttng_element_save;
+ 
+ /* Strings related to load command */
+-const char * const mi_lttng_element_load;
++extern const char * const mi_lttng_element_load;
+ 
+ /* General element of mi_lttng */
+-const char * const mi_lttng_element_empty;
+-const char * const mi_lttng_element_id;
+-const char * const mi_lttng_element_nowrite;
+-const char * const mi_lttng_element_success;
+-const char * const mi_lttng_element_type_enum;
+-const char * const mi_lttng_element_type_float;
+-const char * const mi_lttng_element_type_integer;
+-const char * const mi_lttng_element_type_other;
+-const char * const mi_lttng_element_type_string;
++extern const char * const mi_lttng_element_empty;
++extern const char * const mi_lttng_element_id;
++extern const char * const mi_lttng_element_nowrite;
++extern const char * const mi_lttng_element_success;
++extern const char * const mi_lttng_element_type_enum;
++extern const char * const mi_lttng_element_type_float;
++extern const char * const mi_lttng_element_type_integer;
++extern const char * const mi_lttng_element_type_other;
++extern const char * const mi_lttng_element_type_string;
+ 
+ /* String related to loglevel */
+-const char * const mi_lttng_loglevel_str_alert;
+-const char * const mi_lttng_loglevel_str_crit;
+-const char * const mi_lttng_loglevel_str_debug;
+-const char * const mi_lttng_loglevel_str_debug_function;
+-const char * const mi_lttng_loglevel_str_debug_line;
+-const char * const mi_lttng_loglevel_str_debug_module;
+-const char * const mi_lttng_loglevel_str_debug_process;
+-const char * const mi_lttng_loglevel_str_debug_program;
+-const char * const mi_lttng_loglevel_str_debug_system;
+-const char * const mi_lttng_loglevel_str_debug_unit;
+-const char * const mi_lttng_loglevel_str_emerg;
+-const char * const mi_lttng_loglevel_str_err;
+-const char * const mi_lttng_loglevel_str_info;
+-const char * const mi_lttng_loglevel_str_notice;
+-const char * const mi_lttng_loglevel_str_unknown;
+-const char * const mi_lttng_loglevel_str_warning;
++extern const char * const mi_lttng_loglevel_str_alert;
++extern const char * const mi_lttng_loglevel_str_crit;
++extern const char * const mi_lttng_loglevel_str_debug;
++extern const char * const mi_lttng_loglevel_str_debug_function;
++extern const char * const mi_lttng_loglevel_str_debug_line;
++extern const char * const mi_lttng_loglevel_str_debug_module;
++extern const char * const mi_lttng_loglevel_str_debug_process;
++extern const char * const mi_lttng_loglevel_str_debug_program;
++extern const char * const mi_lttng_loglevel_str_debug_system;
++extern const char * const mi_lttng_loglevel_str_debug_unit;
++extern const char * const mi_lttng_loglevel_str_emerg;
++extern const char * const mi_lttng_loglevel_str_err;
++extern const char * const mi_lttng_loglevel_str_info;
++extern const char * const mi_lttng_loglevel_str_notice;
++extern const char * const mi_lttng_loglevel_str_unknown;
++extern const char * const mi_lttng_loglevel_str_warning;
+ 
+ /* String related to loglevel JUL */
+-const char * const mi_lttng_loglevel_str_jul_all;
+-const char * const mi_lttng_loglevel_str_jul_config;
+-const char * const mi_lttng_loglevel_str_jul_fine;
+-const char * const mi_lttng_loglevel_str_jul_finer;
+-const char * const mi_lttng_loglevel_str_jul_finest;
+-const char * const mi_lttng_loglevel_str_jul_info;
+-const char * const mi_lttng_loglevel_str_jul_off;
+-const char * const mi_lttng_loglevel_str_jul_severe;
+-const char * const mi_lttng_loglevel_str_jul_warning;
++extern const char * const mi_lttng_loglevel_str_jul_all;
++extern const char * const mi_lttng_loglevel_str_jul_config;
++extern const char * const mi_lttng_loglevel_str_jul_fine;
++extern const char * const mi_lttng_loglevel_str_jul_finer;
++extern const char * const mi_lttng_loglevel_str_jul_finest;
++extern const char * const mi_lttng_loglevel_str_jul_info;
++extern const char * const mi_lttng_loglevel_str_jul_off;
++extern const char * const mi_lttng_loglevel_str_jul_severe;
++extern const char * const mi_lttng_loglevel_str_jul_warning;
+ 
+ /* String related to loglevel Log4j */
+-const char * const mi_lttng_loglevel_str_log4j_off;
+-const char * const mi_lttng_loglevel_str_log4j_fatal;
+-const char * const mi_lttng_loglevel_str_log4j_error;
+-const char * const mi_lttng_loglevel_str_log4j_warn;
+-const char * const mi_lttng_loglevel_str_log4j_info;
+-const char * const mi_lttng_loglevel_str_log4j_debug;
+-const char * const mi_lttng_loglevel_str_log4j_trace;
+-const char * const mi_lttng_loglevel_str_log4j_all;
++extern const char * const mi_lttng_loglevel_str_log4j_off;
++extern const char * const mi_lttng_loglevel_str_log4j_fatal;
++extern const char * const mi_lttng_loglevel_str_log4j_error;
++extern const char * const mi_lttng_loglevel_str_log4j_warn;
++extern const char * const mi_lttng_loglevel_str_log4j_info;
++extern const char * const mi_lttng_loglevel_str_log4j_debug;
++extern const char * const mi_lttng_loglevel_str_log4j_trace;
++extern const char * const mi_lttng_loglevel_str_log4j_all;
+ 
+ /* String related to loglevel type */
+-const char * const mi_lttng_loglevel_type_all;
+-const char * const mi_lttng_loglevel_type_range;
+-const char * const mi_lttng_loglevel_type_single;
+-const char * const mi_lttng_loglevel_type_unknown;
++extern const char * const mi_lttng_loglevel_type_all;
++extern const char * const mi_lttng_loglevel_type_range;
++extern const char * const mi_lttng_loglevel_type_single;
++extern const char * const mi_lttng_loglevel_type_unknown;
+ 
+ /* Sting related to lttng_calibrate */
+-const char * const mi_lttng_element_calibrate;
+-const char * const mi_lttng_element_calibrate_function;
++extern const char * const mi_lttng_element_calibrate;
++extern const char * const mi_lttng_element_calibrate_function;
+ 
+ /* String related to a lttng_snapshot */
+-const char * const mi_lttng_element_snapshot_ctrl_url;
+-const char * const mi_lttng_element_snapshot_data_url;
+-const char * const mi_lttng_element_snapshot_max_size;
+-const char * const mi_lttng_element_snapshot_n_ptr;
+-const char * const mi_lttng_element_snapshot_session_name;
+-const char * const mi_lttng_element_snapshots;
++extern const char * const mi_lttng_element_snapshot_ctrl_url;
++extern const char * const mi_lttng_element_snapshot_data_url;
++extern const char * const mi_lttng_element_snapshot_max_size;
++extern const char * const mi_lttng_element_snapshot_n_ptr;
++extern const char * const mi_lttng_element_snapshot_session_name;
++extern const char * const mi_lttng_element_snapshots;
+ 
+ /* Utility string function  */
+ const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
diff --git a/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch b/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch
new file mode 100644
index 0000000..4719d95
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch
@@ -0,0 +1,42 @@
+From 161496fbe1465817a77a50a1172734dae81a13ef Mon Sep 17 00:00:00 2001
+From: Mikael Beckius <mikael.beckius@windriver.com>
+Date: Tue, 12 May 2015 11:11:48 +0200
+Subject: [PATCH] lttng-tools: Fix live timer calculation error
+
+There is an calculation error for live timer. Variable switch_timer_interval is
+based on microsecond, and it is not right to assign switch_timer_interval mod
+1000000 to var tv_nsec which is based on nanosecond.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ src/common/consumer-timer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c
+index 1408052..c6202ba 100644
+--- a/src/common/consumer-timer.c
++++ b/src/common/consumer-timer.c
+@@ -368,7 +368,7 @@ void consumer_timer_switch_start(struct lttng_consumer_channel *channel,
+ 	channel->switch_timer_enabled = 1;
+ 
+ 	its.it_value.tv_sec = switch_timer_interval / 1000000;
+-	its.it_value.tv_nsec = switch_timer_interval % 1000000;
++	its.it_value.tv_nsec = (switch_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+@@ -425,7 +425,7 @@ void consumer_timer_live_start(struct lttng_consumer_channel *channel,
+ 	channel->live_timer_enabled = 1;
+ 
+ 	its.it_value.tv_sec = live_timer_interval / 1000000;
+-	its.it_value.tv_nsec = live_timer_interval % 1000000;
++	its.it_value.tv_nsec = (live_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
new file mode 100755
index 0000000..e758815
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+make -C tests installcheck
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
new file mode 100644
index 0000000..958bce4
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
@@ -0,0 +1,27 @@
+diff --git a/Makefile.am b/Makefile.am
+index 584f59b..c2bcabd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
+ dist_noinst_DATA = CodingStyle
+ 
+ EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
++
++install-ptest:
++	cp -r $(srcdir)/tests $(DESTDIR)
++	for m in $$(find $(DESTDIR)/tests -name Makefile); do \
++          sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
++        done
+diff --git a/tests/run.sh b/tests/run.sh
+index c6c50fd..6455359 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -19,4 +19,7 @@
+ 
+ [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
+ 
+-prove --merge --exec '' - < $1
++prove --merge -v --exec '' - < $1 | sed \
++  -e 's|^ok \(.*\)|PASS: \1|' \
++  -e 's|^not ok \(.*\)|FAIL: \1|' \
++  | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
new file mode 100644
index 0000000..545a5dc
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
@@ -0,0 +1,52 @@
+diff --git a/Makefile.am b/Makefile.am
+index 584f59b..c2bcabd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
+ dist_noinst_DATA = CodingStyle
+ 
+ EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
++
++install-ptest:
++	cp -r $(srcdir)/tests $(DESTDIR)
++	for m in $$(find $(DESTDIR)/tests -name Makefile); do \
++          sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
++        done
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 6d5b00d..3774f9d 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -1,14 +1,17 @@
+ SUBDIRS = utils regression unit stress
+ 
+-if USE_PYTHON
+-check-am:
++installcheck-am:
+ 	./run.sh unit_tests
+ 	./run.sh fast_regression
++if USE_PYTHON
+ 	./run.sh with_bindings_regression
+-else
++endif
++
+ check-am:
+ 	./run.sh unit_tests
+ 	./run.sh fast_regression
++if USE_PYTHON
++	./run.sh with_bindings_regression
+ endif
+ 
+ dist_noinst_SCRIPTS = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression
+diff --git a/tests/run.sh b/tests/run.sh
+index c6c50fd..6455359 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -19,4 +19,7 @@
+ 
+ [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
+ 
+-prove --merge --exec '' - < $1
++prove --merge -v --exec '' - < $1 | sed \
++  -e 's|^ok \(.*\)|PASS: \1|' \
++  -e 's|^not ok \(.*\)|FAIL: \1|' \
++  | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
new file mode 100644
index 0000000..6397a98
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
@@ -0,0 +1,82 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit Control"
+DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
+to extract program execution details from the Linux operating system \
+and interpret them."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
+                    file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
+
+DEPENDS = "liburcu popt lttng-ust libxml2"
+RDEPENDS_${PN}-ptest += "make perl bash"
+
+SRCREV = "d522c1f14285e2e8b10b7c0cd011847696ffe779"
+
+PYTHON_OPTION = "am_cv_python_pyexecdir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+                 am_cv_python_pythondir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+                 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}' \
+"
+PACKAGECONFIG ??= "lttng-ust"
+PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python swig-native"
+PACKAGECONFIG[lttng-ust] = "--enable-lttng-ust, --disable-lttng-ust, lttng-ust"
+PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
+
+SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.6 \
+           file://runtest-2.4.0.patch \
+           file://extern-decls.patch \
+           file://run-ptest \
+           file://lttng-tools-Fix-live-timer-calculation-error.patch \
+	  "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep ptest pkgconfig useradd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "tracing"
+
+export KERNELDIR="${STAGING_KERNEL_DIR}"
+
+FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
+                ${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_${PN}-dbg += "${libdir}/lttng/libexec/.debug \
+                    ${libdir}/python2.7/site-packages/.debug"
+FILES_${PN}-staticdev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a"
+FILES_${PN}-dev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la"
+
+# Since files are installed into ${libdir}/lttng/libexec we match 
+# the libexec insane test so skip it.
+# Python module needs to keep _lttng.so
+INSANE_SKIP_${PN} = "libexec dev-so"
+INSANE_SKIP_${PN}-dbg = "libexec"
+
+do_configure_prepend () {
+	# Delete a shipped m4 file that overrides our patched one
+	rm -f ${S}/config/libxml.m4
+}
+
+do_install_ptest () {
+	chmod +x ${D}${PTEST_PATH}/tests/utils/utils.sh
+	for i in `find ${D}${PTEST_PATH} -perm /u+x -type f`; do
+		sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+		  -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -i $i
+	done
+
+	sed -e "s:src/bin/lttng-sessiond:$bindir:g" \
+	    -e "s:src/bin/lttng-consumerd:${libexecdir}/libexec/:g" \
+	-i ${D}${PTEST_PATH}/tests/regression/run-report.py
+	sed -e "s:src/bin:bin:g" -e "s:lt-::g" \
+	-i ${D}${PTEST_PATH}/tests/utils/utils.sh
+	sed -e "s:ini_config:\.libs\/ini_config:" \
+	-i ${D}${PTEST_PATH}/tests/unit/ini_config/test_ini_config
+}
diff --git a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch
new file mode 100644
index 0000000..03120fe
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch
@@ -0,0 +1,42 @@
+From 6d02a6c1aeb1d050ffe7c6624bab9acfa76fc05f Mon Sep 17 00:00:00 2001
+From: Mikael Beckius <mikael.beckius@windriver.com>
+Date: Tue, 12 May 2015 11:04:34 +0200
+Subject: [PATCH] lttng-ust:Fix live timer calculation error
+
+There is an calculation error for live timer. Variable chan->switch_timer_interval is
+based on microsecond, and it is not right to assign chan->switch_timer_interval mod
+1000000 to var tv_nsec which is based on nanosecond.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ libringbuffer/ring_buffer_frontend.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c
+index eb4e486..e0377a3 100644
+--- a/libringbuffer/ring_buffer_frontend.c
++++ b/libringbuffer/ring_buffer_frontend.c
+@@ -528,7 +528,7 @@ void lib_ring_buffer_channel_switch_timer_start(struct channel *chan)
+ 	}
+ 
+ 	its.it_value.tv_sec = chan->switch_timer_interval / 1000000;
+-	its.it_value.tv_nsec = chan->switch_timer_interval % 1000000;
++	its.it_value.tv_nsec = (chan->switch_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+@@ -582,7 +582,7 @@ void lib_ring_buffer_channel_read_timer_start(struct channel *chan)
+ 	}
+ 
+ 	its.it_value.tv_sec = chan->read_timer_interval / 1000000;
+-	its.it_value.tv_nsec = chan->read_timer_interval % 1000000;
++	its.it_value.tv_nsec = (chan->read_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
new file mode 100644
index 0000000..b68a989
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Don't build the doc examples - we don't need them and in fact they
+never successfully built in previous iterations of the lttng-ust
+recipe anyway.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: doc/Makefile.am
+===================================================================
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+ 
+ dist_man_MANS = man/lttng-gen-tp.1 \
+ 	man/lttng-ust.3 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust_git.bb b/meta/recipes-kernel/lttng/lttng-ust_git.bb
new file mode 100644
index 0000000..ae4afd3
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
+DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
+HOMEPAGE = "http://lttng.org/ust"
+BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
+
+LICENSE = "LGPLv2.1+ & MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
+                    file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
+                    file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
+
+inherit autotools lib_package
+
+DEPENDS = "liburcu util-linux"
+RDEPENDS_${PN}-bin = "python-core"
+
+# For backwards compatibility after rename
+RPROVIDES_${PN} = "lttng2-ust"
+RREPLACES_${PN} = "lttng2-ust"
+RCONFLICTS_${PN} = "lttng2-ust"
+
+SRCREV = "c49ee9040ada6984c880756614e8a6f7fd645bd6"
+PE = "2"
+PV = "2.6.2+git${SRCPV}"
+
+SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.6 \
+           file://lttng-ust-doc-examples-disable.patch \
+           file://lttng-ust-Fix-live-timer-calculation-error.patch \
+        "
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+	( cd ${S}; ${S}/bootstrap )
+}
diff --git a/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
new file mode 100644
index 0000000..21ac49c
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
@@ -0,0 +1,8 @@
+Upstream-Status: Inappropriate [licensing]
+
+Index: modutils-initscripts-1.0/LICENSE
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ modutils-initscripts-1.0/LICENSE	2010-12-06 14:26:03.570339002 -0800
+@@ -0,0 +1 @@
++Public Domain
diff --git a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
new file mode 100755
index 0000000..a78adf5
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          module-init-tools
+# Required-Start:    
+# Required-Stop:     
+# Should-Start:      checkroot
+# Should-stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Process /etc/modules.
+# Description:       Load the modules listed in /etc/modules.
+### END INIT INFO
+
+LOAD_MODULE=modprobe
+[ -f /proc/modules ] || exit 0
+[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
+[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
+
+if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
+	[ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
+	depmod -Ae
+fi
+
+loaded_modules=" "
+
+process_file() {
+	file=$1
+
+	(cat $file; echo; ) |
+	while read module args
+	do
+		case "$module" in
+			\#*|"") continue ;;
+		esac
+		[ -n "$(echo $loaded_modules | grep " $module ")" ] && continue
+		[ "$VERBOSE" != no ] && echo -n "$module "
+		eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
+		loaded_modules="${loaded_modules}${module} "
+	done
+}
+
+[ "$VERBOSE" != no ] && echo -n "Loading modules: "
+[ -f /etc/modules ] && process_file /etc/modules
+
+[ -d /etc/modules-load.d ] || exit 0
+
+for f in /etc/modules-load.d/*.conf; do
+	process_file $f
+done
+[ "$VERBOSE" != no ] && echo
+
+exit 0
diff --git a/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
new file mode 100644
index 0000000..db670cf
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Initscript for auto-loading kernel modules on boot"
+SECTION = "base"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7bf87fc37976e93ec66ad84fac58c098"
+SRC_URI = "file://modutils.sh \
+	   file://PD.patch"
+
+PR = "r7"
+
+S = "${WORKDIR}"
+
+INITSCRIPT_NAME = "modutils.sh"
+INITSCRIPT_PARAMS = "start 05 S ."
+
+inherit update-rc.d
+
+do_compile () {
+}
+
+do_install () {
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
+}
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask modutils.service
+	fi
+}
diff --git a/meta/recipes-kernel/oprofile/oprofile.inc b/meta/recipes-kernel/oprofile/oprofile.inc
new file mode 100644
index 0000000..6ec56e7
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile.inc
@@ -0,0 +1,58 @@
+SUMMARY = "System-Wide Profiler"
+DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
+of profiling all running code at low overhead."
+HOMEPAGE = "http://oprofile.sourceforge.net/news/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
+
+LICENSE = "LGPLv2.1+ & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
+                   "
+SECTION = "devel"
+
+DEPENDS = "popt binutils"
+RDEPENDS_${PN} = "binutils-symlinks"
+RRECOMMENDS_${PN} = "kernel-vmlinux"
+
+FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
+FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+           file://acinclude.m4 \
+           file://automake-foreign.patch \
+           file://oprofile-cross-compile-tests.patch \
+           file://run-ptest \
+           file://root-home-dir.patch"
+
+inherit autotools pkgconfig ptest
+
+EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC="
+do_configure () {
+	cp ${WORKDIR}/acinclude.m4 ${S}/
+	autotools_do_configure
+}
+
+EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests"
+do_compile_ptest() {
+	oe_runmake check
+}
+
+do_install_ptest() {
+	subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests "
+	for tooltest in ${subdirs}
+	do
+		find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH}
+	done
+
+	# needed by some libop tests
+	cp -r events ${D}${PTEST_PATH}
+
+	# needed by libregex regex_test
+	cp libregex/stl.pat ${D}${PTEST_PATH}/libregex
+	cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests
+
+	# needed by litutil++ file_manip_tests
+	cp ${S}/libutil++/tests/file_manip_tests.cpp \
+		libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests
+}
diff --git a/meta/recipes-kernel/oprofile/oprofile/acinclude.m4 b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 0000000..95ecd91
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,581 @@
+dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
+dnl see if autoconf.h defines the option
+AC_DEFUN([AX_KERNEL_OPTION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+AC_TRY_COMPILE( [#include <linux/config.h>],
+[
+#ifndef $1
+break_me_hard(\\\);
+#endif
+],[$2],[$3],)
+CFLAGS=$SAVE_CFLAGS
+])
+
+dnl Handle the 2.4 module inside module/
+AC_DEFUN([AX_CONFIG_MODULE],
+[
+if test ! -f $KINC/linux/autoconf.h; then
+	AC_MSG_ERROR([no suitably configured kernel include tree found])
+fi
+
+dnl  --- Get Linux kernel version and compile parameters ---
+
+AC_SUBST(KVERS)
+AC_MSG_CHECKING([for kernel version])
+dnl it's like this to handle mandrake's fubar version.h - bug #471448
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
+AC_MSG_RESULT([$KVERS])
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) AC_MSG_ERROR([Unsupported kernel version])
+esac
+
+dnl Check for the minimal kernel version supported
+AC_MSG_CHECKING([kernel version])
+AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
+
+dnl linux/spinlock.h added at some point in past
+AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
+if test -f $KINC/linux/spinlock.h; then
+	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+	AC_MSG_RESULT([yes])
+else
+	AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([for rtc_lock])
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+	AC_MSG_RESULT([yes])
+else
+	AC_MSG_RESULT([no])
+fi
+	 
+arch="unknown"
+AC_MSG_CHECKING(for x86-64 architecture)
+AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
+AX_MSG_RESULT_YN($x8664)
+BUILD_HAMMER=no
+if test "$x8664" -eq 1; then
+	arch="x86"
+	BUILD_HAMMER=yes
+else
+	AC_MSG_CHECKING(for x86 architecture)
+	AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
+	AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
+	AX_MSG_RESULT_YN($x86)
+	test "$x86" = 1 && arch="x86"
+	
+	if test "$arch" = "unknown"; then
+  		AC_MSG_CHECKING(for ia64 architecture)
+  		AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
+  		AX_MSG_RESULT_YN($ia64)
+  		test "$ia64" = 1 && arch="ia64"
+	fi
+
+fi
+AC_SUBST(BUILD_HAMMER)
+
+test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
+
+dnl check to see if kernel verion appropriate for arch
+AC_MSG_CHECKING(arch/kernel version combination)
+case "$arch" in
+ia64)
+	AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
+		AC_MSG_ERROR([unsupported arch/kernel])) ;;
+*) AC_MSG_RESULT([ok])
+esac
+
+dnl for now we do not support PREEMPT patch
+AC_MSG_CHECKING([for preempt patch])
+AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
+AX_MSG_RESULT_YN([$preempt])
+test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
+
+AC_SUBST(KINC)
+
+MODINSTALLDIR=/lib/modules/$KVERS
+ 
+OPROFILE_MODULE_ARCH=$arch
+AC_SUBST(OPROFILE_MODULE_ARCH)
+]
+)
+
+dnl AX_MSG_RESULT_YN(a)
+dnl results "yes" iff a==1, "no" else
+AC_DEFUN([AX_MSG_RESULT_YN], [x=no
+test "x$1" = "x1" && x=yes
+AC_MSG_RESULT($x)])
+
+dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
+AC_DEFUN([AX_MALLOC_ATTRIBUTE],
+[
+AC_MSG_CHECKING([whether malloc attribute is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_COMPILE(,[
+void monkey() __attribute__((malloc));
+],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS 
+]
+)
+
+dnl builtin_expect is used in module we can't add that in config.h
+AC_DEFUN([AX_BUILTIN_EXPECT],
+[
+AC_MSG_CHECKING([whether __builtin_expect is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_LINK(,[
+int i;
+if (__builtin_expect(i, 0)) { }
+],
+AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
+AC_MSG_RESULT([no]);)
+CFLAGS=$SAVE_CFLAGS 
+]
+) 
+
+dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
+AC_DEFUN([AX_EXTRA_DIRS],
+[
+AC_ARG_WITH(extra-includes,
+[  --with-extra-includes=DIR    add extra include paths],
+  use_extra_includes="$withval",
+  use_extra_includes=NO
+)
+if test -n "$use_extra_includes" && \
+        test "$use_extra_includes" != "NO"; then
+  ac_save_ifs=$IFS
+  IFS=':'
+  for dir in $use_extra_includes; do
+    extra_includes="$extra_includes -I$dir"
+  done
+  IFS=$ac_save_ifs
+  CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+AC_ARG_WITH(extra-libs,
+[  --with-extra-libs=DIR        add extra library paths],
+  use_extra_libs=$withval,
+  use_extra_libs=NO
+)
+if test -n "$use_extra_libs" && \
+        test "$use_extra_libs" != "NO"; then
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $use_extra_libs; do
+     extra_libraries="$extra_libraries -L$dir"
+   done
+   IFS=$ac_save_ifs
+   LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+]
+)
+
+dnl AX_POPT_CONST - check popt prototype
+AC_DEFUN([AX_POPT_CONST],
+[
+AC_MSG_CHECKING([popt prototype])
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+AC_TRY_COMPILE([#include <popt.h>],
+[
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+],
+AC_MSG_RESULT([takes char **]);,
+AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
+CXXFLAGS="$SAVE_CXXFLAGS"
+]
+)
+
+dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
+AC_DEFUN([AX_CHECK_SSTREAM],
+[
+AC_MSG_CHECKING([whether to use included sstream])
+AC_TRY_COMPILE([#include <sstream>], [], 
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
+]
+)
+
+dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
+dnl exec action-if-true if typedef_name is a typedef to type else exec 
+dnl action-if-false
+dnl currently work only with type typedef'ed in stddef.h
+AC_DEFUN([AX_CHECK_TYPEDEF], [
+dnl AC_LANG_PUSH(C) not in autoconf 2.13
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+AC_TRY_COMPILE(
+  [
+  #include <stddef.h>
+  ],
+  [
+  typedef void (*fct1)($1);
+  typedef void (*fct2)($2);
+  fct1 f1 = 0;
+  fct2 f2 = 0;
+  if (f1 == f2) {}
+  ],
+[$3],[$4])
+
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
+dnl set var_name to the typedef name of $1 which must be in canditate_list
+dnl else produce a fatal error
+AC_DEFUN([AX_TYPEDEFED_NAME], [
+	AC_MSG_CHECKING([type of $1])
+	for f in $2; do
+		AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
+		if test -n "${$3}"; then
+			break
+		fi
+	done
+	if test -n "${$3}"; then
+		AC_MSG_RESULT([${$3}])
+	else
+		AC_MSG_ERROR([not found])
+	fi
+])
+
+dnl find a binary in the path
+AC_DEFUN([QT_FIND_PATH],
+[
+	AC_MSG_CHECKING([for $1])
+	AC_CACHE_VAL(qt_cv_path_$1,
+	[
+		qt_cv_path_$1="NONE"
+		if test -n "$$2"; then
+			qt_cv_path_$1="$$2";
+		else
+			dirs="$3"
+			qt_save_IFS=$IFS
+			IFS=':'
+			for dir in $PATH; do
+				dirs="$dirs $dir"
+			done
+			IFS=$qt_save_IFS
+ 
+			for dir in $dirs; do
+				if test -x "$dir/$1"; then
+					if test -n "$5"; then
+						evalstr="$dir/$1 $5 2>&1 "
+						if eval $evalstr; then
+							qt_cv_path_$1="$dir/$1"
+							break
+						fi
+					else
+						qt_cv_path_$1="$dir/$1"
+						break
+					fi
+				fi
+			done
+		fi
+	])
+ 
+	if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
+		AC_MSG_RESULT(not found)
+		$4
+	else
+		AC_MSG_RESULT($qt_cv_path_$1)
+		$2=$qt_cv_path_$1
+	fi
+])
+
+dnl Find the uic compiler on the path or in qt_cv_dir
+AC_DEFUN([QT_FIND_UIC],
+[
+	QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
+	if test -z "$ac_uic" -a "$FATAL" = 1; then
+		AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
+	fi
+])
+ 
+dnl Find the right moc in path/qt_cv_dir
+AC_DEFUN([QT_FIND_MOC],
+[
+	QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
+	QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
+
+	if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+		dnl found both. Prefer Qt3's if it exists else moc2
+		$ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+		if test "$?" = 0; then
+			ac_moc=$ac_moc1;
+		else
+			ac_moc=$ac_moc2;
+		fi
+	else
+		if test -n "$ac_moc1"; then
+			ac_moc=$ac_moc1;
+		else
+			ac_moc=$ac_moc2;
+		fi
+	fi
+
+	if test -z "$ac_moc"  -a "$FATAL" = 1; then
+		AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
+	fi
+])
+
+dnl check a particular libname
+AC_DEFUN([QT_TRY_LINK],
+[
+	SAVE_LIBS="$LIBS"
+	LIBS="$LIBS $1"
+	AC_TRY_LINK([
+	#include <qglobal.h>
+	#include <qstring.h>
+		],
+	[
+	QString s("mangle_failure");
+	#if (QT_VERSION < 221)
+	break_me_(\\\);
+	#endif
+	],
+	qt_cv_libname=$1,
+	)
+	LIBS="$SAVE_LIBS"
+])
+ 
+dnl check we can do a compile
+AC_DEFUN([QT_CHECK_COMPILE],
+[
+	AC_MSG_CHECKING([for Qt library name])
+ 
+	AC_CACHE_VAL(qt_cv_libname,
+	[
+		AC_LANG_CPLUSPLUS
+		SAVE_CXXFLAGS=$CXXFLAGS
+		CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS" 
+
+		for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+		do
+			QT_TRY_LINK($libname)
+			if test -n "$qt_cv_libname"; then
+				break;
+			fi
+		done
+
+		CXXFLAGS=$SAVE_CXXFLAGS
+	])
+
+	if test -z "$qt_cv_libname"; then
+		AC_MSG_RESULT([failed]) 
+		if test "$FATAL" = 1 ; then
+			AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
+		fi
+	else
+		AC_MSG_RESULT([$qt_cv_libname])
+	fi
+])
+
+dnl get Qt version we're using
+AC_DEFUN([QT_GET_VERSION],
+[
+	AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
+	[
+		AC_LANG_CPLUSPLUS
+		SAVE_CPPFLAGS=$CPPFLAGS
+		CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+		cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+		lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+			grep '^"%%%"'  2>/dev/null | \
+			sed -e 's/"%%%"//g' -e 's/"//g'`
+		rm -f conftest.$ac_ext
+		CPPFLAGS=$SAVE_CPPFLAGS
+	])
+ 
+	QT_VERSION=$lyx_cv_qtversion
+	AC_SUBST(QT_VERSION)
+])
+ 
+dnl start here 
+AC_DEFUN([QT_DO_IT_ALL],
+[
+	dnl Please leave this alone. I use this file in
+	dnl oprofile.
+	FATAL=0
+
+	AC_ARG_WITH(qt-dir, [  --with-qt-dir           where the root of Qt is installed ],
+		[ qt_cv_dir=`eval echo "$withval"/` ])
+	 
+	AC_ARG_WITH(qt-includes, [  --with-qt-includes      where the Qt includes are. ],
+		[ qt_cv_includes=`eval echo "$withval"` ])
+ 
+	AC_ARG_WITH(qt-libraries, [  --with-qt-libraries     where the Qt library is installed.],
+		[  qt_cv_libraries=`eval echo "$withval"` ])
+
+	dnl pay attention to $QTDIR unless overridden
+	if test -z "$qt_cv_dir"; then
+		qt_cv_dir=$QTDIR
+	fi
+ 
+	dnl derive inc/lib if needed
+	if test -n "$qt_cv_dir"; then
+		if test -z "$qt_cv_includes"; then
+			qt_cv_includes=$qt_cv_dir/include
+		fi
+		if test -z "$qt_cv_libraries"; then
+			qt_cv_libraries=$qt_cv_dir/lib
+		fi
+	fi
+
+	dnl flags for compilation
+	QT_INCLUDES=
+	QT_LDFLAGS=
+	if test -n "$qt_cv_includes"; then
+		QT_INCLUDES="-I$qt_cv_includes"
+	fi
+	if test -n "$qt_cv_libraries"; then
+		QT_LDFLAGS="-L$qt_cv_libraries"
+	fi
+	AC_SUBST(QT_INCLUDES)
+	AC_SUBST(QT_LDFLAGS)
+ 
+	QT_FIND_MOC
+	MOC=$ac_moc
+	AC_SUBST(MOC)
+	QT_FIND_UIC
+	UIC=$ac_uic
+	AC_SUBST(UIC)
+
+	QT_CHECK_COMPILE
+ 
+	QT_LIB=$qt_cv_libname;
+	AC_SUBST(QT_LIB)
+
+	if test -n "$qt_cv_libname"; then
+		QT_GET_VERSION
+	fi
+])
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
+AC_MSG_CHECKING([whether ${CXX} support precompiled header])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+dnl we consider than if -Winvalid-pch is accepted pch will works ...
+CXXFLAGS=-Winvalid-pch
+dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
+dnl the fact than some pch will be invalid for the given compilation option
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_CHECK_DOCBOOK
+AC_DEFUN([AX_CHECK_DOCBOOK], [
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+	for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+	do
+		if test -d "$i"; then
+			DOCBOOK_ROOT=$i
+		fi
+	done
+
+	# Last resort - try net
+	if test -z "$DOCBOOK_ROOT"; then
+		XSLTPROC_FLAGS=
+	fi
+else
+	XML_CATALOG=/etc/xml/catalog
+	CAT_ENTRY_START='<!--'
+	CAT_ENTRY_END='-->'
+fi
+
+AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+	AC_MSG_CHECKING([whether xsltproc works])
+
+	if test -n "$XML_CATALOG"; then
+		DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+	else
+		DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+	fi
+
+	$XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+	if test "$?" = 0; then
+		XSLTPROC_WORKS=yes
+	fi
+	AC_MSG_RESULT($XSLTPROC_WORKS)
+fi
+AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
+
+AC_SUBST(XML_CATALOG)
+AC_SUBST(XSLTPROC_FLAGS)
+AC_SUBST(DOCBOOK_ROOT)
+AC_SUBST(CAT_ENTRY_START)
+AC_SUBST(CAT_ENTRY_END)
+])
+
+dnl AX_CFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CC support it.
+AC_DEFUN([AX_CFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CC} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CXXFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CXX} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_COPY_IF_CHANGE(source, dest)
+dnl copy source to dest if they don't compare equally or if dest doesn't exist
+AC_DEFUN([AX_COPY_IF_CHANGE], [
+if test -r $2; then
+	if cmp $1 $2 > /dev/null; then
+		echo $2 is unchanged
+	else
+		cp -f $1 $2
+	fi
+else
+	cp -f $1 $2
+fi
+])
+
diff --git a/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
new file mode 100644
index 0000000..b9bb6c5
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
@@ -0,0 +1,12 @@
+oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign".
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 5740585..cf6c316 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
new file mode 100644
index 0000000..aefa954
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
@@ -0,0 +1,98 @@
+Prevent running check tests on host if cross compiling
+
+This patch enables running the 'make check' tests on the target
+in a cross-compiled environment. If not cross-compiling, then 'make
+ check' builds and executes the tests; no change from this patch.
+In a cross-compiling environment, the make variable CROSS_COMPILE is
+set which bypasses assiging tests to the makekfile variable TESTS.
+Since TESTS is empty, the 'make check' process never tries to run the
+tests on the hosts.  On the target, the tests must be run manually.
+
+Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
+the compilation phase, pointing to the runtime location of the test
+'file-manip-tests'.  The mechanism used for a host test, based on
+'topdir' doesn't work.  Instead, if CROSS_COMPILE is set, the
+makefile takes the path of SRCDIR from the build environment and not
+from an expression based on the host path 'topdir'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 41ece64..ce5a16f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check,
+ 	enable_account_check=$enableval, enable_account_check=yes)
+ 
+ AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
+ 
+ AC_SUBST(OP_CFLAGS)
+ AC_SUBST(OP_CXXFLAGS)
+diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
+index 8a69003..d820090 100644
+--- a/libdb/tests/Makefile.am
++++ b/libdb/tests/Makefile.am
+@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
+ db_test_SOURCES = db_test.c
+ db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
+index 8a79eb5..6d417c4 100644
+--- a/libop/tests/Makefile.am
++++ b/libop/tests/Makefile.am
+@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
+ mangle_tests_SOURCES = mangle_tests.c
+ mangle_tests_LDADD = ${COMMON_LIBS}
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS} utf8_checker.sh
++endif
+diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
+index 6f19838..1d176f9 100644
+--- a/libregex/tests/Makefile.am
++++ b/libregex/tests/Makefile.am
+@@ -18,4 +18,6 @@ java_test_LDADD = \
+ 
+ EXTRA_DIST = mangled-name.in
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
+index 51af031..a01ea2d 100644
+--- a/libutil++/tests/Makefile.am
++++ b/libutil++/tests/Makefile.am
+@@ -1,7 +1,9 @@
+ 
+ REALPATH= readlink -f
+ 
++if ! CROSS_COMPILE
+ SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
++endif
+ 
+ AM_CPPFLAGS = \
+ 	-I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
+@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
+ utility_tests_SOURCES = utility_tests.cpp
+ utility_tests_LDADD = ${COMMON_LIBS}
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
+index dfcd6ec..e8831b5 100644
+--- a/libutil/tests/Makefile.am
++++ b/libutil/tests/Makefile.am
+@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
+ string_tests_SOURCES = string_tests.c
+ string_tests_LDADD = ../libutil.a
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
diff --git a/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
new file mode 100644
index 0000000..20fc5e5
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
@@ -0,0 +1,44 @@
+oprofile: Determine the root home directory dynamically
+
+This commit detects the root home directory dynamically with changes to
+the oprofile gui app source.
+
+The commit replaces an earlier fix that detected and adjusted a
+'non-standard' root home directory at build time.  The advantage of this
+patch is that the oprofile tools are adjusted to the current run-time
+path to ~root, not the build time path.
+
+Upstream-Status: inappropriate [OE specific]
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: oprofile-1.0.0/doc/oprofile.html
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.html	2014-11-03 17:55:31.511034857 +0000
++++ oprofile-1.0.0/doc/oprofile.html	2014-11-03 17:57:26.415037988 +0000
+@@ -1563,8 +1563,8 @@
+ 		<span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
+ 		the profile data it has collected.  Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
+ 		for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
+-		with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
+-		of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
++		with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
++		of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
+ 		</p>
+               </dd>
+               <dt>
+Index: oprofile-1.0.0/doc/oprofile.xml
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.xml	2014-11-03 17:55:31.515034857 +0000
++++ oprofile-1.0.0/doc/oprofile.xml	2014-11-03 17:58:03.719039005 +0000
+@@ -654,8 +654,8 @@
+ 		<emphasis>must</emphasis> stop it in a controlled manner in order to process
+ 		the profile data it has collected.  Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
+ 		for this purpose. It is recommended that when running <command>operf</command>
+-		with this option, your current working directory should be <filename>/root</filename> or a subdirectory
+-		of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
++		with this option, your current working directory should be <filename>~root</filename> or a subdirectory
++		of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
+ 		</para></listitem>
+ 	</varlistentry>
+ 	<varlistentry>
diff --git a/meta/recipes-kernel/oprofile/oprofile/run-ptest b/meta/recipes-kernel/oprofile/oprofile/run-ptest
new file mode 100644
index 0000000..4814be6
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/run-ptest
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+saved_dir=$PWD
+for dir in */tests ; do
+	cd $dir
+	for atest in * ; do
+		if [ \( -x $atest \) -a \( -f $atest \) ] ; then
+			./$atest > ${atest}.stdout 2> ${atest}.stderr
+			if [ $? = 0 ] ; then
+				echo "PASS: $dir $atest"
+				rm ${atest}.stdout ${atest}.stderr
+			else
+				echo "FAIL: ${dir}/${atest}"
+			fi
+		fi
+	done
+	cd $saved_dir
+done
+
diff --git a/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb b/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
new file mode 100644
index 0000000..92a94ad
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
@@ -0,0 +1,10 @@
+require oprofile.inc
+
+DEPENDS += "virtual/kernel"
+DEPENDS_append_powerpc64 = " libpfm4"
+
+SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867"
+SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c"
+
+S = "${WORKDIR}/oprofile-${PV}"
+
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/init b/meta/recipes-kernel/oprofile/oprofileui-server/init
new file mode 100755
index 0000000..2544ea4
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/init
@@ -0,0 +1,37 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          oprofile-server
+# Required-Start:    $network
+# Required-Stop:     $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: OProfileUI server
+# Description:       
+### END INIT INFO
+
+. /etc/init.d/functions
+
+case "$1" in
+  start)
+        echo "Starting OProfileUI server"
+	. /etc/profile
+	/usr/bin/oprofile-server &
+  ;;
+
+  stop)
+        echo "Stopping OProfileUI server"
+        killproc oprofile-server
+  ;;
+
+  restart)
+	$0 stop
+        sleep 1
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
new file mode 100644
index 0000000..1a2cbe6
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=OProfileUI Server
+After=network.target
+
+[Service]
+ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server_git.bb b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
new file mode 100644
index 0000000..eb3b78b
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
@@ -0,0 +1,34 @@
+require oprofileui.inc
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui \
+           file://init \
+           file://oprofileui-server.service "
+
+DEPENDS += "intltool-native"
+
+EXTRA_OECONF += "--disable-client --enable-server"
+
+RDEPENDS_${PN} = "oprofile avahi-daemon"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/oprofileui-server
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/oprofileui-server.service ${D}${systemd_unitdir}/system/
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		-e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/oprofileui-server.service
+}
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "oprofileui-server"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "oprofileui-server.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta/recipes-kernel/oprofile/oprofileui.inc b/meta/recipes-kernel/oprofile/oprofileui.inc
new file mode 100644
index 0000000..8fcf014
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui.inc
@@ -0,0 +1,16 @@
+SUMMARY = "User Interface for the System-Wide Profiler"
+DESCRIPTION = "User interface for the OProfile tool"
+HOMEPAGE = "http://labs.o-hand.com/oprofileui/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+SECTION = "x11"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "glib-2.0 avahi intltool-native"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF = "--with-avahi"
+
diff --git a/meta/recipes-kernel/oprofile/oprofileui_git.bb b/meta/recipes-kernel/oprofile/oprofileui_git.bb
new file mode 100644
index 0000000..bb69d54
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui_git.bb
@@ -0,0 +1,17 @@
+require oprofileui.inc
+
+DEPENDS += "gtk+ libglade libxml2 avahi-ui gconf"
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui"
+
+EXTRA_OECONF += "--enable-client --disable-server"
+
+PACKAGES =+ "oprofileui-viewer"
+
+FILES_oprofileui-viewer = "${bindir}/oparchconv ${bindir}/oprofile-viewer ${datadir}/applications/ ${datadir}/oprofileui/ ${datadir}/icons"
+RDEPENDS_oprofileui-viewer = "oprofile"
diff --git a/meta/recipes-kernel/perf/perf-features.inc b/meta/recipes-kernel/perf/perf-features.inc
new file mode 100644
index 0000000..b8859ab
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf-features.inc
@@ -0,0 +1,22 @@
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+
+def perf_feature_enabled(feature, trueval, falseval, d):
+    """
+    Check which perf features are enabled.
+
+    The PERF_FEATURES_ENABLE variable lists the perf features to
+    enable.  Override it if you want something different from what's
+    listed above, which is the default.  If empty, the build won't
+    enable any features (which may be exactly what you want, just a
+    barebones perf without any extra baggage, what you get if you
+    specify an empty feature list).
+
+    Available perf features:
+      perf-scripting: enable support for Perl and Python bindings
+      perf-tui: enable support for the perf TUI (via libnewt)
+
+    """
+    enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
+    if feature in enabled_features:
+        return trueval
+    return falseval
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
new file mode 100644
index 0000000..adb3a2c
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -0,0 +1,210 @@
+SUMMARY = "Performance analysis tools for Linux"
+DESCRIPTION = "Performance counters for Linux are a new kernel-based \
+subsystem that provide a framework for all things \
+performance analysis. It covers hardware level \
+(CPU/PMU, Performance Monitoring Unit) features \
+and software features (software counters, tracepoints) \
+as well."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+PR = "r9"
+
+require perf-features.inc
+
+BUILDPERF_libc-uclibc = "no"
+
+# gui support was added with kernel 3.6.35
+# since 3.10 libnewt was replaced by slang
+# to cover a wide range of kernel we add both dependencies
+TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
+SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
+LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"
+
+DEPENDS = " \
+    virtual/${MLPREFIX}libc \
+    ${MLPREFIX}elfutils \
+    ${MLPREFIX}binutils \
+    ${TUI_DEPENDS} \
+    ${SCRIPTING_DEPENDS} \
+    ${LIBUNWIND_DEPENDS} \
+    bison flex xz \
+"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+PROVIDES = "virtual/perf"
+
+inherit linux-kernel-base kernel-arch pythonnative
+
+# needed for building the tools/perf Python bindings
+inherit python-dir
+export STAGING_INCDIR
+export STAGING_LIBDIR
+export BUILD_SYS
+export HOST_SYS
+export PYTHON_SITEPACKAGES_DIR
+
+#kernel 3.1+ supports WERROR to disable warnings as errors
+export WERROR = "0"
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+
+# needed for building the tools/perf Perl binding
+inherit perlnative cpan-base
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+
+inherit kernelsrc
+
+B = "${WORKDIR}/${BPN}-${PV}"
+SPDX_S = "${S}/tools/perf"
+
+SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
+TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
+LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1',d)}"
+LIBNUMA_DEFINES = "${@perf_feature_enabled('perf-libnuma', '', 'NO_LIBNUMA=1',d)}"
+
+# The LDFLAGS is required or some old kernels fails due missing
+# symbols and this is preferred than requiring patches to every old
+# supported kernel.
+LDFLAGS="-ldl -lutil"
+
+EXTRA_OEMAKE = '\
+    -C ${S}/tools/perf \
+    O=${B} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    ARCH=${ARCH} \
+    CC="${CC}" \
+    AR="${AR}" \
+    EXTRA_CFLAGS="-ldw" \
+    perfexecdir=${libexecdir} \
+    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} \
+    ${SCRIPTING_DEFINES} ${LIBNUMA_DEFINES} \
+'
+
+EXTRA_OEMAKE += "\
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+    'sharedir=${datadir}' \
+    'sysconfdir=${sysconfdir}' \
+    'perfexecdir=${libexecdir}/perf-core' \
+    \
+    'ETC_PERFCONFIG=${@os.path.relpath(sysconfdir, prefix)}' \
+    'sharedir=${@os.path.relpath(datadir, prefix)}' \
+    'mandir=${@os.path.relpath(mandir, prefix)}' \
+    'infodir=${@os.path.relpath(infodir, prefix)}' \
+"
+
+
+do_compile() {
+	# Linux kernel build system is expected to do the right thing
+	unset CFLAGS
+	oe_runmake all
+}
+
+do_install() {
+	# Linux kernel build system is expected to do the right thing
+	unset CFLAGS
+	oe_runmake DESTDIR=${D} install
+	# we are checking for this make target to be compatible with older perf versions
+	if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" ] && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+		oe_runmake DESTDIR=${D} install-python_ext
+	fi
+}
+
+do_configure_prepend () {
+    # Fix for rebuilding
+    rm -rf ${B}/
+    mkdir ${B}/
+
+    # If building a multlib based perf, the incorrect library path will be
+    # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
+    # build, with a 64 bit multilib, the arch won't match and the detection of a 
+    # 64 bit build (and library) are not exected. To ensure that libraries are
+    # installed to the correct location, we can use the weak assignment in the
+    # config/Makefile.
+    #
+    # Also need to relocate .config-detected to $(OUTPUT)/config-detected
+    # for kernel sources that do not already do this
+    # as two builds (e.g. perf and lib32-perf from mutlilib can conflict
+    # with each other if its in the shared source directory
+    #
+    if [ -e "${S}/tools/perf/config/Makefile" ]; then
+        # Match $(prefix)/$(lib) and $(prefix)/lib
+        sed -i -e 's,^libdir = \($(prefix)/.*lib\),libdir ?= \1,' \
+               -e 's,^perfexecdir = \(.*\),perfexecdir ?= \1,' \
+               -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/perf/config/Makefile
+    fi
+    if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+        sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/perf/Makefile.perf
+        sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+            ${S}/tools/perf/Makefile.perf
+    fi
+    sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+        ${S}/tools/perf/Makefile
+
+    if [ -e "${S}/tools/build/Makefile.build" ]; then
+        sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/build/Makefile.build
+    fi
+
+    # We need to ensure the --sysroot option in CC is preserved
+    if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+        sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
+        sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
+    fi
+    if [ -e "${S}/tools/lib/api/Makefile" ]; then
+        sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
+        sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile
+    fi
+    if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then
+        sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile
+    fi
+    if [ -e "${S}/tools/build/Makefile.feature" ]; then
+        sed -i 's,CFLAGS=,CC="\$(CC)" CFLAGS=,' ${S}/tools/build/Makefile.feature
+    fi
+
+    # 3.17-rc1+ has a include issue for arm/powerpc. Temporarily sed in the appropriate include
+    if [ -e "${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c" ]; then
+        sed -i 's,#include "util/callchain.h",#include "util/callchain.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c
+    fi
+    if [ -e "${S}/tools/perf/arch/arm/util/unwind-libunwind.c" ] && [ -e "${S}/tools/perf/arch/arm/tests/dwarf-unwind.c" ]; then
+        sed -i 's,#include "tests/tests.h",#include "tests/tests.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/tests/dwarf-unwind.c
+        sed -i 's,#include "perf_regs.h",#include "perf_regs.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/util/unwind-libunwind.c
+    fi
+}
+
+python do_package_prepend() {
+    d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+
+PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
+
+RDEPENDS_${PN} += "elfutils bash"
+RDEPENDS_${PN}-archive =+ "bash"
+RDEPENDS_${PN}-python =+ "bash python"
+RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
+RDEPENDS_${PN}-tests =+ "python"
+
+RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-scripting', '${PN}-perl ${PN}-python', '',d)}"
+RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
+
+FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
+FILES_${PN}-dbg += "${libdir}/python*/site-packages/.debug"
+FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
+FILES_${PN}-tests = "${libdir}/perf/perf-core/tests"
+FILES_${PN}-python = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
+FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"
+
+
+INHIBIT_PACKAGE_DEBUG_SPLIT="1"
diff --git a/meta/recipes-kernel/powertop/powertop_2.7.bb b/meta/recipes-kernel/powertop/powertop_2.7.bb
new file mode 100644
index 0000000..5ba07e9
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop_2.7.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Power usage tool"
+DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management."
+HOMEPAGE = "http://01.org/powertop/"
+BUGTRACKER = "http://bugzilla.lesswatts.org/"
+DEPENDS = "ncurses libnl pciutils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "e0d686e47daaf7e9d89031f7763432ef"
+SRC_URI[sha256sum] = "8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca"
+
+inherit autotools gettext pkgconfig
+
+# we need to explicitly link with libintl in uClibc systems
+EXTRA_LDFLAGS ?= ""
+EXTRA_LDFLAGS_libc-uclibc = "-lintl"
+LDFLAGS += "${EXTRA_LDFLAGS}"
+
+# we do not want libncursesw if we can
+do_configure_prepend() {
+    # configure.ac checks for delwin() in "ncursesw ncurses" so let's drop first one
+    sed -i -e "s/ncursesw//g" ${S}/configure.ac
+    mkdir -p ${B}/src/tuning/
+}
+
+inherit update-alternatives
+ALTERNATIVE_${PN} = "powertop"
+ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
new file mode 100644
index 0000000..dcc2cbe
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
@@ -0,0 +1,22 @@
+On uclibc elf.h does not have GNU extentions but we need this define
+so we define it locally if its not getting it from elf.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: git/elfparser.h
+===================================================================
+--- git.orig/elfparser.h	2011-07-16 18:57:41.000000000 -0700
++++ git/elfparser.h	2011-07-16 20:28:54.733829895 -0700
+@@ -17,6 +17,10 @@
+  */
+ #include <glib.h>
+ 
++#ifndef NT_GNU_BUILD_ID
++#define NT_GNU_BUILD_ID 3
++#endif
++
+ typedef struct ElfSym ElfSym;
+ typedef struct ElfParser ElfParser;
+ 
diff --git a/meta/recipes-kernel/sysprof/files/rmb-arm.patch b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
new file mode 100644
index 0000000..c53ac64
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
@@ -0,0 +1,21 @@
+
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h	2010-12-07 22:41:57.156243001 -0600
++++ git/util.h	2010-12-07 22:43:47.616243002 -0600
+@@ -37,4 +37,13 @@
+ #define cpu_relax()     asm volatile("" ::: "memory");
+ #endif
+ 
++#ifdef __arm__
++/*
++ * Use the __kuser_memory_barrier helper in the CPU helper page. See
++ * arch/arm/kernel/entry-armv.S in the kernel source for details.
++ */
++#define rmb()		((void(*)(void))0xffff0fa0)()
++#define cpu_relax()	asm volatile("":::"memory")
++#endif
++
+ #endif
diff --git a/meta/recipes-kernel/sysprof/files/rmb-mips.patch b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
new file mode 100644
index 0000000..e055b8a
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h	2010-12-08 01:22:44.486243001 -0600
++++ git/util.h	2010-12-08 01:23:27.836243001 -0600
+@@ -37,4 +37,15 @@
+ #define cpu_relax()     asm volatile("" ::: "memory");
+ #endif
+ 
++#ifdef __mips__
++#define rmb()		asm volatile(					\
++				".set	mips2\n\t"			\
++				"sync\n\t"				\
++				".set	mips0"				\
++				: /* no output */			\
++				: /* no input */			\
++				: "memory")
++#define cpu_relax()	asm volatile("" ::: "memory")
++#endif
++
+ #endif
diff --git a/meta/recipes-kernel/sysprof/sysprof_git.bb b/meta/recipes-kernel/sysprof/sysprof_git.bb
new file mode 100644
index 0000000..19c3e10
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/sysprof_git.bb
@@ -0,0 +1,27 @@
+SUMMARY = "System-wide Performance Profiler for Linux"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "gtk+ libglade"
+
+SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219"
+PV = "1.2.0+git${SRCPV}"
+
+SRC_URI = "git://git.gnome.org/sysprof \
+           file://define-NT_GNU_BUILD_ID.patch \
+          "
+
+SRC_URI_append_arm  = " file://rmb-arm.patch"
+SRC_URI_append_armeb  = " file://rmb-arm.patch"
+SRC_URI_append_mips = " file://rmb-mips.patch"
+SRC_URI_append_mips64 = " file://rmb-mips.patch"
+SRC_URI_append_mips64n32 = " file://rmb-mips.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+# We do not yet work for aarch64.
+#
+COMPATIBLE_HOST = "^(?!aarch64).*"
+
diff --git a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
new file mode 100644
index 0000000..758908b
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
@@ -0,0 +1,44 @@
+SUMMARY = "UProbes kernel module for SystemTap"
+
+require systemtap_git.inc
+
+DEPENDS = "systemtap virtual/kernel"
+
+PR = "r1"
+
+# On systems without CONFIG_UTRACE, this package is empty.
+ALLOW_EMPTY_${PN} = "1"
+
+inherit module-base gettext
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
+
+FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
+
+EXTRA_OEMAKE = ""
+
+# Compile and install the uprobes kernel module on machines with utrace
+# support.  Note that staprun expects it in the systemtap/runtime directory,
+# not in /lib/modules.
+do_compile() {
+	if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
+	then
+		unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
+		oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+			   AR="${KERNEL_AR}" \
+			   -C ${STAGING_KERNEL_DIR} scripts
+		oe_runmake KDIR=${STAGING_KERNEL_DIR}   \
+			   M="${S}/runtime/uprobes/" \
+			   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+			   AR="${KERNEL_AR}" \
+			   -C "${S}/runtime/uprobes/"
+	fi
+}
+
+do_install() {
+	if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
+	then
+		install -d ${D}${datadir}/systemtap/runtime/uprobes/
+		install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
+	fi
+}
diff --git a/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
new file mode 100644
index 0000000..b4f2fbc
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
@@ -0,0 +1,39 @@
+From 5eb10d90af9178edb65e6091ae939d1b5b19bb78 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Tue, 23 Sep 2014 04:47:10 -0400
+Subject: [PATCH] systemtap: allow to disable libvirt
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a631ae7..cb4885b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -525,10 +525,15 @@ dnl Check for the libvirt and libxml2 devel packages
+ 
+ dnl We require libvirt >= 1.0.2 because stapvirt relies on the
+ dnl virDomainOpenChannel function, which was implemented in 1.0.2.
+-PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
+-   have_libvirt=yes
+-   AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
+-   ], [have_libvirt=no])
++AC_ARG_ENABLE([libvirt],
++  AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present]))
++
++if test "$enable_libvirt" != no; then
++  PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
++     have_libvirt=yes
++     AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
++     ], [have_libvirt=no])
++fi
+ AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
+ PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
+    have_libxml2=yes
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
new file mode 100644
index 0000000..33a8994
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: git/doc/SystemTap_Tapset_Reference/Makefile.am
+===================================================================
+--- git.orig/doc/SystemTap_Tapset_Reference/Makefile.am	2012-04-13 08:43:46.263339003 -0500
++++ git/doc/SystemTap_Tapset_Reference/Makefile.am	2012-04-13 09:31:22.470083915 -0500
+@@ -27,6 +27,10 @@
+ noinst_PROGRAMS = docproc
+ SRCTREE=$(abs_top_srcdir)/
+ DOCPROC=$(abs_builddir)/docproc
++docproc_LINK = $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
++
++docproc.o: $(srcdir)/docproc.c
++	$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/docproc.c
+ 
+ all: $(PDFDOCS) stamp-htmldocs stamp-mandocs
+ tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp')
diff --git a/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
new file mode 100644
index 0000000..988cda4
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -19,7 +19,6 @@ AC_PROG_LN_S
+ AC_PROG_CC
+ AC_PROG_CXX
+ AC_PROG_CPP
+-AM_PROG_CC_STDC
+ AM_PROG_CC_C_O
+ AC_PROG_RANLIB
+ AC_OBJEXT
diff --git a/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch b/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
new file mode 100644
index 0000000..013af5c
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
@@ -0,0 +1,23 @@
+systemtap: Cross compilation fix
+
+This is a cross compilation fix. It allows systemtap to find
+the kernel map file in the right place, i.e. in the kernel build tree.
+Without this fix it takes a map file from the build host, if available.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
+
+Index: git/session.cxx
+===================================================================
+--- git.orig/session.cxx
++++ git/session.cxx
+@@ -1634,7 +1634,7 @@ systemtap_session::parse_kernel_function
+ 	clog << _F("Kernel symbol table %s unavailable, (%s)",
+ 		   system_map_path.c_str(), strerror(errno)) << endl;
+ 
+-      system_map_path = "/boot/System.map-" + kernel_release;
++      system_map_path = kernel_build_tree + "/System.map-" + kernel_release;
+       system_map.clear();
+       system_map.open(system_map_path.c_str(), ifstream::in);
+       if (! system_map.is_open())
diff --git a/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
new file mode 100644
index 0000000..28a7eae
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
@@ -0,0 +1,34 @@
+Fix time_t print because in x32 ABI is long long int instead of long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+diff --git a/cache.cxx b/cache.cxx
+index 3546b30..19c77ca 100644
+--- a/cache.cxx
++++ b/cache.cxx
+@@ -294,7 +294,11 @@ clean_cache(systemtap_session& s)
+         {
+           //interval not passed, don't continue
+           if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++            clog << _F("Cache cleaning skipped, interval not reached %lld s / %lu s.",
++#else
+             clog << _F("Cache cleaning skipped, interval not reached %lu s / %lu s.",
++#endif
+                        (current_time.tv_sec-sb.st_mtime), cache_clean_interval)  << endl;
+           return;
+         }
+@@ -302,7 +306,11 @@ clean_cache(systemtap_session& s)
+         {
+           //interval reached, continue
+           if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++            clog << _F("Cleaning cache, interval reached %lld s > %lu s.",
++#else
+             clog << _F("Cleaning cache, interval reached %lu s > %lu s.",
++#endif
+                        (current_time.tv_sec-sb.st_mtime), cache_clean_interval)  << endl;
+         }
+ 
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb
new file mode 100644
index 0000000..d0dd42a
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
+
+require systemtap_git.inc
+
+DEPENDS = "elfutils sqlite3 systemtap-native"
+DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native"
+DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext"
+
+RDEPENDS_${PN} += "python bash"
+RDEPENDS_${PN}_class-native += "python-native"
+RDEPENDS_${PN}_class-nativesdk += "python-native"
+
+EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
+            --without-nss --without-avahi --without-dyninst \
+            --disable-server --disable-grapher --enable-prologues \
+            ac_cv_prog_have_javac=no \
+            ac_cv_prog_have_jar=no "
+
+STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
+
+EXTRA_OECONF += "${STAP_DOCS} "
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
+
+inherit autotools gettext pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
+
+FILES_${PN}-dbg += "${libexecdir}/systemtap/.debug"
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
new file mode 100644
index 0000000..59a578d
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -0,0 +1,28 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SRCREV = "bf16266782e1f2588b519a50d9684279d4e21036"
+PV = "2.7+git${SRCPV}"
+
+SRC_URI = "git://sourceware.org/git/systemtap.git \
+           file://docproc-build-fix.patch \
+           file://obsolete_automake_macros.patch \
+           file://system_map_location.patch \
+           file://configure-allow-to-disable-libvirt.patch \
+           file://x32_abi_time.patch \
+          "
+
+# systemtap doesn't support mips
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux'
+
+S = "${WORKDIR}/git"
+
+# systemtap can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+def get_optimization(d):
+    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+    if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+        bb.note("systemtap can't be built with -O0, -O2 will be used instead.")
+        return selected_optimization.replace("-O0", "-O2")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
diff --git a/meta/recipes-kernel/trace-cmd/kernelshark_git.bb b/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
new file mode 100644
index 0000000..9deccae
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Graphical trace viewer for Ftrace"
+LICENSE = "GPLv2"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://kernel-shark.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e"
+
+DEPENDS = "gtk+ libxml2"
+RDEPENDS_${PN} = "trace-cmd"
+
+EXTRA_OEMAKE = "\
+    'prefix=${prefix}' \
+    'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+    'libdir=${@oe.path.relative(prefix, libdir)}' \
+    NO_PYTHON=1 \
+    gui \
+"
+do_configure_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.*.d
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" install_gui
+    rm ${D}${bindir}/trace-cmd
+    rm -rf ${D}${libdir}/trace-cmd
+    rmdir ${D}${libdir}
+}
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd.inc b/meta/recipes-kernel/trace-cmd/trace-cmd.inc
new file mode 100644
index 0000000..87e4a9c
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd.inc
@@ -0,0 +1,12 @@
+SRCREV = "0813335d2e49291e7ab6a4365cec2baa05813eda"
+PV = "2.5.3+git${SRCPV}"
+
+inherit pkgconfig
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/trace-cmd:"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=trace-cmd-stable-v2.5 \
+           file://blktrace-api-compatibility.patch \
+"
+
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
new file mode 100644
index 0000000..320db6a
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
@@ -0,0 +1,29 @@
+trace-cmd: Add blktrace_api compatibility for TC_BARRIER
+
+Newer kernels replace TC_BARRIER with TC_FLUSH. Ensure trace-cmd
+can build regardless of the linux-kernel-headers version.
+
+Upstream-Status: Inappropriate [Stop gap]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+diff --git a/plugin_blk.c b/plugin_blk.c
+index 9327b17..c8e5e1c 100644
+--- a/plugin_blk.c
++++ b/plugin_blk.c
+@@ -44,6 +44,15 @@ struct blk_data {
+ 	unsigned short		pdu_len;
+ };
+ 
++/*
++ * Newer kernels don't define BLK_TC_BARRIER and have replaced it with
++ * BLK_TC_FLUSH. In this case, define it here and report FLUSHES as BARRIERS as
++ * a workaround, as described in:
++ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=c09c47caedc9854d59378d6e34c989e51cfdd2b4
++ */
++#ifndef BLK_TC_BARRIER
++#define BLK_TC_BARRIER 1<<2
++#endif
+ static void fill_rwbs(char *rwbs, int action, unsigned int bytes)
+ {
+ 	int i = 0;
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb b/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
new file mode 100644
index 0000000..b1ac789
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
@@ -0,0 +1,35 @@
+SUMMARY = "User interface to Ftrace"
+LICENSE = "GPLv2 & LGPLv2.1"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \
+                    file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
+                    file://trace-input.c;beginline=5;endline=8;md5=3ec82f43bbe0cfb5951ff414ef4d44d0 \
+"
+
+EXTRA_OEMAKE = "\
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+    'man_dir=${mandir}' \
+    'html_install=${datadir}/kernelshark/html' \
+    'img_install=${datadir}/kernelshark/html/images' \
+    \
+    'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+    'libdir=${@oe.path.relative(prefix, libdir)}' \
+    \
+    NO_PYTHON=1 \
+"
+
+FILES_${PN}-dbg += "${libdir}/trace-cmd/plugins/.debug"
+
+do_compile_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.*.d
+}
+
+do_install() {
+        oe_runmake DESTDIR="${D}" install
+}
+