diff options
Diffstat (limited to 'poky/meta/recipes-kernel')
102 files changed, 5804 insertions, 0 deletions
diff --git a/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch new file mode 100644 index 000000000..ab905cf0d --- /dev/null +++ b/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch @@ -0,0 +1,114 @@ +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> + +Index: git/Makefile +=================================================================== +--- 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 +@@ -26,19 +27,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 + +Index: git/btreplay/Makefile +=================================================================== +--- 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 +Index: git/btt/Makefile +=================================================================== +--- 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 +Index: git/iowatcher/Makefile +=================================================================== +--- git.orig/iowatcher/Makefile ++++ git/iowatcher/Makefile +@@ -1,5 +1,6 @@ + CC = gcc + CFLAGS = -Wall -O2 -g -W -Wunused-result ++LDFLAGS = + ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 + + PROGS = iowatcher +@@ -19,7 +20,7 @@ all: $(ALL) + $(CC) -o $*.o -c $(ALL_CFLAGS) $< + + iowatcher: blkparse.o plot.o main.o tracers.o mpstat.o fio.o +- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm -lrt ++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm $(LDFLAGS) -lrt + + depend: + @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend diff --git a/poky/meta/recipes-kernel/blktrace/blktrace_git.bb b/poky/meta/recipes-kernel/blktrace/blktrace_git.bb new file mode 100644 index 000000000..663de2ed5 --- /dev/null +++ b/poky/meta/recipes-kernel/blktrace/blktrace_git.bb @@ -0,0 +1,41 @@ +SUMMARY = "Generates traces of I/O traffic on block devices" +HOMEPAGE = "http://brick.kernel.dk/snaps/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" + +DEPENDS = "libaio" + +SRCREV = "cca113f2fe0759b91fd6a0e10fdcda2c28f18a7e" + +PV = "1.2.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/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb new file mode 100644 index 000000000..c55577c66 --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb @@ -0,0 +1,13 @@ +require cryptodev.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/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb new file mode 100644 index 000000000..ed6d0ecae --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb @@ -0,0 +1,18 @@ +require cryptodev.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-with-linux-4.13.patch \ +" + +EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"' + +RCONFLICTS_${PN} = "ocf-linux" +RREPLACES_${PN} = "ocf-linux" diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb new file mode 100644 index 000000000..9afb3de21 --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb @@ -0,0 +1,21 @@ +require cryptodev.inc + +SUMMARY = "A test suite for /dev/crypto device driver" + +DEPENDS += "openssl10" + +SRC_URI += " \ +file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \ +" + +EXTRA_OEMAKE='KERNEL_DIR="${STAGING_EXECPREFIXDIR}" PREFIX="${D}"' + +do_compile() { + oe_runmake testprogs +} + +do_install() { + oe_runmake install_tests +} + +FILES_${PN} = "${bindir}/*" diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev.inc b/poky/meta/recipes-kernel/cryptodev/cryptodev.inc new file mode 100644 index 000000000..ab15bc1d9 --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/cryptodev.inc @@ -0,0 +1,11 @@ +HOMEPAGE = "http://cryptodev-linux.org/" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "git://github.com/cryptodev-linux/cryptodev-linux" +SRCREV = "87d959d9a279c055b361de8e730fab6a7144edd7" + +S = "${WORKDIR}/git" + +CLEANBROKEN = "1" diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch new file mode 100644 index 000000000..84fd27e68 --- /dev/null +++ b/poky/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(-) + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile ++++ git/Makefile +@@ -35,6 +35,9 @@ modules_install: + $(MAKE) $(KERNEL_MAKE_OPTS) modules_install + install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h + ++install_tests: ++ make -C tests install DESTDIR=$(PREFIX) ++ + clean: + $(MAKE) $(KERNEL_MAKE_OPTS) clean + rm -f $(hostprogs) *~ +@@ -43,6 +46,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 +Index: git/tests/Makefile +=================================================================== +--- git.orig/tests/Makefile ++++ git/tests/Makefile +@@ -23,6 +23,12 @@ bindir = $(execprefix)/bin + + all: $(hostprogs) + ++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 +@@ -38,6 +44,8 @@ install: + install -m 755 $$prog $(DESTDIR)/$(bindir); \ + done + ++testprogs: $(hostprogs) ++ + clean: + rm -f *.o *~ $(hostprogs) + diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch new file mode 100644 index 000000000..885b5823e --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch @@ -0,0 +1,24 @@ +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 | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 5a080e0..bf02396 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,7 +33,6 @@ install: modules_install + + modules_install: + $(MAKE) $(KERNEL_MAKE_OPTS) modules_install +- install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h + + clean: + $(MAKE) $(KERNEL_MAKE_OPTS) clean diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch new file mode 100644 index 000000000..a41efacdd --- /dev/null +++ b/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch @@ -0,0 +1,49 @@ +From f0d69774afb27ffc62bf353465fba145e70cb85a Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> +Date: Mon, 4 Sep 2017 11:05:08 +0200 +Subject: [PATCH] ioctl.c: Fix build with linux 4.13 + +git/ioctl.c:1127:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] + {0, }, + ^ +note: (near initialization for 'verbosity_ctl_dir[1]') +git/ioctl.c:1136:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] + {0, }, + ^ + +Linux kernel has added -Werror=designated-init around 4.11 (c834f0e8a8b) +triggering build errors with gcc 5 and 6 (but not with gcc 4) + +Upstream-Status: Backport + +Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> +Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com> +--- + ioctl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ioctl.c b/ioctl.c +index 0385203..8d4a162 100644 +--- a/ioctl.c ++++ b/ioctl.c +@@ -1124,7 +1124,7 @@ static struct ctl_table verbosity_ctl_dir[] = { + .mode = 0644, + .proc_handler = proc_dointvec, + }, +- {0, }, ++ {}, + }; + + static struct ctl_table verbosity_ctl_root[] = { +@@ -1133,7 +1133,7 @@ static struct ctl_table verbosity_ctl_root[] = { + .mode = 0555, + .child = verbosity_ctl_dir, + }, +- {0, }, ++ {}, + }; + static struct ctl_table_header *verbosity_sysctl_header; + static int __init init_cryptodev(void) +-- +2.7.4 + diff --git a/poky/meta/recipes-kernel/dtc/dtc.inc b/poky/meta/recipes-kernel/dtc/dtc.inc new file mode 100644 index 000000000..9a90d4404 --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc.inc @@ -0,0 +1,25 @@ +SUMMARY = "Device Tree Compiler" +HOMEPAGE = "https://devicetree.org/" +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 \ + file://0001-checks-Use-proper-format-modifier-for-size_t.patch \ + " +UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" + +EXTRA_OEMAKE='NO_PYTHON=1 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 diffutils" diff --git a/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch b/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch new file mode 100644 index 000000000..cab384dd9 --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch @@ -0,0 +1,43 @@ +From c7a4c3817796107bb824a1f173faf90fae45396b Mon Sep 17 00:00:00 2001 +From: Thierry Reding <treding@nvidia.com> +Date: Wed, 27 Sep 2017 15:04:09 +0200 +Subject: [PATCH] checks: Use proper format modifier for size_t + +The size of size_t can vary between architectures, so using %ld isn't +going to work on 32-bit builds. Use the %zu modifier to make sure it is +always correct. + +Upstream-Status: Backport +Signed-off-by: Thierry Reding <treding@nvidia.com> +Acked-by: Rob Herring <robh@kernel.org> +Signed-off-by: David Gibson <david@gibson.dropbear.id.au> +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + checks.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/checks.c b/checks.c +index 902f2e3..08a3a29 100644 +--- a/checks.c ++++ b/checks.c +@@ -972,7 +972,7 @@ static void check_property_phandle_args(struct check *c, + int cell, cellsize = 0; + + if (prop->val.len % sizeof(cell_t)) { +- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s", ++ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", + prop->name, prop->val.len, sizeof(cell_t), node->fullpath); + return; + } +@@ -1163,7 +1163,7 @@ static void check_interrupts_property(struct check *c, + return; + + if (irq_prop->val.len % sizeof(cell_t)) +- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s", ++ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", + irq_prop->name, irq_prop->val.len, sizeof(cell_t), + node->fullpath); + +-- +2.15.0 + diff --git a/poky/meta/recipes-kernel/dtc/dtc/make_install.patch b/poky/meta/recipes-kernel/dtc/dtc/make_install.patch new file mode 100644 index 000000000..ccf17b38f --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc/make_install.patch @@ -0,0 +1,17 @@ +Upstream-Status: Inappropriate [configuration] + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile ++++ git/Makefile +@@ -168,8 +168,8 @@ install-bin: all $(SCRIPTS) + install-lib: all + @$(VECHO) INSTALL-LIB + $(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) + diff --git a/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb b/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb new file mode 100644 index 000000000..0e46cfbeb --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb @@ -0,0 +1,10 @@ +require dtc.inc + +LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c" + +SRCREV = "22a65c5331c22979d416738eb756b9541672e00d" + +S = "${WORKDIR}/git" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb new file mode 100644 index 000000000..8ccd8cee1 --- /dev/null +++ b/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb @@ -0,0 +1,24 @@ +SUMMARY = "Tools for managing Yocto Project style branched kernels" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=a6c2fa8aef1bda400e2828845ba0d06c" + +DEPENDS = "git-native" + +SRCREV = "b46b1c4f0973bf1eb09cf1191f5f4e69bcd0475d" +PR = "r12" +PV = "0.2+git${SRCPV}" + +inherit native + +SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git" +S = "${WORKDIR}" +UPSTREAM_CHECK_COMMITS = "1" + +do_compile() { + : +} + +do_install() { + cd ${S}/git + make DESTDIR=${D}${bindir} install +} diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch new file mode 100644 index 000000000..3f2f85e33 --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch @@ -0,0 +1,31 @@ +From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 10 Jun 2017 11:18:49 -0700 +Subject: [PATCH] Disable PIE during link + +We have explcitly disabled PIE during compile so we +just need to match it with linker flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + purgatory/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/purgatory/Makefile b/purgatory/Makefile +index 564bdb7..a08e41f 100644 +--- a/purgatory/Makefile ++++ b/purgatory/Makefile +@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + -Iinclude \ + -I$(shell $(CC) -print-file-name=include) + $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ +- -Wl,--no-undefined -nostartfiles -nostdlib \ ++ -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \ + -nodefaultlibs -e purgatory_start -Wl,-r \ + -Wl,-Map=$(PURGATORY_MAP) + +-- +2.13.1 + diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch new file mode 100644 index 000000000..bfd077daf --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch new file mode 100644 index 000000000..dc97d930e --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch new file mode 100644 index 000000000..6c6c66d88 --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch @@ -0,0 +1,52 @@ +From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001 +From: Haiqing Bai <Haiqing.Bai@windriver.com> +Date: Mon, 9 Jan 2017 15:26:29 +0800 +Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue + +When "CONFIG_ARM_LPAE" is enabled,3 level page table +is used by MMU, the "SECTION_SIZE" is defined with +(1 << 21), but 'add_buffer_phys_virt()' hardcode this +to (1 << 20). + +Upstream-Status: Pending + +Suggested-By:fredrik.markstrom@gmail.com +Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> +--- + kexec/arch/arm/crashdump-arm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c +index 245c21a..12139c3 100644 +--- a/kexec/arch/arm/crashdump-arm.c ++++ b/kexec/arch/arm/crashdump-arm.c +@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + void *buf; + int err; + int last_ranges; ++ unsigned short align_bit_shift = 20; + + /* + * First fetch all the memory (RAM) ranges that we are going to pass to +@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + + /* for support LPAE enabled kernel*/ + elf_info.class = ELFCLASS64; ++ align_bit_shift = 21; + + err = crash_create_elf64_headers(info, &elf_info, + usablemem_rgns.ranges, +@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + * 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. ++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h + */ +- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20, ++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift, + crash_kernel_mem.start, + crash_kernel_mem.end, -1, 0); + +-- +1.9.1 + diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump new file mode 100755 index 000000000..69e3cafe5 --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump @@ -0,0 +1,145 @@ +#! /bin/sh +# +# kdump +# +# Description: The kdump script provides the support: +# 1. Load a kdump kernel image into memory; +# 2. Copy away vmcore when system panic. +# + +#default +KEXEC=/usr/sbin/kexec +KEXEC_ARGS="-p" + +MAKEDUMPFILE=/usr/bin/makedumpfile +MAKEDUMPFILE_ARGS="-E -d 1" + +LOGGER="logger -p info -t kdump" + +if [ -f /etc/sysconfig/kdump.conf ]; then + . /etc/sysconfig/kdump.conf +else + echo "no /etc/sysconfig/kdump.conf" + exit 1; +fi + +do_check() +{ + #check makedumpfile + if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then + echo "No makedumpfile found." + exit 0 + fi + + #check kexec + if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then + echo "No kexec found." + exit 0 + fi + + #check whether kdump kernel image exists on the system + if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then + echo "No kdump kernel image found." + exit 0 + fi + + if [ "${KDUMP_CMDLINE}"x = "x" ] ; then + echo "KDUMP_CMDLINE is not configured" + exit 0 + fi +} + +do_save_vmcore() +{ + if [ ${KDUMP_VMCORE_PATH}x = x ]; then + KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" + fi + + mkdir -p ${KDUMP_VMCORE_PATH} + echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}." + + ${MAKEDUMPFILE} ${MAKEDUMPFILE_ARGS} /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" +# cp --sparse=always /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" + rc=$? + if [ ${rc} == 0 ]; then + ${LOGGER} "Saved a vmcore to ${KDUMP_VMCORE_PATH}." + else + ${LOGGER} "Failed to save vmcore!" + fi + return ${rc} +} + +do_start() +{ + #check file + do_check + + #check whether the running kernel supports kdump. + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + echo "Kdump isn't supported on the running kernel!!!" + ${LOGGER} "Kdump isn't supported on the running kernel!!!" + return 1 + fi + + #check whether kdump kernel image has been loaded + rc=`cat /sys/kernel/kexec_crash_loaded` + if [ ${rc} != 0 ]; then + echo "Kdump is already running."; + ${LOGGER} "Kdump is already running." + return 0 + fi + + #check the running kernel cmdline option,insure "crashkernel=" always set. + grep -q crashkernel= /proc/cmdline + if [ $? != 0 ]; then + echo "Kdump isn't supported on the running kernel,please check boot option!!!" + ${LOGGER} "Kdump isn't supported on the running kernel,please check boot option!!!" + return 1 + fi + + #Load the kdump kernel image + ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}" + if [ $? != 0 ]; then + echo "Failed to load kdump kernel!" + ${LOGGER} "Failed to load kdump kernel!" + return 1 + fi + + echo "Kdump started up." + ${LOGGER} "Kdump started up." +} + +do_stop() +{ + ${KEXEC} -p -u 2>/dev/null + if [ $? == 0 ]; then + echo "Kdump has been stopped." + ${LOGGER} "Kdump has been stopped." + else + echo "Failed to stop kdump!" + ${LOGGER} "Failed to stop kdump!" + fi +} + +case "$1" in + start) + if [ -s /proc/vmcore ]; then + do_save_vmcore + reboot + else + do_start + fi + ;; + restart) + do_stop + do_start + ;; + stop) + do_stop + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf new file mode 100644 index 000000000..38190d207 --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf @@ -0,0 +1,14 @@ +#the kdump kernel version string. +#KDUMP_KVER="`uname -r`" + +#this will be passed to the kdump kernel as kdump kernel command line +#KDUMP_CMDLINE="`cat /proc/cmdline`" + +#the kernel image for kdump +#KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}" + +#Where to save the vmcore +#KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" + +#the arguments to makedumpfile +MAKEDUMPFILE_ARGS="--dump-dmesg -x /boot/vmlinux-`uname -r`" diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service new file mode 100644 index 000000000..4e65a46ac --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service @@ -0,0 +1,12 @@ +[Unit] +Description=Reboot and dump vmcore via kexec +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=@LIBEXECDIR@/kdump-helper start +ExecStop=@LIBEXECDIR@/kdump-helper stop + +[Install] +WantedBy=multi-user.target diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch new file mode 100644 index 000000000..26d18eb6f --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb b/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb new file mode 100644 index 000000000..ebb483268 --- /dev/null +++ b/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb @@ -0,0 +1,86 @@ + +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" + +PR = "r1" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \ + file://kdump \ + file://kdump.conf \ + file://kdump.service \ + file://0002-powerpc-change-the-memory-size-limit.patch \ + file://0001-purgatory-Pass-r-directly-to-linker.patch \ + file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \ + file://kexec-x32.patch \ + file://0001-Disable-PIE-during-link.patch \ + " + +SRC_URI[md5sum] = "5198968de79b5ded96f97f3c2ea9637b" +SRC_URI[sha256sum] = "cf17fc99bf77c9b39f06ee88ac0e86d0349c4a0c3f8214a3cc78eece872f6f3a" + +inherit autotools update-rc.d systemd + +export LDFLAGS = "-L${STAGING_LIBDIR}" +EXTRA_OECONF = " --with-zlib=yes" + +do_compile_prepend() { + # Remove the prepackaged config.h from the source tree as it overrides + # the same file generated by configure and placed in the build tree + rm -f ${S}/include/config.h + + # 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 +} + +do_install_append () { + install -d ${D}${sysconfdir}/sysconfig + install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper + install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service + sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service + fi +} + +PACKAGES =+ "kexec kdump vmcore-dmesg" + +ALLOW_EMPTY_${PN} = "1" +RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg" + +FILES_kexec = "${sbindir}/kexec" +FILES_kdump = "${sbindir}/kdump \ + ${sysconfdir}/sysconfig/kdump.conf \ + ${sysconfdir}/init.d/kdump \ + ${libexecdir}/kdump-helper \ + ${systemd_unitdir}/system/kdump.service \ +" + +FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg" + +INITSCRIPT_PACKAGES = "kdump" +INITSCRIPT_NAME_kdump = "kdump" +INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ." + +SECURITY_PIE_CFLAGS_remove = "-fPIE -pie" + +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' + +INSANE_SKIP_${PN} = "arch" diff --git a/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb new file mode 100644 index 000000000..9a172675a --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb @@ -0,0 +1,46 @@ +SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" +LICENSE = "MIT" + +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" +EXTRA_STAGING_FIXMES += "PKGDATA_DIR" + +DEPENDS += "kmod-native" +do_populate_sysroot[depends] = "" + +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 + +kernelabi="" +if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then + kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion") +fi + +if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$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_DIRS += "${bindir_crossscripts}" + +PACKAGES = "" +inherit nopackages diff --git a/poky/meta/recipes-kernel/kmod/kmod-native_git.bb b/poky/meta/recipes-kernel/kmod/kmod-native_git.bb new file mode 100644 index 000000000..f0e274ed7 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod.inc b/poky/meta/recipes-kernel/kmod/kmod.inc new file mode 100644 index 000000000..29885fbe7 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod.inc @@ -0,0 +1,42 @@ +# 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" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + " +inherit autotools gtk-doc pkgconfig manpages + +SRCREV = "aca4eca103d6699543f7ed663335c28c2e9908bb" +# Lookout for PV bump too when SRCREV is changed +PV = "25+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 --with-zlib" + +CACHED_CONFIGUREVARS += "ac_cv_path_DOLT_BASH='/usr/bin/env bash'" + +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" +PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" +PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" + +GTKDOC_DOCDIR = "${S}/libkmod/docs" + +do_configure_append () { + sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool +} diff --git a/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch new file mode 100644 index 000000000..b722183b6 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch new file mode 100644 index 000000000..5f45fce93 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch @@ -0,0 +1,26 @@ +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(-) + +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac ++++ git/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]) + DOLT diff --git a/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf new file mode 100644 index 000000000..527c0bb6e --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch new file mode 100644 index 000000000..5d9d40c38 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch @@ -0,0 +1,35 @@ +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(+) + +Index: git/libkmod/libkmod-internal.h +=================================================================== +--- git.orig/libkmod/libkmod-internal.h ++++ git/libkmod/libkmod-internal.h +@@ -10,6 +10,10 @@ + + #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, ...) {} + diff --git a/poky/meta/recipes-kernel/kmod/kmod/ptest.patch b/poky/meta/recipes-kernel/kmod/kmod/ptest.patch new file mode 100644 index 000000000..831dbcb90 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod/run-ptest b/poky/meta/recipes-kernel/kmod/kmod/run-ptest new file mode 100755 index 000000000..598dd2cb5 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod_git.bb b/poky/meta/recipes-kernel/kmod/kmod_git.bb new file mode 100644 index 000000000..69185b245 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod_git.bb @@ -0,0 +1,62 @@ +# 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 + lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod + for tool in insmod rmmod depmod modinfo modprobe; do + lnr ${D}${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 bash-completion + +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" + +FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" +FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" diff --git a/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb new file mode 100644 index 000000000..8d6f2f2db --- /dev/null +++ b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb @@ -0,0 +1,807 @@ +SUMMARY = "Firmware files for use with Linux kernel" +SECTION = "kernel" + +LICENSE = "\ + Firmware-Abilis \ + & Firmware-adsp_sst \ + & Firmware-agere \ + & Firmware-amdgpu \ + & Firmware-amd-ucode \ + & Firmware-atheros_firmware \ + & Firmware-atmel \ + & Firmware-broadcom_bcm43xx \ + & Firmware-ca0132 \ + & Firmware-cavium \ + & Firmware-chelsio_firmware \ + & Firmware-cw1200 \ + & Firmware-dib0700 \ + & Firmware-e100 \ + & Firmware-ene_firmware \ + & Firmware-fw_sst_0f28 \ + & Firmware-go7007 \ + & Firmware-GPLv2 \ + & Firmware-hfi1_firmware \ + & Firmware-i2400m \ + & Firmware-i915 \ + & Firmware-ibt_firmware \ + & Firmware-it913x \ + & Firmware-iwlwifi_firmware \ + & Firmware-IntcSST2 \ + & Firmware-kaweth \ + & Firmware-Marvell \ + & Firmware-moxa \ + & Firmware-myri10ge_firmware \ + & Firmware-netronome \ + & Firmware-nvidia \ + & Firmware-OLPC \ + & Firmware-ath9k-htc \ + & Firmware-phanfw \ + & Firmware-qat \ + & Firmware-qcom \ + & Firmware-qla1280 \ + & Firmware-qla2xxx \ + & Firmware-qualcommAthos_ar3k \ + & Firmware-qualcommAthos_ath10k \ + & Firmware-r8a779x_usb3 \ + & Firmware-radeon \ + & Firmware-ralink_a_mediatek_company_firmware \ + & Firmware-ralink-firmware \ + & Firmware-rtlwifi_firmware \ + & Firmware-imx-sdma_firmware \ + & Firmware-siano \ + & Firmware-tda7706-firmware \ + & Firmware-ti-connectivity \ + & Firmware-ti-keystone \ + & Firmware-ueagle-atm4-firmware \ + & Firmware-via_vt6656 \ + & Firmware-wl1251 \ + & Firmware-xc4000 \ + & Firmware-xc5000 \ + & Firmware-xc5000c \ + & WHENCE \ +" + +LIC_FILES_CHKSUM = "\ + file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \ + file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \ + file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \ + file://LICENSE.amdgpu;md5=0aa3c2f3e736af320a08a3aeeccecf29 \ + file://LICENSE.amd-ucode;md5=3a0de451253cc1edbf30a3c621effee3 \ + file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \ + file://LICENSE.atmel;md5=aa74ac0c60595dee4d4e239107ea77a3 \ + file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \ + file://LICENCE.ca0132;md5=209b33e66ee5be0461f13d31da392198 \ + file://LICENCE.cavium;md5=c37aaffb1ebe5939b2580d073a95daea \ + file://LICENCE.chelsio_firmware;md5=819aa8c3fa453f1b258ed8d168a9d903 \ + file://LICENCE.cw1200;md5=f0f770864e7a8444a5c5aa9d12a3a7ed \ + file://LICENSE.dib0700;md5=f7411825c8a555a1a3e5eab9ca773431 \ + file://LICENCE.e100;md5=ec0f84136766df159a3ae6d02acdf5a8 \ + file://LICENCE.ene_firmware;md5=ed67f0f62f8f798130c296720b7d3921 \ + file://LICENCE.fw_sst_0f28;md5=6353931c988ad52818ae733ac61cd293 \ + file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \ + file://GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LICENSE.hfi1_firmware;md5=5e7b6e586ce7339d12689e49931ad444 \ + file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \ + file://LICENSE.i915;md5=2b0b2e0d20984affd4490ba2cba02570 \ + file://LICENCE.ibt_firmware;md5=fdbee1ddfe0fb7ab0b2fcd6b454a366b \ + file://LICENCE.IntcSST2;md5=9e7d8bea77612d7cc7d9e9b54b623062 \ + file://LICENCE.it913x;md5=1fbf727bfb6a949810c4dbfa7e6ce4f8 \ + file://LICENCE.iwlwifi_firmware;md5=3fd842911ea93c29cd32679aa23e1c88 \ + file://LICENCE.kaweth;md5=b1d876e562f4b3b8d391ad8395dfe03f \ + file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \ + file://LICENCE.moxa;md5=1086614767d8ccf744a923289d3d4261 \ + file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \ + file://LICENCE.Netronome;md5=4add08f2577086d44447996503cddf5f \ + file://LICENCE.nvidia;md5=4428a922ed3ba2ceec95f076a488ce07 \ + file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \ + file://LICENCE.open-ath9k-htc-firmware;md5=1b33c9f4d17bc4d457bdb23727046837 \ + file://LICENCE.phanfw;md5=954dcec0e051f9409812b561ea743bfa \ + file://LICENCE.qat_firmware;md5=9e7d8bea77612d7cc7d9e9b54b623062 \ + file://LICENSE.qcom;md5=164e3362a538eb11d3ac51e8e134294b \ + file://LICENCE.qla1280;md5=d6895732e622d950609093223a2c4f5d \ + file://LICENCE.qla2xxx;md5=505855e921b75f1be4a437ad9b79dff0 \ + file://LICENSE.QualcommAtheros_ar3k;md5=b5fe244fb2b532311de1472a3bc06da5 \ + file://LICENSE.QualcommAtheros_ath10k;md5=cb42b686ee5f5cb890275e4321db60a8 \ + file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \ + file://LICENSE.radeon;md5=68ec28bacb3613200bca44f404c69b16 \ + file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \ + file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \ + file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \ + file://LICENSE.sdma_firmware;md5=51e8c19ecc2270f4b8ea30341ad63ce9 \ + file://LICENCE.siano;md5=4556c1bf830067f12ca151ad953ec2a5 \ + file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \ + file://LICENCE.ti-connectivity;md5=c5e02be633f1499c109d1652514d85ec \ + file://LICENCE.ti-keystone;md5=3a86335d32864b0bef996bee26cc0f2c \ + 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://WHENCE;md5=6f46986f4e913ef16b765c2319cc5141 \ +" + +# 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-adsp_sst] = "LICENCE.adsp_sst" +NO_GENERIC_LICENSE[Firmware-agere] = "LICENCE.agere" +NO_GENERIC_LICENSE[Firmware-amdgpu] = "LICENSE.amdgpu" +NO_GENERIC_LICENSE[Firmware-amd-ucode] = "LICENSE.amd-ucode" +NO_GENERIC_LICENSE[Firmware-atheros_firmware] = "LICENCE.atheros_firmware" +NO_GENERIC_LICENSE[Firmware-atmel] = "LICENSE.atmel" +NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx] = "LICENCE.broadcom_bcm43xx" +NO_GENERIC_LICENSE[Firmware-ca0132] = "LICENCE.ca0132" +NO_GENERIC_LICENSE[Firmware-cavium] = "LICENCE.cavium" +NO_GENERIC_LICENSE[Firmware-chelsio_firmware] = "LICENCE.chelsio_firmware" +NO_GENERIC_LICENSE[Firmware-cw1200] = "LICENCE.cw1200" +NO_GENERIC_LICENSE[Firmware-dib0700] = "LICENSE.dib0700" +NO_GENERIC_LICENSE[Firmware-e100] = "LICENCE.e100" +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-GPLv2] = "GPL-2" +NO_GENERIC_LICENSE[Firmware-hfi1_firmware] = "LICENSE.hfi1_firmware" +NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m" +NO_GENERIC_LICENSE[Firmware-i915] = "LICENSE.i915" +NO_GENERIC_LICENSE[Firmware-ibt_firmware] = "LICENCE.ibt_firmware" +NO_GENERIC_LICENSE[Firmware-IntcSST2] = "LICENCE.IntcSST2" +NO_GENERIC_LICENSE[Firmware-it913x] = "LICENCE.it913x" +NO_GENERIC_LICENSE[Firmware-iwlwifi_firmware] = "LICENCE.iwlwifi_firmware" +NO_GENERIC_LICENSE[Firmware-kaweth] = "LICENCE.kaweth" +NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell" +NO_GENERIC_LICENSE[Firmware-moxa] = "LICENCE.moxa" +NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware" +NO_GENERIC_LICENSE[Firmware-netronome] = "LICENCE.Netronome" +NO_GENERIC_LICENSE[Firmware-nvidia] = "LICENCE.nvidia" +NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC" +NO_GENERIC_LICENSE[Firmware-ath9k-htc] = "LICENCE.open-ath9k-htc-firmware" +NO_GENERIC_LICENSE[Firmware-phanfw] = "LICENCE.phanfw" +NO_GENERIC_LICENSE[Firmware-qat] = "LICENCE.qat_firmware" +NO_GENERIC_LICENSE[Firmware-qcom] = "LICENSE.qcom" +NO_GENERIC_LICENSE[Firmware-qla1280] = "LICENCE.qla1280" +NO_GENERIC_LICENSE[Firmware-qla2xxx] = "LICENCE.qla2xxx" +NO_GENERIC_LICENSE[Firmware-qualcommAthos_ar3k] = "LICENSE.QualcommAtheros_ar3k" +NO_GENERIC_LICENSE[Firmware-qualcommAthos_ath10k] = "LICENSE.QualcommAtheros_ath10k" +NO_GENERIC_LICENSE[Firmware-r8a779x_usb3] = "LICENCE.r8a779x_usb3" +NO_GENERIC_LICENSE[Firmware-radeon] = "LICENSE.radeon" +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-siano] = "LICENCE.siano" +NO_GENERIC_LICENSE[Firmware-imx-sdma_firmware] = "LICENSE.sdma_firmware" +NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt" +NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity" +NO_GENERIC_LICENSE[Firmware-ti-keystone] = "LICENCE.ti-keystone" +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[WHENCE] = "WHENCE" + +SRCREV = "8fc2d4e55685bf73b6f7752383da9067404a74bb" +PE = "1" +PV = "0.0+git${SRCPV}" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" + +UPSTREAM_CHECK_COMMITS = "1" + +S = "${WORKDIR}/git" + +inherit allarch + +CLEANBROKEN = "1" + +do_compile() { + : +} + +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/ + cp -r * ${D}${nonarch_base_libdir}/firmware/ + + # Avoid Makefile to be deployed + rm ${D}${nonarch_base_libdir}/firmware/Makefile + + # Remove unbuild firmware which needs cmake and bash + rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf + + # Remove pointless bash script + rm ${D}${nonarch_base_libdir}/firmware/configure + + # Remove python script used to check the WHENCE file + rm ${D}${nonarch_base_libdir}/firmware/check_whence.py + + # Libertas sd8686 + ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin + ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin + + # fixup wl12xx location, after 2.6.37 the kernel searches a different location for it + ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . ) +} + + +PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \ + ${PN}-mt7601u-license ${PN}-mt7601u \ + ${PN}-radeon-license ${PN}-radeon \ + ${PN}-marvell-license ${PN}-pcie8897 ${PN}-pcie8997 \ + ${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 ${PN}-sd8801 ${PN}-sd8887 ${PN}-sd8897 \ + ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \ + ${PN}-vt6656-license ${PN}-vt6656 \ + ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \ + ${PN}-broadcom-license \ + ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 ${PN}-bcm43340 \ + ${PN}-bcm43362 ${PN}-bcm4339 ${PN}-bcm43430 ${PN}-bcm4354 \ + ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \ + ${PN}-gplv2-license ${PN}-carl9170 \ + ${PN}-ar3k-license ${PN}-ar3k ${PN}-ath10k-license ${PN}-ath10k ${PN}-qca \ + \ + ${PN}-imx-sdma-license ${PN}-imx-sdma-imx6q ${PN}-imx-sdma-imx7d \ + \ + ${PN}-iwlwifi-license ${PN}-iwlwifi \ + ${PN}-iwlwifi-135-6 \ + ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \ + ${PN}-iwlwifi-3160-10 ${PN}-iwlwifi-3160-12 ${PN}-iwlwifi-3160-13 \ + ${PN}-iwlwifi-3160-16 ${PN}-iwlwifi-3160-17 \ + ${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 \ + ${PN}-iwlwifi-7265 \ + ${PN}-iwlwifi-7265d ${PN}-iwlwifi-8000c ${PN}-iwlwifi-8265 \ + ${PN}-iwlwifi-9000 \ + ${PN}-iwlwifi-misc \ + ${PN}-ibt-license ${PN}-ibt ${PN}-ibt-misc \ + ${PN}-ibt-11-5 ${PN}-ibt-12-16 ${PN}-ibt-hw-37-7 ${PN}-ibt-hw-37-8 \ + ${PN}-ibt-17 \ + ${PN}-i915-license ${PN}-i915 \ + ${PN}-adsp-sst-license ${PN}-adsp-sst \ + ${PN}-bnx2-mips \ + ${PN}-netronome-license ${PN}-netronome \ + ${PN}-qat ${PN}-qat-license \ + ${PN}-qcom-license \ + ${PN}-qcom-venus-1.8 ${PN}-qcom-venus-4.2 \ + ${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a530 \ + ${PN}-whence-license \ + ${PN}-license \ + " + +# For atheros +LICENSE_${PN}-ar9170 = "Firmware-atheros_firmware" +LICENSE_${PN}-ath6k = "Firmware-atheros_firmware" +LICENSE_${PN}-ath9k = "Firmware-atheros_firmware" +LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware" + +FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware" +FILES_${PN}-ar9170 = " \ + ${nonarch_base_libdir}/firmware/ar9170*.fw \ +" +FILES_${PN}-ath6k = " \ + ${nonarch_base_libdir}/firmware/ath6k \ +" +FILES_${PN}-ath9k = " \ + ${nonarch_base_libdir}/firmware/ar9271.fw \ + ${nonarch_base_libdir}/firmware/ar7010*.fw \ + ${nonarch_base_libdir}/firmware/htc_9271.fw \ + ${nonarch_base_libdir}/firmware/htc_7010.fw \ + ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \ + ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \ +" + +RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license" +RDEPENDS_${PN}-ath6k += "${PN}-atheros-license" +RDEPENDS_${PN}-ath9k += "${PN}-atheros-license" + +# For carl9170 +LICENSE_${PN}-carl9170 = "Firmware-GPLv2" +LICENSE_${PN}-gplv2-license = "Firmware-GPLv2" + +FILES_${PN}-gplv2-license = "${nonarch_base_libdir}/firmware/GPL-2" +FILES_${PN}-carl9170 = " \ + ${nonarch_base_libdir}/firmware/carl9170*.fw \ +" + +RDEPENDS_${PN}-carl9170 += "${PN}-gplv2-license" + +# For QualCommAthos +LICENSE_${PN}-ar3k = "Firmware-qualcommAthos_ar3k" +LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k" +LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k" +LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k" +LICENSE_${PN}-qca = "Firmware-qualcommAthos_ath10k" + +FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k" +FILES_${PN}-ar3k = " \ + ${nonarch_base_libdir}/firmware/ar3k \ +" + +FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k" +FILES_${PN}-ath10k = " \ + ${nonarch_base_libdir}/firmware/ath10k \ +" + +FILES_${PN}-qca = " \ + ${nonarch_base_libdir}/firmware/qca \ +" + +RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license" +RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license" +RDEPENDS_${PN}-qca += "${PN}-ath10k-license" + +# For ralink +LICENSE_${PN}-ralink = "Firmware-ralink-firmware" +LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware" + +FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt" +FILES_${PN}-ralink = " \ + ${nonarch_base_libdir}/firmware/rt*.bin \ +" + +RDEPENDS_${PN}-ralink += "${PN}-ralink-license" + +# For mediatek MT7601U +LICENSE_${PN}-mt7601u = "Firmware-ralink_a_mediatek_company_firmware" +LICENSE_${PN}-mt7601u-license = "Firmware-ralink_a_mediatek_company_firmware" + +FILES_${PN}-mt7601u-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink_a_mediatek_company_firmware" +FILES_${PN}-mt7601u = " \ + ${nonarch_base_libdir}/firmware/mt7601u.bin \ +" + +RDEPENDS_${PN}-mt7601u += "${PN}-mt7601u-license" + +# For radeon +LICENSE_${PN}-radeon = "Firmware-radeon" +LICENSE_${PN}-radeon-license = "Firmware-radeon" + +FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon" +FILES_${PN}-radeon = " \ + ${nonarch_base_libdir}/firmware/radeon \ +" + +RDEPENDS_${PN}-radeon += "${PN}-radeon-license" + +# For marvell +LICENSE_${PN}-pcie8897 = "Firmware-Marvell" +LICENSE_${PN}-pcie8997 = "Firmware-Marvell" +LICENSE_${PN}-sd8686 = "Firmware-Marvell" +LICENSE_${PN}-sd8688 = "Firmware-Marvell" +LICENSE_${PN}-sd8787 = "Firmware-Marvell" +LICENSE_${PN}-sd8797 = "Firmware-Marvell" +LICENSE_${PN}-sd8801 = "Firmware-Marvell" +LICENSE_${PN}-sd8887 = "Firmware-Marvell" +LICENSE_${PN}-sd8897 = "Firmware-Marvell" +LICENSE_${PN}-marvell-license = "Firmware-Marvell" + +FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell" +FILES_${PN}-pcie8897 = " \ + ${nonarch_base_libdir}/firmware/mrvl/pcie8897_uapsta.bin \ +" +FILES_${PN}-pcie8997 = " \ + ${nonarch_base_libdir}/firmware/mrvl/pcie8997_wlan_v4.bin \ + ${nonarch_base_libdir}/firmware/mrvl/pcieuart8997_combo_v4.bin \ + ${nonarch_base_libdir}/firmware/mrvl/pcieusb8997_combo_v4.bin \ +" +FILES_${PN}-sd8686 = " \ + ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \ + ${nonarch_base_libdir}/firmware/sd8686* \ +" +FILES_${PN}-sd8688 = " \ + ${nonarch_base_libdir}/firmware/libertas/sd8688* \ + ${nonarch_base_libdir}/firmware/mrvl/sd8688* \ +" +FILES_${PN}-sd8787 = " \ + ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \ +" +FILES_${PN}-sd8797 = " \ + ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \ +" +FILES_${PN}-sd8801 = " \ + ${nonarch_base_libdir}/firmware/mrvl/sd8801_uapsta.bin \ +" +FILES_${PN}-sd8887 = " \ + ${nonarch_base_libdir}/firmware/mrvl/sd8887_uapsta.bin \ +" +FILES_${PN}-sd8897 = " \ + ${nonarch_base_libdir}/firmware/mrvl/sd8897_uapsta.bin \ +" + +RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8688 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8801 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8887 += "${PN}-marvell-license" +RDEPENDS_${PN}-sd8897 += "${PN}-marvell-license" + +# For netronome +LICENSE_${PN}-netronome = "Firmware-netronome" + +FILES_${PN}-netronome-license = " \ + ${nonarch_base_libdir}/firmware/LICENCE.Netronome \ +" +FILES_${PN}-netronome = " \ + ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0081*.nffw \ + ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \ + ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \ + ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \ +" + +RDEPENDS_${PN}-netronome += "${PN}-netronome-license" + +# For rtl +LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl8723 = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware" +LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware" + +FILES_${PN}-rtl-license = " \ + ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \ +" +FILES_${PN}-rtl8188 = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \ +" +FILES_${PN}-rtl8192cu = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \ +" +FILES_${PN}-rtl8192ce = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \ +" +FILES_${PN}-rtl8192su = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \ +" +FILES_${PN}-rtl8723 = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \ +" +FILES_${PN}-rtl8821 = " \ + ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \ +" + +RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license" +RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license" +RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license" +RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license" +RDEPENDS_${PN}-rtl8723 += "${PN}-rtl-license" +RDEPENDS_${PN}-rtl8821 += "${PN}-rtl-license" + +# For ti-connectivity +LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity" +LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity" +LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity" + +FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity" +FILES_${PN}-wl12xx = " \ + ${nonarch_base_libdir}/firmware/wl12* \ + ${nonarch_base_libdir}/firmware/TI* \ + ${nonarch_base_libdir}/firmware/ti-connectivity \ +" +FILES_${PN}-wl18xx = " \ + ${nonarch_base_libdir}/firmware/wl18* \ + ${nonarch_base_libdir}/firmware/TI* \ + ${nonarch_base_libdir}/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" +LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656" + +FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656" +FILES_${PN}-vt6656 = " \ + ${nonarch_base_libdir}/firmware/vntwusb.fw \ +" + +RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license" + +# For broadcom + +LICENSE_${PN}-bcm4329 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm4330 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm43340 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm43362 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm4339 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm43430 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx" +LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx" + +FILES_${PN}-broadcom-license = " \ + ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \ +" +FILES_${PN}-bcm4329 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \ +" +FILES_${PN}-bcm4330 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \ +" +FILES_${PN}-bcm4334 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \ +" +FILES_${PN}-bcm43340 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \ +" +FILES_${PN}-bcm43362 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.bin \ +" +FILES_${PN}-bcm4339 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \ +" +FILES_${PN}-bcm43430 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \ +" +FILES_${PN}-bcm4354 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \ +" + +RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm43340 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm43362 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm4339 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm43430 += "${PN}-broadcom-license" +RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license" + +# For Broadcom bnx2-mips +# +# which is a separate case to the other Broadcom firmwares since its +# license is contained in the shared WHENCE file. + +LICENSE_${PN}-bnx2-mips = "WHENCE" +LICENSE_${PN}-whence-license = "WHENCE" + +FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw" +FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE" + +RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license" + +# For imx-sdma +LICENSE_${PN}-imx-sdma-imx6q = "Firmware-imx-sdma_firmware" +LICENSE_${PN}-imx-sdma-imx7d = "Firmware-imx-sdma_firmware" +LICENSE_${PN}-imx-sdma-license = "Firmware-imx-sdma_firmware" + +FILES_${PN}-imx-sdma-imx6q = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx6q.bin" + +RPROVIDES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q" +RREPLACES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q" +RCONFLICTS_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q" + +FILES_${PN}-imx-sdma-imx7d = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx7d.bin" + +FILES_${PN}-imx-sdma-license = "${nonarch_base_libdir}/firmware/LICENSE.sdma_firmware" + +RDEPENDS_${PN}-imx-sdma-imx6q += "${PN}-imx-sdma-license" +RDEPENDS_${PN}-imx-sdma-imx7d += "${PN}-imx-sdma-license" + +# For iwlwifi +LICENSE_${PN}-iwlwifi = "Firmware-iwlwifi_firmware" +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-3160-10 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-3160-12 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-3160-13 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-3160-16 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-3160-17 = "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-6000g2b-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 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-7265 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-7265d = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-8000c = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-8265 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-9000 = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-misc = "Firmware-iwlwifi_firmware" +LICENSE_${PN}-iwlwifi-license = "Firmware-iwlwifi_firmware" + + +FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware" +FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode" +FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode" +FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode" +FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode" +FILES_${PN}-iwlwifi-3160-10 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-10.ucode" +FILES_${PN}-iwlwifi-3160-12 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-12.ucode" +FILES_${PN}-iwlwifi-3160-13 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-13.ucode" +FILES_${PN}-iwlwifi-3160-16 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-16.ucode" +FILES_${PN}-iwlwifi-3160-17 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-17.ucode" +FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode" +FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode" +FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode" +FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode" +FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode" +FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode" +FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode" +FILES_${PN}-iwlwifi-7260 = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode" +FILES_${PN}-iwlwifi-7265 = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode" +FILES_${PN}-iwlwifi-7265d = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode" +FILES_${PN}-iwlwifi-8000c = "${nonarch_base_libdir}/firmware/iwlwifi-8000C-*.ucode" +FILES_${PN}-iwlwifi-8265 = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode" +FILES_${PN}-iwlwifi-9000 = "${nonarch_base_libdir}/firmware/iwlwifi-9000-*.ucode" +FILES_${PN}-iwlwifi-misc = "${nonarch_base_libdir}/firmware/iwlwifi-*.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-3160-10 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-3160-12 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-3160-13 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-3160-16 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-3160-17 = "${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-6000g2b-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 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-7265d = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-8000c = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-8265 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-9000 = "${PN}-iwlwifi-license" +RDEPENDS_${PN}-iwlwifi-misc = "${PN}-iwlwifi-license" + +# -iwlwifi-misc is a "catch all" package that includes all the iwlwifi +# firmwares that are not already included in other -iwlwifi- packages. +# -iwlwifi is a virtual package that depends upon all iwlwifi packages. +# These are distinct in order to allow the -misc firmwares to be installed +# without pulling in every other iwlwifi package. +ALLOW_EMPTY_${PN}-iwlwifi = "1" +ALLOW_EMPTY_${PN}-iwlwifi-misc = "1" + +# Handle package updating for the newly merged iwlwifi groupings +RPROVIDES_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9" +RREPLACES_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9" +RCONFLICTS_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9" + +RPROVIDES_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9" +RREPLACES_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9" +RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9" + +# For ibt +LICENSE_${PN}-ibt-license = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-hw-37-7 = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-hw-37-8 = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-11-5 = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-12-16 = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-17 = "Firmware-ibt_firmware" +LICENSE_${PN}-ibt-misc = "Firmware-ibt_firmware" + +FILES_${PN}-ibt-license = "${nonarch_base_libdir}/firmware/LICENCE.ibt_firmware" +FILES_${PN}-ibt-hw-37-7 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.7*.bseq" +FILES_${PN}-ibt-hw-37-8 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.8*.bseq" +FILES_${PN}-ibt-11-5 = "${nonarch_base_libdir}/firmware/intel/ibt-11-5.sfi /lib/firmware/intel/ibt-11-5.ddc" +FILES_${PN}-ibt-12-16 = "${nonarch_base_libdir}/firmware/intel/ibt-12-16.sfi /lib/firmware/intel/ibt-12-16.ddc" +FILES_${PN}-ibt-17 = "${nonarch_base_libdir}/firmware/intel/ibt-17-*.sfi /lib/firmware/intel/ibt-17-*.ddc" +FILES_${PN}-ibt-misc = "${nonarch_base_libdir}/firmware/ibt-*" + +RDEPENDS_${PN}-ibt-hw-37-7 = "${PN}-ibt-license" +RDEPENDS_${PN}-ibt-hw-37.8 = "${PN}-ibt-license" +RDEPENDS_${PN}-ibt-11-5 = "${PN}-ibt-license" +RDEPENDS_${PN}-ibt-12-16 = "${PN}-ibt-license" +RDEPENDS_${PN}-ibt-17 = "${PN}-ibt-license" +RDEPENDS_${PN}-ibt-misc = "${PN}-ibt-license" + +ALLOW_EMPTY_${PN}-ibt= "1" +ALLOW_EMPTY_${PN}-ibt-misc = "1" + +LICENSE_${PN}-i915 = "Firmware-i915" +LICENSE_${PN}-i915-license = "Firmware-i915" +FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915" +FILES_${PN}-i915 = "${nonarch_base_libdir}/firmware/i915" +RDEPENDS_${PN}-i915 = "${PN}-i915-license" + +FILES_${PN}-adsp-sst-license = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst" +LICENSE_${PN}-adsp-sst = "Firmware-adsp_sst" +LICENSE_${PN}-adsp-sst-license = "Firmware-adsp_sst" +FILES_${PN}-adsp-sst = "${nonarch_base_libdir}/firmware/intel/dsp_fw*" +RDEPENDS_${PN}-adsp-sst = "${PN}-adsp-sst-license" + +# For QAT +LICENSE_${PN}-qat = "Firmware-qat" +LICENSE_${PN}-qat-license = "Firmware-qat" +FILES_${PN}-qat-license = "${nonarch_base_libdir}/firmware/LICENCE.qat_firmware" +FILES_${PN}-qat = "${nonarch_base_libdir}/firmware/qat*.bin" +RDEPENDS_${PN}-qat = "${PN}-qat-license" + +# For QCOM VPU/GPU +LICENSE_${PN}-qcom-license = "Firmware-qcom" +FILES_${PN}-qcom-license = "${nonarch_base_libdir}/firmware/LICENSE.qcom ${nonarch_base_libdir}/firmware/qcom/NOTICE.txt" +FILES_${PN}-qcom-venus-1.8 = "${nonarch_base_libdir}/firmware/qcom/venus-1.8/*" +FILES_${PN}-qcom-venus-4.2 = "${nonarch_base_libdir}/firmware/qcom/venus-4.2/*" +FILES_${PN}-qcom-adreno-a3xx = "${nonarch_base_libdir}/firmware/qcom/a300_*.fw ${nonarch_base_libdir}/firmware/a300_*.fw" +FILES_${PN}-qcom-adreno-a530 = "${nonarch_base_libdir}/firmware/qcom/a530*.*" +RDEPENDS_${PN}-qcom-venus-1.8 = "${PN}-qcom-license" +RDEPENDS_${PN}-qcom-venus-4.2 = "${PN}-qcom-license" +RDEPENDS_${PN}-qcom-adreno-a3xx = "${PN}-qcom-license" +RDEPENDS_${PN}-qcom-adreno-a530 = "${PN}-qcom-license" + +# For other firmwares +# Maybe split out to separate packages when needed. +LICENSE_${PN} = "\ + Firmware-Abilis \ + & Firmware-agere \ + & Firmware-amdgpu \ + & Firmware-amd-ucode \ + & Firmware-atmel \ + & Firmware-ca0132 \ + & Firmware-cavium \ + & Firmware-chelsio_firmware \ + & Firmware-cw1200 \ + & Firmware-dib0700 \ + & Firmware-e100 \ + & Firmware-ene_firmware \ + & Firmware-fw_sst_0f28 \ + & Firmware-go7007 \ + & Firmware-hfi1_firmware \ + & Firmware-i2400m \ + & Firmware-ibt_firmware \ + & Firmware-it913x \ + & Firmware-IntcSST2 \ + & Firmware-kaweth \ + & Firmware-moxa \ + & Firmware-myri10ge_firmware \ + & Firmware-nvidia \ + & Firmware-OLPC \ + & Firmware-ath9k-htc \ + & Firmware-phanfw \ + & Firmware-qat \ + & Firmware-qcom \ + & Firmware-qla1280 \ + & Firmware-qla2xxx \ + & Firmware-r8a779x_usb3 \ + & Firmware-radeon \ + & Firmware-ralink_a_mediatek_company_firmware \ + & Firmware-ralink-firmware \ + & Firmware-imx-sdma_firmware \ + & Firmware-siano \ + & Firmware-tda7706-firmware \ + & Firmware-ti-connectivity \ + & Firmware-ti-keystone \ + & Firmware-ueagle-atm4-firmware \ + & Firmware-wl1251 \ + & Firmware-xc4000 \ + & Firmware-xc5000 \ + & Firmware-xc5000c \ + & WHENCE \ +" + +FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*" +FILES_${PN} += "${nonarch_base_libdir}/firmware/*" +RDEPENDS_${PN} += "${PN}-license" +RDEPENDS_${PN} += "${PN}-whence-license" + +# Make linux-firmware depend on all of the split-out packages. +# Make linux-firmware-iwlwifi depend on all of the split-out iwlwifi packages. +# Make linux-firmware-ibt depend on all of the split-out ibt packages. +python populate_packages_prepend () { + firmware_pkgs = oe.utils.packages_filter_out_system(d) + d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs)) + + iwlwifi_pkgs = filter(lambda x: x.find('-iwlwifi-') != -1, firmware_pkgs) + d.appendVar('RDEPENDS_linux-firmware-iwlwifi', ' ' + ' '.join(iwlwifi_pkgs)) + + ibt_pkgs = filter(lambda x: x.find('-ibt-') != -1, firmware_pkgs) + d.appendVar('RDEPENDS_linux-firmware-ibt', ' ' + ' '.join(ibt_pkgs)) +} + +# Firmware files are generally not ran on the CPU, so they can be +# allarch despite being architecture specific +INSANE_SKIP = "arch" diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc new file mode 100644 index 000000000..9903c06c2 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc @@ -0,0 +1,91 @@ +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 +# do_configure[depends] += "virtual/kernel:do_shared_workdir" +# 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").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 pkgconfig multilib_header + +KORG_ARCHIVE_COMPRESSION ?= "xz" + +SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}" +UPSTREAM_CHECK_URI = "https://www.kernel.org/" + +S = "${WORKDIR}/linux-${PV}" + +EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" + +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 +} + +do_install_append_aarch64 () { + do_install_armmultilib +} + +do_install_append_arm () { + do_install_armmultilib +} + +do_install_armmultilib () { + oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h asm/bpf_perf_event.h + oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h asm/statfs.h asm/swab.h asm/types.h asm/unistd.h +} + +BBCLASSEXTEND = "nativesdk" + +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS += "unifdef-native" diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch new file mode 100644 index 000000000..68b244698 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch @@ -0,0 +1,31 @@ +From 897736166fd709906a5fdf16eb23f8fddff770b5 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@windriver.com> +Date: Thu, 1 Mar 2018 18:31:01 -0500 +Subject: [PATCH] if_ether: move muslc ethhdr protection to uapi file + +Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +Upstream-Status: Pending +--- + include/uapi/linux/if_ether.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h +index 153c9c2..7b69b73 100644 +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -149,6 +149,12 @@ + * This is an Ethernet frame header. + */ + ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + /* allow libcs like musl to deactivate this, glibc does not implement this. */ + #ifndef __UAPI_DEF_ETHHDR + #define __UAPI_DEF_ETHHDR 1 +-- +2.7.4 + diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch new file mode 100644 index 000000000..064a39193 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch @@ -0,0 +1,90 @@ +From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001 +From: rofl0r <retnyg@gmx.net> +Date: Wed, 22 Jan 2014 00:48:28 +0100 +Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h + +namely redefinition of some structs provided by netinet/in.h. +--- +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Submitted + + include/uapi/linux/libc-compat.h | 25 ++++++++----------------- + 1 file changed, 8 insertions(+), 17 deletions(-) + +Index: linux-4.15/include/uapi/linux/libc-compat.h +=================================================================== +--- linux-4.15.orig/include/uapi/linux/libc-compat.h 2018-02-05 17:37:44.724314379 -0500 ++++ linux-4.15/include/uapi/linux/libc-compat.h 2018-02-05 17:38:02.148913820 -0500 +@@ -49,13 +49,12 @@ + #ifndef _UAPI_LIBC_COMPAT_H + #define _UAPI_LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++#ifndef __KERNEL__ /* we're used from userspace */ + +-/* Coordinate with glibc net/if.h header. */ +-#if defined(_NET_IF_H) && defined(__USE_MISC) ++/* Coordinate with libc net/if.h header. */ ++#if defined(_NET_IF_H) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + + #define __UAPI_DEF_IF_IFCONF 0 +@@ -99,15 +98,7 @@ + #define __UAPI_DEF_IN_CLASS 0 + + #define __UAPI_DEF_IN6_ADDR 0 +-/* The exception is the in6_addr macros which must be defined +- * if the glibc code didn't define them. This guard matches +- * the guard in glibc/inet/netinet/in.h which defines the +- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 +-#else +-#define __UAPI_DEF_IN6_ADDR_ALT 1 +-#endif + #define __UAPI_DEF_SOCKADDR_IN6 0 + #define __UAPI_DEF_IPV6_MREQ 0 + #define __UAPI_DEF_IPPROTO_V6 0 +@@ -115,10 +106,10 @@ + #define __UAPI_DEF_IN6_PKTINFO 0 + #define __UAPI_DEF_IP6_MTUINFO 0 + +-#else ++#else /* defined(_NETINET_IN_H) */ + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -128,7 +119,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -170,7 +161,7 @@ + * or we are being included in the kernel, then define everything + * that we need. Check for previous __UAPI_* definitions to give + * unsupported C libraries a way to opt out of any kernel definition. */ +-#else /* !defined(__GLIBC__) */ ++#else /* __KERNEL__ */ + + /* Definitions for if.h */ + #ifndef __UAPI_DEF_IF_IFCONF +@@ -262,6 +253,6 @@ + #define __UAPI_DEF_XATTR 1 + #endif + +-#endif /* __GLIBC__ */ ++#endif /* __KERNEL__ */ + + #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch new file mode 100644 index 000000000..bde2132eb --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch @@ -0,0 +1,46 @@ +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v2,2/3] uapi glibc compat: fix build if libc defines IFF_ECHO +From: Hauke Mehrtens <hauke@hauke-m.de> +X-Patchwork-Id: 9686293 +Message-Id: <20170418210036.26039-3-hauke@hauke-m.de> +To: davem@davemloft.net, netdev@vger.kernel.org +Cc: linux-kernel@vger.kernel.org, jarod@redhat.com, jogo@openwrt.org, + david.heidelberger@ixit.cz, maillist-linux@barfooze.de, + mikko.rapeli@iki.fi, dwmw2@infradead.org, Hauke Mehrtens <hauke@hauke-m.de> +Date: Tue, 18 Apr 2017 23:00:35 +0200 + +musl 1.1.15 defines IFF_ECHO and the other net_device_flags options. +When a user application includes linux/if.h and net/if.h the compile +will fail. + +Activate __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO only when +it is needed. This should also make this work in case glibc will add +these defines. + +Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi> +Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> +--- +Upstream-Status: Submitted [https://patchwork.kernel.org/patch/9686293/] +Signed-off-by: André Draszik <adraszik@tycoint.com> +Acked-by: Stephane Ayotte <sayotte@tycoint.com> + include/uapi/linux/libc-compat.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h +index 43a81136ea6e..ce2fa8a4ced6 100644 +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -64,9 +64,11 @@ + /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ ++#ifndef IFF_ECHO + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 + #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ ++#endif /* IFF_ECHO */ + + #else /* _NET_IF_H */ + diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch new file mode 100644 index 000000000..fb7e1de17 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch @@ -0,0 +1,30 @@ +From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001 +From: rofl0r <retnyg@gmx.net> +Date: Wed, 22 Jan 2014 00:57:48 +0100 +Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr + +--- +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Submitted + + include/uapi/linux/if_ether.h | 4 +++- + include/uapi/linux/libc-compat.h | 6 ++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +Index: linux-4.15/include/uapi/linux/libc-compat.h +=================================================================== +--- linux-4.15.orig/include/uapi/linux/libc-compat.h 2018-02-05 17:40:42.338370731 -0500 ++++ linux-4.15/include/uapi/linux/libc-compat.h 2018-02-05 17:40:42.334370603 -0500 +@@ -51,6 +51,12 @@ + + #ifndef __KERNEL__ /* we're used from userspace */ + ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + /* Coordinate with libc net/if.h header. */ + #if defined(_NET_IF_H) + diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch new file mode 100644 index 000000000..b5c4e1750 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch @@ -0,0 +1,29 @@ +From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001 +From: rofl0r <retnyg@gmx.net> +Date: Mon, 20 Jan 2014 21:31:34 +0100 +Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h + +the declaration of struct sysinfo clashes with userspace. +it's not quite clear why that header was included from kernel.h, +as none of its functionality is needed. +--- +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Submitted + + include/uapi/linux/kernel.h | 2 ++ + 1 file changed, 2 insertions(+) + +Index: linux-4.8-rc4/include/uapi/linux/kernel.h +=================================================================== +--- linux-4.8-rc4.orig/include/uapi/linux/kernel.h ++++ linux-4.8-rc4/include/uapi/linux/kernel.h +@@ -1,7 +1,9 @@ + #ifndef _UAPI_LINUX_KERNEL_H + #define _UAPI_LINUX_KERNEL_H + ++#ifdef __GLIBC__ + #include <linux/sysinfo.h> ++#endif + + /* + * 'kernel.h' contains some often-used function prototypes etc diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb new file mode 100644 index 000000000..a7db4c9c0 --- /dev/null +++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb @@ -0,0 +1,13 @@ +require linux-libc-headers.inc + +SRC_URI_append_libc-musl = "\ + file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \ + file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \ + file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \ + file://0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch \ + file://0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch \ + " + + +SRC_URI[md5sum] = "8186ce63c489199b58b6a58ad2a24a94" +SRC_URI[sha256sum] = "cd44df4b23a3e0edc14be63df95d768b9600b31c35be05fb89f93226907fc8c6" diff --git a/poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/poky/meta/recipes-kernel/linux/kernel-devsrc.bb new file mode 100644 index 000000000..8bbfa23e4 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -0,0 +1,86 @@ +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" + +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" + +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 d -name '.kernel-meta' -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 + # make clean generates an absolute path symlink called "source" + # in $kerneldir points to $kerneldir, which doesn't make any + # sense, so remove it. + if [ -L $kerneldir/source ]; then + bbnote "Removing $kerneldir/source symlink" + rm -f $kerneldir/source + fi + + # 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 + + # Remove fixdep/objtool as they won't be target binaries + for i in fixdep objtool; do + if [ -e $kerneldir/tools/objtool/$i ]; then + rm -rf $kerneldir/tools/objtool/$i + fi + done + + 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/poky/meta/recipes-kernel/linux/linux-dtb.inc b/poky/meta/recipes-kernel/linux/linux-dtb.inc new file mode 100644 index 000000000..f1912775c --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-dtb.inc @@ -0,0 +1,3 @@ +python() { + bb.warn("You are using the linux-dtb.inc which is deprecated. You can safely remove it as the Device Tree support is automatically enabled when KERNEL_DEVICETREE is set.") +} diff --git a/poky/meta/recipes-kernel/linux/linux-dummy.bb b/poky/meta/recipes-kernel/linux/linux-dummy.bb new file mode 100644 index 000000000..e1c7f7676 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-dummy.bb @@ -0,0 +1,60 @@ +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 kernel-vmlinux" +FILES_kernel-modules = "" +ALLOW_EMPTY_kernel-modules = "1" +DESCRIPTION_kernel-modules = "Kernel modules meta package" +FILES_kernel-vmlinux = "" +ALLOW_EMPTY_kernel-vmlinux = "1" +DESCRIPTION_kernel-vmlinux = "Kernel vmlinux meta package" + + +INHIBIT_DEFAULT_DEPS = "1" + +#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/poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL new file mode 100644 index 000000000..d511905c1 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb b/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb new file mode 100644 index 000000000..4201faf67 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb @@ -0,0 +1,50 @@ +# 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 + +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.16-rc+" +LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}" +PV = "${LINUX_VERSION}+git${SRCPV}" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +# Functionality flags +KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc" +KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" +KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc" +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)}" + +KERNEL_VERSION_SANITY_SKIP = "1" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb new file mode 100644 index 000000000..5edc0fa40 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb @@ -0,0 +1,38 @@ +KBRANCH ?= "standard/preempt-rt/base" + +require recipes-kernel/linux/linux-yocto.inc + +# Skip processing of this recipe if it is not explicitly specified as the +# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying +# to build multiple virtual/kernel providers, e.g. as dependency of +# core-image-rt-sdk, core-image-rt. +python () { + if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt": + raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it") +} + +SRCREV_machine ?= "705d03507a0c10dcbf9cad3ff70f5d60b70f2d99" +SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" + +LINUX_VERSION ?= "4.12.24" + +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)" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +# Functionality flags +KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc" +KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" +KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc" +KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc" +KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb new file mode 100644 index 000000000..81306a984 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb @@ -0,0 +1,41 @@ +KBRANCH ?= "v4.14/standard/preempt-rt/base" + +require recipes-kernel/linux/linux-yocto.inc + +# Skip processing of this recipe if it is not explicitly specified as the +# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying +# to build multiple virtual/kernel providers, e.g. as dependency of +# core-image-rt-sdk, core-image-rt. +python () { + if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt": + raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it") +} + +SRCREV_machine ?= "7272e9132fdaaf0dd78bc94e9f297aaf73452982" +SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}" + +LINUX_VERSION ?= "4.14.30" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +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)" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +# Functionality flags +KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc" +KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" +KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc" +KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc" +KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb new file mode 100644 index 000000000..c5d3ee03f --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb @@ -0,0 +1,41 @@ +KBRANCH ?= "v4.15/standard/preempt-rt/base" + +require recipes-kernel/linux/linux-yocto.inc + +# Skip processing of this recipe if it is not explicitly specified as the +# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying +# to build multiple virtual/kernel providers, e.g. as dependency of +# core-image-rt-sdk, core-image-rt. +python () { + if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt": + raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it") +} + +SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}" + +LINUX_VERSION ?= "4.15.13" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +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)" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +# Functionality flags +KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc" +KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" +KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc" +KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc" +KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb new file mode 100644 index 000000000..31307a638 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb @@ -0,0 +1,25 @@ +KBRANCH ?= "standard/tiny/common-pc" +LINUX_KERNEL_TYPE = "tiny" +KCONFIG_MODE = "--allnoconfig" + +require recipes-kernel/linux/linux-yocto.inc + +LINUX_VERSION ?= "4.12.24" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +SRCREV_machine ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" + +COMPATIBLE_MACHINE = "qemux86|qemux86-64" + +# Functionality flags +KERNEL_FEATURES = "" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb new file mode 100644 index 000000000..34bee0949 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb @@ -0,0 +1,28 @@ +KBRANCH ?= "v4.14/standard/tiny/common-pc" +LINUX_KERNEL_TYPE = "tiny" +KCONFIG_MODE = "--allnoconfig" + +require recipes-kernel/linux/linux-yocto.inc + +LINUX_VERSION ?= "4.14.30" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +SRCREV_machine ?= "ad31896630f8bf6a459164263adc0a8faf984d9e" +SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}" + +COMPATIBLE_MACHINE = "qemux86|qemux86-64" + +# Functionality flags +KERNEL_FEATURES = "" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb new file mode 100644 index 000000000..05b9ca38b --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb @@ -0,0 +1,25 @@ +KBRANCH ?= "v4.15/standard/tiny/common-pc" +LINUX_KERNEL_TYPE = "tiny" +KCONFIG_MODE = "--allnoconfig" + +require recipes-kernel/linux/linux-yocto.inc + +LINUX_VERSION ?= "4.15.13" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}" + +COMPATIBLE_MACHINE = "qemux86|qemux86-64" + +# Functionality flags +KERNEL_FEATURES = "" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" diff --git a/poky/meta/recipes-kernel/linux/linux-yocto.inc b/poky/meta/recipes-kernel/linux/linux-yocto.inc new file mode 100644 index 000000000..3bb872a32 --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto.inc @@ -0,0 +1,69 @@ +SUMMARY = "Linux kernel" +SECTION = "kernel" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" + +INC_PR = "r4" + +# 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("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"): + d.delVar("BB_DONT_CACHE") + raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN"))) +} + +DEPENDS += "xz-native bc-native" +DEPENDS_append_aarch64 = " libgcc" +KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" +KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" + +DEPENDS_append_nios2 = " libgcc" +KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}" +KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}" + +KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc" + +# 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" + +# The distro or local.conf should set this, but if nobody cares... +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" +KMETA_AUDIT ?= "yes" + +LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}" + +# Pick up shared functions +inherit kernel +inherit kernel-yocto + +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_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile +addtask validate_branches before do_patch after do_kernel_checkout +addtask kernel_configcheck after do_configure before do_compile diff --git a/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb new file mode 100644 index 000000000..8d560127f --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb @@ -0,0 +1,46 @@ +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 ?= "45824c60ca37f414a5ac5783e970338db9a5a2af" +SRCREV_machine_qemuarm64 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_machine_qemumips ?= "66f741b0b3d093e6b6df0f44120913ef3a259e23" +SRCREV_machine_qemuppc ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_machine_qemux86 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_machine_qemux86-64 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_machine_qemumips64 ?= "c5d838c9e26bd657b49dfe28b115e5bc4b580850" +SRCREV_machine ?= "f9d67777b07ac97966186c1b56db78afe2a16f92" +SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" + +DEPENDS += "openssl-native util-linux-native" + +LINUX_VERSION ?= "4.12.24" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +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_qemuall=" cfg/virtio.scc" +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/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb new file mode 100644 index 000000000..16142f8ce --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb @@ -0,0 +1,47 @@ +KBRANCH ?= "v4.14/standard/base" + +require recipes-kernel/linux/linux-yocto.inc + +# board specific branches +KBRANCH_qemuarm ?= "v4.14/standard/arm-versatile-926ejs" +KBRANCH_qemuarm64 ?= "v4.14/standard/qemuarm64" +KBRANCH_qemumips ?= "v4.14/standard/mti-malta32" +KBRANCH_qemuppc ?= "v4.14/standard/qemuppc" +KBRANCH_qemux86 ?= "v4.14/standard/base" +KBRANCH_qemux86-64 ?= "v4.14/standard/base" +KBRANCH_qemumips64 ?= "v4.14/standard/mti-malta64" + +SRCREV_machine_qemuarm ?= "d6268fc3460d3904fd49087f7a822efbaab9bfe8" +SRCREV_machine_qemuarm64 ?= "c94189843b8ad62cafe9a307e7f7d60741690505" +SRCREV_machine_qemumips ?= "4afd92347b2b35dc8e0006712f8fa00ac57f2a36" +SRCREV_machine_qemuppc ?= "e8af5c9b65c5187d148ecd11bd7979489460ca64" +SRCREV_machine_qemux86 ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c" +SRCREV_machine_qemux86-64 ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c" +SRCREV_machine_qemumips64 ?= "9863b327e770b42b8c18da3e0cfaf06e8f99ae97" +SRCREV_machine ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c" +SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}" + +LINUX_VERSION ?= "4.14.30" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +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_qemuall=" cfg/virtio.scc" +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/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb new file mode 100644 index 000000000..70bd7118b --- /dev/null +++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb @@ -0,0 +1,47 @@ +KBRANCH ?= "v4.15/standard/base" + +require recipes-kernel/linux/linux-yocto.inc + +# board specific branches +KBRANCH_qemuarm ?= "v4.15/standard/arm-versatile-926ejs" +KBRANCH_qemuarm64 ?= "v4.15/standard/qemuarm64" +KBRANCH_qemumips ?= "v4.15/standard/mti-malta32" +KBRANCH_qemuppc ?= "v4.15/standard/qemuppc" +KBRANCH_qemux86 ?= "v4.15/standard/base" +KBRANCH_qemux86-64 ?= "v4.15/standard/base" +KBRANCH_qemumips64 ?= "v4.15/standard/mti-malta64" + +SRCREV_machine_qemuarm ?= "4b6902b42f47593928117b2ff0900cd965cf6443" +SRCREV_machine_qemuarm64 ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_machine_qemumips ?= "19ba2d843750ff65d8fe590acdfc99aea6153945" +SRCREV_machine_qemuppc ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_machine_qemux86 ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_machine_qemux86-64 ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_machine_qemumips64 ?= "97000c3f4664643bac7828bbdc048f7ec216cc31" +SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506" +SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}" + +LINUX_VERSION ?= "4.15.13" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "2" + +KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb" + +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_qemuall=" cfg/virtio.scc" +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/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb b/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb new file mode 100644 index 000000000..a29402adb --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb @@ -0,0 +1,19 @@ +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" + +DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" + +inherit autotools pkgconfig + +SRC_URI = "http://www.efficios.com/files/babeltrace/babeltrace-${PV}.tar.bz2 \ +" + +EXTRA_OECONF = "--disable-debug-info" + +SRC_URI[md5sum] = "3e8cdafec3ac0346a389870e87bf1344" +SRC_URI[sha256sum] = "9643039923a0abc75a25b3d594cee0017423b57f10d2b625e96ed1e8d4891fc1" diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch b/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch new file mode 100644 index 000000000..76063607a --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch @@ -0,0 +1,43 @@ +From ab07574ef90fa510f293c37897d577066a88fe0d Mon Sep 17 00:00:00 2001 +From: Nathan Lynch <nathan_lynch@mentor.com> +Date: Tue, 25 Apr 2017 16:26:57 -0500 +Subject: [PATCH] BUILD_RUNTIME_BUG_ON vs gcc7 + +Avoid using LTTng's BUILD_RUNTIME_BUG_ON macro, as it appears to run +into a similar problem as Linux experienced with ilog2. + +See: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=474c90156c8dcc2fa815e6716cc9394d7930cb9c +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 + +Upstream-Status: Pending +Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> +--- + lib/align.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/align.h b/lib/align.h +index 5b91ae87410b..5e134cd485fe 100644 +--- a/lib/align.h ++++ b/lib/align.h +@@ -48,7 +48,7 @@ + */ + #define offset_align(align_drift, alignment) \ + ({ \ +- BUILD_RUNTIME_BUG_ON((alignment) == 0 \ ++ BUG_ON((alignment) == 0 \ + || ((alignment) & ((alignment) - 1))); \ + (((alignment) - (align_drift)) & ((alignment) - 1)); \ + }) +@@ -63,7 +63,7 @@ + */ + #define offset_align_floor(align_drift, alignment) \ + ({ \ +- BUILD_RUNTIME_BUG_ON((alignment) == 0 \ ++ BUG_ON((alignment) == 0 \ + || ((alignment) & ((alignment) - 1))); \ + (((align_drift) - (alignment)) & ((alignment) - 1)); \ + }) +-- +2.9.3 + diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch new file mode 100644 index 000000000..e41124227 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch @@ -0,0 +1,49 @@ +From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001 +From: Otavio Salvador <otavio@ossystems.com.br> +Date: Mon, 5 Sep 2016 17:08:56 +0000 +Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled +Organization: O.S. Systems Software LTDA. + +The lttng-modules are being pulled by the tools-profile image feature, +however, not every kernel has the CONFIG_TRACEPOINTS feature enabled. + +This change makes the build do not fail when CONFIG_TRACEPOINTS is not +available, allowing it to be kept being pulled by default. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> +--- + Makefile | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 8602649..75550cc 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,10 +8,7 @@ ifneq ($(KERNELRELEASE),) + # and defines the modules to be built. + + ifdef CONFIG_LOCALVERSION # Check if dot-config is included. +- ifeq ($(CONFIG_TRACEPOINTS),) +- $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) +- endif # CONFIG_TRACEPOINTS +- endif # ifdef CONFIG_LOCALVERSION ++ ifneq ($(CONFIG_TRACEPOINTS),) + + TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST))) + +@@ -94,6 +91,10 @@ ifneq ($(KERNELRELEASE),) + obj-$(CONFIG_LTTNG) += lib/ + obj-$(CONFIG_LTTNG) += tests/ + ++ else ++ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) ++ endif # CONFIG_TRACEPOINTS ++ endif # ifdef CONFIG_LOCALVERSION + else # KERNELRELEASE + + # This part of the Makefile is used when the 'make' command is runned in the +-- +2.1.4 + diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb b/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb new file mode 100644 index 000000000..370b78aae --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb @@ -0,0 +1,35 @@ +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=c4613d1f8a9587bd7b366191830364b3 \ + file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \ + file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad \ + " + +inherit module + +COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux' + +SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ + file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ + file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ +" + +SRC_URI[md5sum] = "4aaabaafd15d9455c83972e26ccfbca7" +SRC_URI[sha256sum] = "b8dbbbee45a673c381f51b99c555e36655c3c2c7a5477aab927591cc7f003a1f" + +export INSTALL_MOD_DIR="kernel/lttng-modules" + +EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" + +do_install_append() { + # Delete empty directories to avoid QA failures if no modules were built + find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \; +} + +python do_package_prepend() { + if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')): + bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN')) +} + diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest new file mode 100755 index 000000000..705030ee5 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh +# Without --ignore-exit, the tap harness causes any FAILs within a +# test plan to raise ERRORs; this is just noise. +makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" +make -k -t all >/dev/null 2>&1 +exec make -s $makeargs check 2>/dev/null diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch new file mode 100644 index 000000000..b1bb8e493 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch @@ -0,0 +1,16 @@ +Fix build for x32 + +Upstream-Status: Pending +Signed-off-by: Christopher Larson <chris_larson@mentor.com> + +--- lttng-tools-2.6.0/src/bin/lttng/utils.c~ 2015-01-26 18:17:15.000000000 +0100 ++++ lttng-tools-2.6.0/src/bin/lttng/utils.c 2015-07-30 19:45:25.632045712 +0200 +@@ -130,7 +130,7 @@ + #define HAS_FLS_U32 + #endif + +-#if defined(__x86_64) ++#if defined(__x86_64) && !defined(__ILP32__) + static inline + unsigned int fls_u64(uint64_t x) + { diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb b/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb new file mode 100644 index 000000000..93626dd4b --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb @@ -0,0 +1,123 @@ +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 libxml2 util-linux" +RDEPENDS_${PN} = "libgcc" +RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps" +# babelstats.pl wants getopt-long +RDEPENDS_${PN}-ptest += "perl-module-getopt-long" + +PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ + am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ + PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ +" +PACKAGECONFIG ??= "lttng-ust" +PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" +PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" +PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod" +PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" +PACKAGECONFIG_remove_libc-musl = "lttng-ust" +PACKAGECONFIG_remove_riscv64 = "lttng-ust" + +SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ + file://x32.patch \ + file://run-ptest \ + " + +SRC_URI[md5sum] = "051224eb991aee07f8721ff1877d0b96" +SRC_URI[sha256sum] = "77839eb6fc6c652125f08acfd9369701c2516eb05cc2084160e7efc7a3fb731c" + +inherit autotools ptest pkgconfig useradd python3-dir manpages + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "tracing" + +FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ + ${PYTHON_SITEPACKAGES_DIR}/*" +FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.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_install_ptest () { + for f in Makefile tests/Makefile tests/utils/utils.sh ; do + install -D "${B}/$f" "${D}${PTEST_PATH}/$f" + done + + for f in config/tap-driver.sh config/test-driver ; do + install -D "${S}/$f" "${D}${PTEST_PATH}/$f" + done + + # Prevent 'make check' from recursing into non-test subdirectories. + sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" + + # We don't need these + sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" + + # We shouldn't need to build anything in tests/utils + sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ + "${D}${PTEST_PATH}/tests/Makefile" + + # Copy the tests directory tree and the executables and + # Makefiles found within. + for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do + install -d "${D}${PTEST_PATH}/tests/$d" + find "${B}/tests/$d" -maxdepth 1 -executable -type f \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + + test -r "${B}/tests/$d/Makefile" && \ + install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" + done + + # We shouldn't need to build anything in tests/regression/tools + sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ + "${D}${PTEST_PATH}/tests/regression/Makefile" + + # Prevent attempts to update Makefiles during test runs, and + # silence "Making check in $SUBDIR" messages. + find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ + sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \ + -e '/echo "Making $$target in $$subdir"; \\/d' \ + -e 's/^srcdir = \(.*\)/srcdir = ./' \ + -e 's/^builddir = \(.*\)/builddir = ./' \ + -e 's/^all-am:.*/all-am:/' \ + {} + + + # These objects trigger [rpaths] QA checks; the test harness + # skips the associated tests if they're missing, so delete + # them. + objs="" + objs="$objs regression/ust/ust-dl/libbar.so" + objs="$objs regression/ust/ust-dl/libfoo.so" + for obj in $objs ; do + rm -f "${D}${PTEST_PATH}/tests/${obj}" + done + + find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ + touch -r "${B}/Makefile" {} + + + # Substitute links to installed binaries. + for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do + exedir="${D}${PTEST_PATH}/src/bin/${prog}" + install -d "$exedir" + case "$prog" in + lttng-consumerd) + ln -s "${libdir}/lttng/libexec/$prog" "$exedir" + ;; + *) + ln -s "${bindir}/$prog" "$exedir" + ;; + esac + done +} diff --git a/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch new file mode 100644 index 000000000..bff852799 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch @@ -0,0 +1,17 @@ +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: lttng-ust-2.9.1/doc/Makefile.am +=================================================================== +--- lttng-ust-2.9.1.orig/doc/Makefile.am ++++ lttng-ust-2.9.1/doc/Makefile.am +@@ -1,3 +1,3 @@ +-SUBDIRS = . man examples ++SUBDIRS = . man + + dist_doc_DATA = java-agent.txt diff --git a/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb b/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb new file mode 100644 index 000000000..d79a47931 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb @@ -0,0 +1,37 @@ +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 manpages + +DEPENDS = "liburcu util-linux" +RDEPENDS_${PN}-bin = "python3-core" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "lttng2-ust" +RREPLACES_${PN} = "lttng2-ust" +RCONFLICTS_${PN} = "lttng2-ust" + +PE = "2" + +SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ + file://lttng-ust-doc-examples-disable.patch \ + " +SRC_URI[md5sum] = "4863cc2f9f0a070b42438bb646bbba06" +SRC_URI[sha256sum] = "07cc3c0b71e7b77f1913d5b7f340a78a9af414440e4662712aef2d635b88ee9d" + +CVE_PRODUCT = "ust" + +PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" + +do_install_append() { + # Patch python tools to use Python 3; they should be source compatible, but + # still refer to Python 2 in the shebang + sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp +} diff --git a/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb new file mode 100644 index 000000000..97c58c523 --- /dev/null +++ b/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -0,0 +1,27 @@ +SUMMARY = "Build tools needed by external modules" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +inherit kernel-arch +inherit pkgconfig + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +S = "${WORKDIR}" + +do_configure[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot" +do_compile[depends] += "virtual/kernel:do_compile_kernelmodules" + +DEPENDS += "bc-native" + +EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" + +# Build some host tools under work-shared. CC, LD, and AR are probably +# not used, but this is the historical way of invoking "make scripts". +# +do_configure() { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \ + -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare + +} diff --git a/poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch new file mode 100644 index 000000000..21ac49cbd --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh new file mode 100755 index 000000000..a78adf572 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb new file mode 100644 index 000000000..0f3df5577 --- /dev/null +++ b/poky/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/ +} + +PACKAGE_WRITE_DEPS_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/poky/meta/recipes-kernel/perf/perf.bb b/poky/meta/recipes-kernel/perf/perf.bb new file mode 100644 index 000000000..51f5597eb --- /dev/null +++ b/poky/meta/recipes-kernel/perf/perf.bb @@ -0,0 +1,261 @@ +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." +HOMEPAGE = "https://perf.wiki.kernel.org/index.php/Main_Page" + +LICENSE = "GPLv2" + +PR = "r9" + +PACKAGECONFIG ??= "scripting tui libunwind" +PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python" +# 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 +PACKAGECONFIG[tui] = ",NO_NEWT=1,libnewt slang" +PACKAGECONFIG[libunwind] = ",NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1,libunwind" +PACKAGECONFIG[libnuma] = ",NO_LIBNUMA=1" +PACKAGECONFIG[systemtap] = ",NO_SDT=1,systemtap" +PACKAGECONFIG[jvmti] = ",NO_JVMTI=1" + +# libaudit support would need scripting to be enabled +PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit" + +DEPENDS = " \ + virtual/${MLPREFIX}libc \ + ${MLPREFIX}elfutils \ + ${MLPREFIX}binutils \ + bison-native flex-native xz \ + xmlto-native \ + asciidoc-native \ +" + +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +PROVIDES = "virtual/perf" + +inherit linux-kernel-base kernel-arch + +# needed for building the tools/perf Python bindings +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'pythonnative', '', d)} +inherit python-dir +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 ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perlnative', '', d)} +inherit 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 + +S = "${WORKDIR}/${BP}" +SPDX_S = "${S}/tools/perf" + +# 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}" \ + LD="${LD}" \ + EXTRA_CFLAGS="-ldw" \ + EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \ + perfexecdir=${libexecdir} \ + NO_GTK2=1 NO_DWARF=1 \ + ${PACKAGECONFIG_CONFARGS} \ +' + +EXTRA_OEMAKE += "\ + 'DESTDIR=${D}' \ + '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)}' \ +" + +PERF_SRC ?= "Makefile \ + include \ + tools/arch \ + tools/build \ + tools/include \ + tools/lib \ + tools/Makefile \ + tools/perf \ + tools/scripts \ +" + +PERF_EXTRA_LDFLAGS = "" + +# MIPS N32 +PERF_EXTRA_LDFLAGS_mipsarchn32eb = "-m elf32btsmipn32" +PERF_EXTRA_LDFLAGS_mipsarchn32el = "-m elf32ltsmipn32" + +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 install + # we are checking for this make target to be compatible with older perf versions + if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then + oe_runmake DESTDIR=${D} install-python_ext + fi +} + +do_configure[prefuncs] += "copy_perf_source_from_kernel" +python copy_perf_source_from_kernel() { + sources = (d.getVar("PERF_SRC") or "").split() + src_dir = d.getVar("STAGING_KERNEL_DIR") + dest_dir = d.getVar("S") + bb.utils.mkdirhier(dest_dir) + for s in sources: + src = oe.path.join(src_dir, s) + dest = oe.path.join(dest_dir, s) + if os.path.isdir(src): + oe.path.copyhardlinktree(src, dest) + else: + bb.utils.copyfile(src, dest) +} + +do_configure_prepend () { + # 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 + perfconfig="${S}/tools/perf/config/Makefile" + fi + if [ -e "${S}/tools/perf/Makefile.config" ]; then + perfconfig="${S}/tools/perf/Makefile.config" + fi + if [ -n "${perfconfig}" ]; 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' \ + ${perfconfig} + fi + # The man pages installation is "$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)" + # in ${S}/tools/perf/Documentation/Makefile, if the mandir set to '?=', it + # will use the relative path 'share/man', in the way it will resulting in + # incorrect installation for man pages. + if [ -e "${S}/tools/perf/Documentation/Makefile" ]; then + sed -i 's,^mandir?=,mandir:=,' ${S}/tools/perf/Documentation/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 + sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${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 + sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/lib/api/Makefile + fi + if [ -e "${S}/tools/lib/subcmd/Makefile" ]; then + sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/subcmd/Makefile + sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/subcmd/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 + + # use /usr/bin/env instead of version specific python + for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do + sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}" + done +} + +python do_package_prepend() { + d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + + +PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python" + +RDEPENDS_${PN} += "elfutils bash" +RDEPENDS_${PN}-doc += "man" +RDEPENDS_${PN}-archive =+ "bash" +RDEPENDS_${PN}-python =+ "bash python python-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}" +RDEPENDS_${PN}-perl =+ "bash perl perl-modules" +RDEPENDS_${PN}-tests =+ "python" + +RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', '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}-archive = "${libdir}/perf/perf-core/perf-archive" +FILES_${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests" +FILES_${PN}-python = " \ + ${PYTHON_SITEPACKAGES_DIR} \ + ${libexecdir}/perf-core/scripts/python \ + " +FILES_${PN}-perl = "${libexecdir}/perf-core/scripts/perl" + + +INHIBIT_PACKAGE_DEBUG_SPLIT="1" diff --git a/poky/meta/recipes-kernel/powertop/powertop_2.9.bb b/poky/meta/recipes-kernel/powertop/powertop_2.9.bb new file mode 100644 index 000000000..4fe5447a0 --- /dev/null +++ b/poky/meta/recipes-kernel/powertop/powertop_2.9.bb @@ -0,0 +1,33 @@ +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-v${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "583518c5c4434c6e9b9c58c3920950b6" +SRC_URI[sha256sum] = "aa7fb7d8e9a00f05e7d8a7a2866d85929741e0d03a5bf40cab22d2021c959250" + +UPSTREAM_CHECK_URI = "https://01.org/powertop/downloads" +UPSTREAM_CHECK_REGEX = "powertop-[v]?(?P<pver>\d+(\.\d+)+)\.tar" + +inherit autotools gettext pkgconfig + +S = "${WORKDIR}/${BPN}-v${PV}" + +# 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/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch b/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch new file mode 100644 index 000000000..e28fdcad9 --- /dev/null +++ b/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch @@ -0,0 +1,26 @@ +From c2495a4c042e6a675da69bab20cc3669391e8e2a Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 23 Aug 2017 18:38:26 +0300 +Subject: [PATCH 1/2] Do not build anything in help/ as it requires itstool. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + meson.build | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 4ac3934..8c4369a 100644 +--- a/meson.build ++++ b/meson.build +@@ -116,7 +116,6 @@ subdir('tools') + subdir('tests') + + subdir('data') +-subdir('help') + subdir('po') + + meson.add_install_script('build-aux/meson_post_install.sh') +-- +2.14.1 + diff --git a/poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch new file mode 100644 index 000000000..f75ddad43 --- /dev/null +++ b/poky/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/lib/util/elfparser.h 2011-07-16 18:57:41.000000000 -0700 ++++ git/lib/util/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/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb b/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb new file mode 100644 index 000000000..1989b52a7 --- /dev/null +++ b/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb @@ -0,0 +1,34 @@ +SUMMARY = "System-wide Performance Profiler for Linux" +HOMEPAGE = "http://www.sysprof.com" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://src/sp-application.c;endline=17;md5=40e55577ef122c88fe20052acda64875" + +GNOMEBASEBUILDCLASS = "meson" +inherit gnomebase gettext systemd upstream-version-is-even + +DEPENDS = "glib-2.0 libxml2-native glib-2.0-native" + +SRC_URI[archive.md5sum] = "6f9f947960ba79bb1269d8ee49b7db78" +SRC_URI[archive.sha256sum] = "d8b9d5c2246696e4a3776a312731dc7c014fbd33478bb14d5512c6f1f35a3b11" +SRC_URI += " \ + file://define-NT_GNU_BUILD_ID.patch \ + file://0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch \ + " + +PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}" +PACKAGECONFIG[gtk] = "-Denable_gtk=true,-Denable_gtk=false,gtk+3" +PACKAGECONFIG[sysprofd] = "-Dwith_sysprofd=bundled,-Dwith_sysprofd=none,polkit" + +SOLIBS = ".so" +FILES_SOLIBSDEV = "" + +SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'sysprofd', 'sysprof2.service', '', d)}" + +# We do not yet work for aarch64. +COMPATIBLE_HOST = "^(?!aarch64).*" + +FILES_${PN} += " \ + ${datadir}/dbus-1/system-services \ + ${datadir}/dbus-1/system.d \ + " diff --git a/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb new file mode 100644 index 000000000..19cc1cf0f --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb @@ -0,0 +1,6 @@ + +require systemtap_git.bb + +inherit native + +addtask addto_recipe_sysroot after do_populate_sysroot before do_build diff --git a/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb new file mode 100644 index 000000000..46820ef48 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb @@ -0,0 +1,40 @@ +SUMMARY = "UProbes kernel module for SystemTap" + +require systemtap_git.inc + +DEPENDS = "systemtap virtual/kernel" + +# 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" + +# 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/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch new file mode 100644 index 000000000..c0ceb5a41 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch @@ -0,0 +1,42 @@ +From a714658727206d2a98a7194b7e6d29dbd3e27b8d Mon Sep 17 00:00:00 2001 +From: David Smith <dsmith@redhat.com> +Date: Mon, 19 Mar 2018 16:50:05 -0500 +Subject: [PATCH] Added a couple of small sysroot fixes. + +* tapsets.cxx (dwarf_builder::build): Fix commit 4ffecddf5. + (path_remove_sysroot): Fix extra '/' present at start of paths. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + tapsets.cxx | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +Index: git/tapsets.cxx +=================================================================== +--- git.orig/tapsets.cxx ++++ git/tapsets.cxx +@@ -1395,7 +1395,8 @@ string path_remove_sysroot(const systemt + string retval = path; + if (!sess.sysroot.empty() && + (pos = retval.find(sess.sysroot)) != string::npos) +- retval.replace(pos, sess.sysroot.length(), "/"); ++ retval.replace(pos, sess.sysroot.length(), ++ (sess.sysroot.back() == '/' ? "/": "")); + return retval; + } + +@@ -8412,8 +8413,11 @@ dwarf_builder::build(systemtap_session & + + // PR13338: unquote glob results + module_name = unescape_glob_chars (module_name); +- user_path = find_executable (module_name, "", sess.sysenv); // canonicalize it +- if (!is_fully_resolved(user_path, sess.sysroot, sess.sysenv)) ++ user_path = find_executable (module_name, sess.sysroot, sess.sysenv); // canonicalize it ++ // Note we don't need to pass the sysroot to ++ // is_fully_resolved(), since we just passed it to ++ // find_executable(). ++ if (!is_fully_resolved(user_path, "", sess.sysenv)) + throw SEMANTIC_ERROR(_F("cannot find executable '%s'", + user_path.to_string().c_str())); + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch new file mode 100644 index 000000000..89951a2f1 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch @@ -0,0 +1,61 @@ +From 4ffecddf5433d65a6f01241990c9d516586b1c79 Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Mon, 19 Mar 2018 08:53:51 -0500 +Subject: [PATCH] Delay adding sysroot path to module name in case of non + absolute executable + +Current stap code adds sysroot prematurely for probes that specify non +absolute path name, i.e like "foo", so when find_executable called it +receives full path as <sysroot>/foo and find_executable does not search +PATH while applying sysroot. + +Fix delays adding sysroot till path inside of sysroot is searched first. + +Also fix missing sysroot addition in glob expansion case. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + tapsets.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: git/tapsets.cxx +=================================================================== +--- git.orig/tapsets.cxx ++++ git/tapsets.cxx +@@ -746,7 +746,7 @@ base_query::base_query(dwflpp & dw, lite + pid_val = 0; + get_string_param(params, TOK_PROCESS, module_val); + } +- module_val = find_executable (module_val, "", sess.sysenv); ++ module_val = find_executable (module_val, sess.sysroot, sess.sysenv); + if (!is_fully_resolved(module_val, "", sess.sysenv)) + throw SEMANTIC_ERROR(_F("cannot find executable '%s'", + module_val.to_string().c_str())); +@@ -8287,7 +8287,6 @@ dwarf_builder::build(systemtap_session & + } + else + { +- module_name = (string)sess.sysroot + (string)module_name; + filled_parameters[TOK_PROCESS] = new literal_string(module_name); + } + } +@@ -8321,7 +8320,8 @@ dwarf_builder::build(systemtap_session & + assert (lit); + + // Evaluate glob here, and call derive_probes recursively with each match. +- const auto& globs = glob_executable (module_name); ++ const auto& globs = glob_executable (sess.sysroot ++ + string(module_name)); + unsigned results_pre = finished_results.size(); + for (auto it = globs.begin(); it != globs.end(); ++it) + { +@@ -8413,7 +8413,7 @@ dwarf_builder::build(systemtap_session & + // PR13338: unquote glob results + module_name = unescape_glob_chars (module_name); + user_path = find_executable (module_name, "", sess.sysenv); // canonicalize it +- if (!is_fully_resolved(user_path, "", sess.sysenv)) ++ if (!is_fully_resolved(user_path, sess.sysroot, sess.sysenv)) + throw SEMANTIC_ERROR(_F("cannot find executable '%s'", + user_path.to_string().c_str())); + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch new file mode 100644 index 000000000..742b1187f --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch @@ -0,0 +1,25 @@ +From ab29615ed6c2e779b472903564dc683dc1015de7 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 22 Feb 2017 13:37:33 +0200 +Subject: [PATCH] Do not let configure write a python location into the dtrace + binary + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + dtrace.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dtrace.in b/dtrace.in +index 5e1cf8079..a24229cbc 100644 +--- a/dtrace.in ++++ b/dtrace.in +@@ -1,4 +1,4 @@ +-#!@preferred_python@ ++#!/usr/bin/python3 + # vim: et sta sts=4 sw=4 ts=8 + + # This handles the systemtap equivalent of +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch new file mode 100644 index 000000000..460c3b760 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch @@ -0,0 +1,277 @@ +From fbb26e17a4c026f05a497fc5d584516bad3b6950 Mon Sep 17 00:00:00 2001 +From: David Smith <dsmith@redhat.com> +Date: Wed, 6 Dec 2017 14:37:42 -0600 +Subject: [PATCH] Fix PR22551 by updating the use of timers for the 4.15 + kernel. + +* runtime/linux/timer_compatibility.h: New file. +* runtime/time.c: Update timer callback function parameter type. Update + timer initialization. +* runtime/transport/relay_v2.c: Ditto. +* runtime/transport/transport.c: Ditto. +* tapset-timers.cxx (timer_derived_probe_group::emit_module_decls): + Ditto. Handle old and new timer callback interface. +* runtime/linux/runtime.h: Include timer_compatibility.h instead of timer.h. +* tapset/linux/scsi.stp: Ditto. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> + +--- + runtime/linux/runtime.h | 2 +- + runtime/linux/timer_compatibility.h | 76 +++++++++++++++++++++++++++++++++++++ + runtime/time.c | 7 ++-- + runtime/transport/relay_v2.c | 8 ++-- + runtime/transport/transport.c | 13 +++---- + tapset-timers.cxx | 14 +++++-- + tapset/linux/scsi.stp | 2 +- + 7 files changed, 100 insertions(+), 22 deletions(-) + create mode 100644 runtime/linux/timer_compatibility.h + +diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h +index 9c585a2..df9b74c 100644 +--- a/runtime/linux/runtime.h ++++ b/runtime/linux/runtime.h +@@ -34,7 +34,7 @@ + #include <linux/compat.h> + #include <linux/sched.h> + #include <linux/mm.h> +-#include <linux/timer.h> ++#include "timer_compatibility.h" + #include <linux/delay.h> + #include <linux/profile.h> + #include <linux/rcupdate.h> +diff --git a/runtime/linux/timer_compatibility.h b/runtime/linux/timer_compatibility.h +new file mode 100644 +index 0000000..ac03de9 +--- /dev/null ++++ b/runtime/linux/timer_compatibility.h +@@ -0,0 +1,76 @@ ++/* ++ * linux/timer.h compatibility defines and inlines ++ * Copyright (C) 2017 Red Hat Inc. ++ * ++ * This file is part of systemtap, and is free software. You can ++ * redistribute it and/or modify it under the terms of the GNU General ++ * Public License (GPL); either version 2, or (at your option) any ++ * later version. ++ */ ++ ++#ifndef _TIMER_COMPATIBILITY_H_ ++#define _TIMER_COMPATIBILITY_H_ ++ ++#include <linux/timer.h> ++ ++/* ++ * Starting with the 4.15 kernel, the timer interface ++ * changed. Originally, you'd do something like: ++ * ++ * static void timer_func(unsigned long val); ++ * ++ * init_timer(&timer); ++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; ++ * timer.function = timer_func; ++ * timer.data = 0; ++ * add_timer(&timer); ++ * ++ * The 'data' parameter would get passed to the callback ++ * function. Starting with 4.15, you'd do something like this: ++ * ++ * static void timer_func(struct timer_list *val); ++ * ++ * timer_setup(&timer, timer_func, 0); ++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; ++ * add_timer(&timer); ++ * ++ * With the new code, the timer that caused the callback gets passed ++ * to the timer callback function. The 'data' field has been removed. ++ * ++ * So, we're going to use the new interface. To hide the differences ++ * between the callback function parameter type, we'll define a new ++ * type, 'stp_timer_callback_parameter_t'. ++ * ++ * If code needs to figure out the difference between the old and new ++ * interface, it should test the TIMER_TRACE_FLAGMASK define (which ++ * only exists in the new interface). ++ */ ++ ++#if defined(TIMER_TRACE_FLAGMASK) ++/* This is the >= 4.15 kernel interface. */ ++ ++typedef struct timer_list * stp_timer_callback_parameter_t; ++ ++#else ++/* This is the < 4.15 kernel interface. */ ++ ++typedef unsigned long stp_timer_callback_parameter_t; ++ ++/** ++ * timer_setup - prepare a timer for first use ++ * @timer: the timer in question ++ * @callback: the function to call when timer expires ++ * @flags: any TIMER_* flags (note that anything other than 0 is an ++ * error, since this compatibility function can't support any ++ * of the TIMER_* flags) ++ */ ++#define timer_setup(timer, callback, flags) \ ++ { \ ++ init_timer((timer)); \ ++ (timer)->function = callback; \ ++ (timer)->data = 0; \ ++ BUILD_BUG_ON_ZERO((flags) != 0); \ ++ } ++#endif ++ ++#endif /* _TIMER_COMPATIBILITY_H_ */ +diff --git a/runtime/time.c b/runtime/time.c +index 2e666d5..91ceafa 100644 +--- a/runtime/time.c ++++ b/runtime/time.c +@@ -168,10 +168,10 @@ __stp_time_smp_callback(void *val) + + /* The timer callback is in a softIRQ -- interrupts enabled. */ + static void +-__stp_time_timer_callback(unsigned long val) ++__stp_time_timer_callback(stp_timer_callback_parameter_t unused) + { + stp_time_t *time =__stp_time_local_update(); +- (void) val; ++ (void) unused; + + /* PR6481: make sure IRQs are enabled before resetting the timer + (IRQs are disabled and then reenabled in +@@ -200,9 +200,8 @@ __stp_init_time(void *info) + time->freq = __stp_get_freq(); + __stp_time_local_update(); + +- init_timer(&time->timer); ++ timer_setup(&time->timer, __stp_time_timer_callback, 0); + time->timer.expires = jiffies + STP_TIME_SYNC_INTERVAL; +- time->timer.function = __stp_time_timer_callback; + + #ifndef STAPCONF_ADD_TIMER_ON + add_timer(&time->timer); +diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c +index f81d75d..135951a 100644 +--- a/runtime/transport/relay_v2.c ++++ b/runtime/transport/relay_v2.c +@@ -30,7 +30,7 @@ + #include <linux/debugfs.h> + #include <linux/mm.h> + #include <linux/relay.h> +-#include <linux/timer.h> ++#include "../linux/timer_compatibility.h" + #include "../uidgid_compatibility.h" + #include "relay_compat.h" + +@@ -120,7 +120,7 @@ static void __stp_relay_wakeup_readers(struct rchan_buf *buf) + wake_up_interruptible(&buf->read_wait); + } + +-static void __stp_relay_wakeup_timer(unsigned long val) ++static void __stp_relay_wakeup_timer(stp_timer_callback_parameter_t unused) + { + #ifdef STP_BULKMODE + int i; +@@ -151,10 +151,8 @@ static void __stp_relay_wakeup_timer(unsigned long val) + static void __stp_relay_timer_init(void) + { + atomic_set(&_stp_relay_data.wakeup, 0); +- init_timer(&_stp_relay_data.timer); ++ timer_setup(&_stp_relay_data.timer, __stp_relay_wakeup_timer, 0); + _stp_relay_data.timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; +- _stp_relay_data.timer.function = __stp_relay_wakeup_timer; +- _stp_relay_data.timer.data = 0; + add_timer(&_stp_relay_data.timer); + smp_mb(); + } +diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c +index 3400f22..320fd18 100644 +--- a/runtime/transport/transport.c ++++ b/runtime/transport/transport.c +@@ -311,7 +311,7 @@ static void _stp_detach(void) + } + + +-static void _stp_ctl_work_callback(unsigned long val); ++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused); + + /* + * Called when stapio opens the control channel. +@@ -320,13 +320,12 @@ static void _stp_attach(void) + { + dbug_trans(1, "attach\n"); + _stp_pid = current->pid; +- if (_stp_namespaces_pid < 1) +- _stp_namespaces_pid = _stp_pid; ++ if (_stp_namespaces_pid < 1) ++ _stp_namespaces_pid = _stp_pid; + _stp_transport_data_fs_overwrite(0); +- init_timer(&_stp_ctl_work_timer); ++ ++ timer_setup(&_stp_ctl_work_timer, _stp_ctl_work_callback, 0); + _stp_ctl_work_timer.expires = jiffies + STP_CTL_TIMER_INTERVAL; +- _stp_ctl_work_timer.function = _stp_ctl_work_callback; +- _stp_ctl_work_timer.data= 0; + add_timer(&_stp_ctl_work_timer); + } + +@@ -341,7 +340,7 @@ static void _stp_attach(void) + * notified. Reschedules itself if someone is still attached + * to the cmd channel. + */ +-static void _stp_ctl_work_callback(unsigned long val) ++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused) + { + int do_io = 0; + unsigned long flags; +diff --git a/tapset-timers.cxx b/tapset-timers.cxx +index 1a40bcd..0ab4d69 100644 +--- a/tapset-timers.cxx ++++ b/tapset-timers.cxx +@@ -122,9 +122,13 @@ timer_derived_probe_group::emit_module_decls (systemtap_session& s) + s.op->newline(-1) << "};"; + s.op->newline(); + +- s.op->newline() << "static void enter_timer_probe (unsigned long val) {"; ++ s.op->newline() << "static void enter_timer_probe (stp_timer_callback_parameter_t val) {"; ++ s.op->newline() << "#if defined(TIMER_TRACE_FLAGMASK)"; ++ s.op->newline(1) << "struct stap_timer_probe* stp = container_of(val, struct stap_timer_probe, timer_list);"; ++ s.op->newline(-1) << "#else"; + s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [val];"; +- s.op->newline() << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||"; ++ s.op->newline(-1) << "#endif"; ++ s.op->newline(1) << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||"; + s.op->newline() << " (atomic_read (session_state()) == STAP_SESSION_RUNNING))"; + s.op->newline(1) << "mod_timer (& stp->timer_list, jiffies + "; + emit_interval (s.op); +@@ -148,9 +152,11 @@ timer_derived_probe_group::emit_module_init (systemtap_session& s) + s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {"; + s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [i];"; + s.op->newline() << "probe_point = stp->probe->pp;"; +- s.op->newline() << "init_timer (& stp->timer_list);"; +- s.op->newline() << "stp->timer_list.function = & enter_timer_probe;"; ++ ++ s.op->newline() << "timer_setup (& stp->timer_list, enter_timer_probe, 0);"; ++ s.op->newline() << "#if !defined(TIMER_TRACE_FLAGMASK)"; + s.op->newline() << "stp->timer_list.data = i;"; // NB: important! ++ s.op->newline() << "#endif"; + // copy timer renew calculations from above :-( + s.op->newline() << "stp->timer_list.expires = jiffies + "; + emit_interval (s.op); +diff --git a/tapset/linux/scsi.stp b/tapset/linux/scsi.stp +index 44f686c..3577942 100644 +--- a/tapset/linux/scsi.stp ++++ b/tapset/linux/scsi.stp +@@ -14,7 +14,7 @@ + #include <scsi/scsi_cmnd.h> + #include <scsi/scsi_device.h> + #include <scsi/scsi_host.h> +-#include <linux/timer.h> ++#include "linux/timer_compatibility.h" + #include <linux/blkdev.h> + %} + +-- +2.7.4 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch new file mode 100644 index 000000000..a1b0bff02 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch @@ -0,0 +1,215 @@ +From 4ffe00f1d9eac332d928f7dc01fe250dc32b1bb8 Mon Sep 17 00:00:00 2001 +From: Stan Cox <scox@redhat.com> +Date: Tue, 13 Feb 2018 22:38:03 -0500 +Subject: [PATCH] Fixes for gcc 8 + +* includes/sys/sdt.h (__SDT_COND_SIGNED): Add CT, cast type argument + +Author: Will Cohen <wcohen.redhat.com> + +* stap-serverd.cxx (generate_mok, handleRequest, handle_connection): + Catch format overflow + +* translate.cxx (translate_pass): Use ref in catch. +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj <raj.khem@gmail.com> + + includes/sys/sdt.h | 20 ++++++++-------- + stap-serverd.cxx | 67 +++++++++++++++++++++++++++++++++++++++++++++++------- + translate.cxx | 2 +- + 3 files changed, 70 insertions(+), 19 deletions(-) + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 940f74483..c0c5a492c 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -119,8 +119,8 @@ struct __sdt_type + + #define __SDT_ALWAYS_SIGNED(T) \ + template<> struct __sdt_type<T> { static const bool __sdt_signed = true; }; +-#define __SDT_COND_SIGNED(T) \ +-template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 1); }; ++#define __SDT_COND_SIGNED(T,CT) \ ++template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); }; + __SDT_ALWAYS_SIGNED(signed char) + __SDT_ALWAYS_SIGNED(short) + __SDT_ALWAYS_SIGNED(int) +@@ -141,14 +141,14 @@ __SDT_ALWAYS_SIGNED(const volatile short) + __SDT_ALWAYS_SIGNED(const volatile int) + __SDT_ALWAYS_SIGNED(const volatile long) + __SDT_ALWAYS_SIGNED(const volatile long long) +-__SDT_COND_SIGNED(char) +-__SDT_COND_SIGNED(wchar_t) +-__SDT_COND_SIGNED(volatile char) +-__SDT_COND_SIGNED(volatile wchar_t) +-__SDT_COND_SIGNED(const char) +-__SDT_COND_SIGNED(const wchar_t) +-__SDT_COND_SIGNED(const volatile char) +-__SDT_COND_SIGNED(const volatile wchar_t) ++__SDT_COND_SIGNED(char, char) ++__SDT_COND_SIGNED(wchar_t, wchar_t) ++__SDT_COND_SIGNED(volatile char, char) ++__SDT_COND_SIGNED(volatile wchar_t, wchar_t) ++__SDT_COND_SIGNED(const char, char) ++__SDT_COND_SIGNED(const wchar_t, wchar_t) ++__SDT_COND_SIGNED(const volatile char, char) ++__SDT_COND_SIGNED(const volatile wchar_t, wchar_t) + #if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + /* __SDT_COND_SIGNED(char16_t) */ + /* __SDT_COND_SIGNED(char32_t) */ +diff --git a/stap-serverd.cxx b/stap-serverd.cxx +index 7cf76c617..41f77ee9e 100644 +--- a/stap-serverd.cxx ++++ b/stap-serverd.cxx +@@ -1607,6 +1607,7 @@ generate_mok(string &mok_fingerprint) + char tmpdir[PATH_MAX] = { '\0' }; + string public_cert_path, private_cert_path, destdir; + mode_t old_umask; ++ int retlen; + + mok_fingerprint.clear (); + +@@ -1631,7 +1632,14 @@ generate_mok(string &mok_fingerprint) + } + + // Make a temporary directory to store results in. +- snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ()); ++ retlen = snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ()); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Could not create %s name", "temporary directory")); ++ tmpdir[0] = '\0'; ++ goto cleanup; ++ } ++ + if (mkdtemp (tmpdir) == NULL) + { + server_error (_F("Could not create temporary directory %s: %s", tmpdir, +@@ -1704,6 +1712,7 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri + unsigned u; + unsigned i; + FILE* f; ++ int retlen; + + // Save the server version. Do this early, so the client knows what version of the server + // it is dealing with, even if the request is not fully completed. +@@ -1782,7 +1791,12 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri + struct stat st; + char *arg; + +- snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i); ++ retlen = snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "path")); ++ return; ++ } + + rc = stat(stapargfile, & st); + if (rc) break; +@@ -1888,7 +1902,15 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri + { + glob_t globber; + char pattern[PATH_MAX]; +- snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str()); ++ int retlen; ++ ++ retlen = snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str()); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "pattern")); ++ return; ++ } ++ + rc = glob (pattern, GLOB_ERR, NULL, &globber); + if (rc) + server_error (_F("Unable to find a module in %s", new_staptmpdir.c_str())); +@@ -2164,6 +2186,7 @@ handle_connection (void *arg) + copy for each connection.*/ + vector<string> argv; + PRInt32 bytesRead; ++ int retlen; + + /* Detatch to avoid a memory leak */ + if(max_threads > 0) +@@ -2213,7 +2236,13 @@ handle_connection (void *arg) + #endif + + secStatus = SECFailure; +- snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp"); ++ retlen = snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp"); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "temporary directory")); ++ tmpdir[0]=0; /* prevent /bin/rm */ ++ goto cleanup; ++ } + rc1 = mkdtemp(tmpdir); + if (! rc1) + { +@@ -2223,9 +2252,20 @@ handle_connection (void *arg) + } + + /* Create a temporary files names and directories. */ +- snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir); ++ retlen = snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "request.zip path")); ++ goto cleanup; ++ } ++ ++ retlen = snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "request directory path")); ++ goto cleanup; ++ } + +- snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir); + rc = mkdir(requestDirName, 0700); + if (rc) + { +@@ -2233,7 +2273,13 @@ handle_connection (void *arg) + goto cleanup; + } + +- snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir); ++ retlen = snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "response directory path")); ++ goto cleanup; ++ } ++ + rc = mkdir(responseDirName, 0700); + if (rc) + { +@@ -2243,7 +2289,12 @@ handle_connection (void *arg) + // Set this early, since it gets used for errors to be returned to the client. + stapstderr = string(responseDirName) + "/stderr"; + +- snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir); ++ retlen = snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir); ++ if (retlen < 0 || retlen >= PATH_MAX) ++ { ++ server_error (_F("Error creating %s name", "response.zip path")); ++ goto cleanup; ++ } + + /* Read data from the socket. + * If the user is requesting/requiring authentication, authenticate +diff --git a/translate.cxx b/translate.cxx +index 1240a80ec..4ade06fdd 100644 +--- a/translate.cxx ++++ b/translate.cxx +@@ -7860,7 +7860,7 @@ translate_pass (systemtap_session& s) + if (versions.size() >= 3 && s.verbose > 1) + clog << _F("ignoring extra parts of compat version: %s", s.compatible.c_str()) << endl; + } +- catch (const runtime_error) ++ catch (const runtime_error&) + { + throw SEMANTIC_ERROR(_F("parse error in compatibility version: %s", s.compatible.c_str())); + } diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch new file mode 100644 index 000000000..528864cc9 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch @@ -0,0 +1,36 @@ +From 2ada22f05460223924efe54080cb4419e2b4c276 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 24 Feb 2017 17:53:02 +0200 +Subject: [PATCH] Install python modules to correct library dir. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + python/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python/Makefile.am b/python/Makefile.am +index a254480f9..efe9f3c01 100644 +--- a/python/Makefile.am ++++ b/python/Makefile.am +@@ -47,7 +47,7 @@ install-exec-local: + if HAVE_PYTHON2_PROBES + (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \ + --build-base $(shell readlink -f $(builddir))/py2build \ +- install --prefix $(DESTDIR)$(prefix) \ ++ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${pythondir} \ + --single-version-externally-managed \ + --record $(shell readlink -f $(builddir))/py2build/install_files.txt \ + --verbose) +@@ -55,7 +55,7 @@ endif + if HAVE_PYTHON3_PROBES + (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \ + --build-base $(shell readlink -f $(builddir))/py3build \ +- install --prefix $(DESTDIR)$(prefix) \ ++ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${python3dir} \ + --single-version-externally-managed \ + --record $(shell readlink -f $(builddir))/py3build/install_files.txt \ + --verbose) +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch new file mode 100644 index 000000000..7cd9030ea --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch @@ -0,0 +1,128 @@ +From 41efad04730be89889d1483719f9a6c9396dc250 Mon Sep 17 00:00:00 2001 +From: David Smith <dsmith@redhat.com> +Date: Wed, 14 Mar 2018 17:05:25 -0500 +Subject: [PATCH] Make sure sysroot paths don't end with a slash. + +* session.cxx (parse_cmdline): Make sure a sysroot path does not end with + a '/', since we build paths like: sysroot + "/lib/modules". If the + sysroot path ends with a '/', we end up with paths like + '/SYSROOT//lib/modules'. + (setup_kernel_release): Take a string parameter, not a character pointer. +* session.h: Update setup_kernel_release() prototype. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + session.cxx | 34 ++++++++++++++++++++++++++-------- + session.h | 2 +- + 2 files changed, 27 insertions(+), 9 deletions(-) + +Index: git/session.cxx +=================================================================== +--- git.orig/session.cxx ++++ git/session.cxx +@@ -722,6 +722,9 @@ systemtap_session::parse_cmdline (int ar + client_options_disallowed_for_unprivileged = ""; + std::set<std::string> additional_unwindsym_modules; + struct rlimit our_rlimit; ++ bool sysroot_option_seen = false; ++ string kernel_release_value; ++ + while (true) + { + char * num_endptr; +@@ -887,7 +890,7 @@ systemtap_session::parse_cmdline (int ar + // Note that '-' must come last in a regex bracket expression. + assert_regexp_match("-r parameter from client", optarg, "^[a-z0-9_.+-]+$"); + server_args.push_back (string ("-") + (char)grc + optarg); +- setup_kernel_release(optarg); ++ kernel_release_value = optarg; + break; + + case 'a': +@@ -1473,7 +1476,7 @@ systemtap_session::parse_cmdline (int ar + if (client_options) { + cerr << _F("ERROR: %s invalid with %s", "--sysroot", "--client-options") << endl; + return 1; +- } else if (!sysroot.empty()) { ++ } else if (sysroot_option_seen) { + cerr << "ERROR: multiple --sysroot options not supported" << endl; + return 1; + } else { +@@ -1487,11 +1490,17 @@ systemtap_session::parse_cmdline (int ar + + sysroot = string(spath); + free (spath); +- if (sysroot[sysroot.size() - 1] != '/') +- sysroot.append("/"); + +- break; ++ // We do path creation like this: ++ // sysroot + "/lib/modules" ++ // So, we don't want the sysroot path to end with a '/', ++ // otherwise we'll end up with '/foo//lib/modules'. ++ if (sysroot.back() == '/') { ++ sysroot.pop_back(); ++ } + } ++ sysroot_option_seen = true; ++ break; + + case LONG_OPT_SYSENV: + if (client_options) { +@@ -1501,7 +1510,7 @@ systemtap_session::parse_cmdline (int ar + string sysenv_str = optarg; + string value; + size_t pos; +- if (sysroot.empty()) { ++ if (! sysroot_option_seen) { + cerr << "ERROR: --sysenv must follow --sysroot" << endl; + return 1; + } +@@ -1646,6 +1655,15 @@ systemtap_session::parse_cmdline (int ar + } + } + ++ if (! kernel_release_value.empty()) ++ { ++ setup_kernel_release(kernel_release_value); ++ } ++ else if (! sysroot.empty()) ++ { ++ kernel_build_tree = sysroot + "/lib/modules/" + kernel_release + "/build"; ++ } ++ + return 0; + } + +@@ -2152,7 +2170,7 @@ void systemtap_session::insert_loaded_mo + } + + void +-systemtap_session::setup_kernel_release (const char* kstr) ++systemtap_session::setup_kernel_release (const string& kstr) + { + // Sometimes we may get dupes here... e.g. a server may have a full + // -r /path/to/kernel followed by a client's -r kernel. +@@ -2183,7 +2201,7 @@ systemtap_session::setup_kernel_release + else + { + update_release_sysroot = true; +- kernel_release = string (kstr); ++ kernel_release = kstr; + if (!kernel_release.empty()) + kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; + +Index: git/session.h +=================================================================== +--- git.orig/session.h ++++ git/session.h +@@ -144,7 +144,7 @@ public: + + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (session.cxx). +- void setup_kernel_release (const char* kstr); ++ void setup_kernel_release (const std::string& kstr); + void insert_loaded_modules (); + + // command line parsing diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch new file mode 100644 index 000000000..b2820b31e --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch @@ -0,0 +1,29 @@ +From 436063d5e4738a9b03535d330a2242be5118e745 Mon Sep 17 00:00:00 2001 +From: David Smith <dsmith@redhat.com> +Date: Thu, 8 Mar 2018 16:01:58 -0600 +Subject: [PATCH] Use sysroot when looking for the System.map file. + +Add sysroot to system_map_path + "/boot/System.map" case. Otherwise +stap tries to look symbols on host system and it produce error like this: + +> Kernel symbol table /boot/System.map-4.9.78-yocto-standard unavailable, (No such file or directory) + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + session.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: git/session.cxx +=================================================================== +--- git.orig/session.cxx ++++ git/session.cxx +@@ -2013,7 +2013,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 = sysroot + "/boot/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/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch new file mode 100644 index 000000000..98181a129 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch @@ -0,0 +1,39 @@ +From 183c7a7a8167333c873525f7908913837b8dc3cb Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Tue, 20 Mar 2018 12:41:05 -0500 +Subject: [PATCH] _stp_umodule_relocate needs target file path, not host file + path + +Strip of sysroot from module name is required when _stp_umodule_relocate +call is generated. Otherwise path won't match path on target and could +will fail to calculated address within the file. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + loc2stap.cxx | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/loc2stap.cxx b/loc2stap.cxx +index 4818ee0..e09954f 100644 +--- a/loc2stap.cxx ++++ b/loc2stap.cxx +@@ -17,6 +17,7 @@ + + #include "loc2stap.h" + #include "dwflpp.h" ++#include "tapsets.h" + + #if ! _ELFUTILS_PREREQ(0, 153) + #define DW_OP_GNU_entry_value 0xf3 +@@ -106,7 +107,9 @@ location_context::translate_address(Dwarf_Addr addr) + c = "/* pragma:vma */ " + "({ unsigned long addr = 0; " + "addr = _stp_umodule_relocate (\"" +- + resolve_path(dw->module_name.c_str()) + "\", " ++ + path_remove_sysroot(dw->sess, ++ resolve_path(dw->module_name.c_str())) ++ + "\", " + + lex_cast_hex (addr) + + ", current); addr; })"; + } diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch new file mode 100644 index 000000000..7996fdde7 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch @@ -0,0 +1,38 @@ +From 75c4aec6de3a615909f3283eac585760de101b8c Mon Sep 17 00:00:00 2001 +From: Saul Wold <sgw@linux.intel.com> +Date: Tue, 7 Mar 2017 10:46:12 -0800 +Subject: [PATCH] buildrun: remove quotes around -I include line + +By having the quotes, the kernel Makefile addtree macro adds the +kernel $srctree directory as a prefix and causes compilation failures. +Removing the quotes resolves the issue. + +This is trimmed from the verbose output of the GCC command line +Before: + -I/srv/sdb/builds/4.9/tmp/work-shared/qemux86-64/kernel-source/"/srv/sdb/releases/jethro/builds/4.1/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime" + +After: + -I/srv/sdb/builds/4.9/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime + +Upstream-Status: Pending +Signed-off-by: Saul Wold <sgw@linux.intel.com> +--- + buildrun.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/buildrun.cxx b/buildrun.cxx +index aaea64c..8a8ee9f 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -495,7 +495,7 @@ compile_pass (systemtap_session& s) + #if CHECK_POINTER_ARITH_PR5947 + o << "EXTRA_CFLAGS += -Wpointer-arith" << endl; + #endif +- o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl; ++ o << "EXTRA_CFLAGS += -I" << s.runtime_path << endl; + // XXX: this may help ppc toc overflow + // o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl; + o << "obj-m := " << s.module_name << ".o" << endl; +-- +2.7.4 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch new file mode 100644 index 000000000..160642db0 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch @@ -0,0 +1,42 @@ +From b29e448e12040ed8f4d83743a14db0f138a7cc67 Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Wed, 14 Mar 2018 16:54:08 -0500 +Subject: [PATCH] debuginfo lookup with sysroot case do not remove sysroot from + file_name + +If sysroot option is passed, and debug symbols reside in sysroot along +with executable <foo> in <foo_dir>/.debug/<foo_file> directory, +stap fails to find debuginfo because it strips out sysroot path +from file_name so dwfl_standard_find_debuginfo ends up looking at +host <foo_dir>/.debug/<foo_file> rather then checking +<sysroot>/<foo_dir>/.debug/<foo_file>. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + setupdwfl.cxx | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/setupdwfl.cxx b/setupdwfl.cxx +index 11e0bb2..2a87982 100644 +--- a/setupdwfl.cxx ++++ b/setupdwfl.cxx +@@ -627,18 +627,6 @@ internal_find_debuginfo (Dwfl_Module *mod, + + call_dwfl_standard_find_debuginfo: + +- if (current_session_for_find_debuginfo) +- { +- string sysroot = current_session_for_find_debuginfo->sysroot + "/*"; +- int found = fnmatch(sysroot.c_str(), file_name, 0); +- +- if (found) +- { +- file_name = file_name +- + current_session_for_find_debuginfo->sysroot.length() - 1; +- } +- } +- + /* Call the original dwfl_standard_find_debuginfo */ + return dwfl_standard_find_debuginfo(mod, userdata, modname, base, + file_name, debuglink_file, diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch new file mode 100644 index 000000000..9f11648fe --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch @@ -0,0 +1,62 @@ +From 3e13a006fe3dff9489269274093bf868532036e2 Mon Sep 17 00:00:00 2001 +From: Saul Wold <sgw@linux.intel.com> +Date: Tue, 5 Sep 2017 16:02:55 -0700 +Subject: [PATCH] staprun/stapbpf: don't support installing a non-root + +Since we are in a known environment and installing as root and +expect to be running as root, don't create the group or chmod +the binaries. + +Upstream-Status: Inappropriate [Embedded] +Signed-off-by: Saul Wold <sgw@linux.intel.com> +--- + stapbpf/Makefile.am | 14 +++++++------- + staprun/Makefile.am | 12 ++++++------ + 2 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/stapbpf/Makefile.am b/stapbpf/Makefile.am +index 421b044ef..f7daeb2b2 100644 +--- a/stapbpf/Makefile.am ++++ b/stapbpf/Makefile.am +@@ -39,11 +39,11 @@ git_version.stamp ../git_version.h: + + # Why the "id -u" condition? This way, an unprivileged user can run + # make install, and have "sudo stap ...." or "sudo stapbpf ...." work later. +-install-exec-hook: +- if [ `id -u` -eq 0 ]; then \ +- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ +- getent group stapusr >/dev/null \ +- && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ +- && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \ +- fi ++#install-exec-hook: ++# if [ `id -u` -eq 0 ]; then \ ++# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ ++# getent group stapusr >/dev/null \ ++# && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ ++# && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \ ++# fi + endif +diff --git a/staprun/Makefile.am b/staprun/Makefile.am +index 4073aa01c..2925e34c3 100644 +--- a/staprun/Makefile.am ++++ b/staprun/Makefile.am +@@ -72,9 +72,9 @@ git_version.stamp ../git_version.h: + + # Why the "id -u" condition? This way, an unprivileged user can run + # make install, and have "sudo stap ...." or "sudo staprun ...." work later. +-install-exec-hook: +- if [ `id -u` -eq 0 ]; then \ +- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ +- getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \ +- chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \ +- fi ++#install-exec-hook: ++# if [ `id -u` -eq 0 ]; then \ ++# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ ++# getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \ ++# chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \ ++# fi +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch new file mode 100644 index 000000000..6fe7d4d1c --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch @@ -0,0 +1,40 @@ +From 7e11f129ff370ce5f39812ce2ae6ce40818a347f Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Thu, 22 Mar 2018 16:02:02 -0500 +Subject: [PATCH] sysroot: fix short release -r option handling follow up + +In case of sysroot set and short release -r option it does not make sense +to pass short release name into dwfl_linux_kernel_report_offline +function. This function is not aware about sysroot and it won't look for +kernel modules under sysroot directory. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + setupdwfl.cxx | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/setupdwfl.cxx b/setupdwfl.cxx +index c419afa..0cf5810 100644 +--- a/setupdwfl.cxx ++++ b/setupdwfl.cxx +@@ -367,7 +367,15 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s) + // hard-code this magic here. + string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build"; + if (s.kernel_build_tree == lib_path) +- elfutils_kernel_path = s.kernel_release; ++ { ++ if (s.sysroot != "") ++ // If we have sysroot set does not make sense to pass ++ // short release to dwfl, it won't take a sysroot into ++ // account. Let's construct full path in such case. ++ elfutils_kernel_path = string(s.sysroot + "/lib/modules/" + s.kernel_release); ++ else ++ elfutils_kernel_path = s.kernel_release; ++ } + else + elfutils_kernel_path = s.kernel_build_tree; + offline_modules_found = 0; +-- +2.7.4 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch new file mode 100644 index 000000000..b31d6274e --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch @@ -0,0 +1,53 @@ +From a9ce89bcd2d78728faef59bda60e75510972cd56 Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Wed, 14 Mar 2018 17:09:44 -0500 +Subject: [PATCH] sysroot: fix short release -r option handling + +* setupdwfl.cxx (debuginfo_path_insert_sysroot): Add a '/' to the end of + the sysroot for path_insert_sysroot(). + (setup_dwfl_kernel): Simplify logic when finding the kernel path to send + to elfutils. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + setupdwfl.cxx | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/setupdwfl.cxx b/setupdwfl.cxx +index 2a87982..f6c3157 100644 +--- a/setupdwfl.cxx ++++ b/setupdwfl.cxx +@@ -339,6 +339,13 @@ static char * path_insert_sysroot(string sysroot, string path) + + void debuginfo_path_insert_sysroot(string sysroot) + { ++ // FIXME: This is a short-term fix, until we expect sysroot paths to ++ // always end with a '/' (and never be empty). ++ // ++ // The path_insert_sysroot() function assumes that sysroot has a '/' ++ // on the end. Make sure that is true. ++ if (sysroot.back() != '/') ++ sysroot.push_back('/'); + debuginfo_path = path_insert_sysroot(sysroot, debuginfo_path); + debuginfo_usr_path = path_insert_sysroot(sysroot, debuginfo_usr_path); + } +@@ -358,13 +365,11 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s) + // no way to set the dwfl_callback.debuginfo_path and always + // passs the plain kernel_release here. So instead we have to + // hard-code this magic here. +- string lib_path = "/lib/modules/" + s.kernel_release + "/build"; +- if (s.kernel_build_tree == string(s.sysroot + lib_path) || +- (s.kernel_build_tree == lib_path +- && s.sysroot == "/")) +- elfutils_kernel_path = s.kernel_release; +- else +- elfutils_kernel_path = s.kernel_build_tree; ++ string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build"; ++ if (s.kernel_build_tree == lib_path) ++ elfutils_kernel_path = s.kernel_release; ++ else ++ elfutils_kernel_path = s.kernel_build_tree; + offline_modules_found = 0; + + // First try to report full path modules. diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch new file mode 100644 index 000000000..8a3d39a5b --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch @@ -0,0 +1,117 @@ +From 2041085d1a700201dc088991ca8136e7935bf42f Mon Sep 17 00:00:00 2001 +From: Victor Kamensky <kamensky@cisco.com> +Date: Wed, 21 Mar 2018 11:35:26 -0500 +Subject: [PATCH] sysroot: handle symbolic links with absolute name relative to + sysroot + +In case of symbolic link found under sysroot point to absolute path, +instead of trying to look for such absolute path in host system, +apply sysroot prefix first. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky <kamensky@cisco.com> +--- + util.cxx | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 76 insertions(+) + +Index: git/util.cxx +=================================================================== +--- git.orig/util.cxx ++++ git/util.cxx +@@ -441,6 +441,64 @@ split_lines(const char *buf, size_t n) + return lines; + } + ++static string ++follow_link(const string& name, const string& sysroot) ++{ ++ char *linkname; ++ ssize_t r; ++ string retpath; ++ struct stat st; ++ ++ const char *f = name.c_str(); ++ ++ lstat(f, &st); ++ ++ linkname = (char *) malloc(st.st_size + 1); ++ ++ if (linkname) ++ { ++ r = readlink(f, linkname, st.st_size + 1); ++ linkname[st.st_size] = '\0'; ++ /* ++ * If we have non-empty sysroot and we got link that ++ * points to absolute path name, we need to look at ++ * this path relative to sysroot itself. access and ++ * stat will follow symbolic links correctly only in ++ * case with empty sysroot. ++ */ ++ while (r != -1 && linkname && linkname[0] == '/') ++ { ++ string fname1 = sysroot + linkname; ++ const char *f1 = fname1.c_str(); ++ if (access(f1, X_OK) == 0 ++ && stat(f1, &st) == 0 ++ && S_ISREG(st.st_mode)) ++ { ++ retpath = fname1; ++ break; ++ } ++ else if (lstat(f1, &st) == 0 ++ && S_ISLNK(st.st_mode)) ++ { ++ free(linkname); ++ linkname = (char *) malloc(st.st_size + 1); ++ if (linkname) ++ { ++ r = readlink(f1, linkname, st.st_size + 1); ++ linkname[st.st_size] = '\0'; ++ } ++ } ++ else ++ { ++ break; ++ } ++ } ++ } ++ free(linkname); ++ ++ return retpath; ++} ++ + // Resolve an executable name to a canonical full path name, with the + // same policy as execvp(). A program name not containing a slash + // will be searched along the $PATH. +@@ -465,6 +523,14 @@ string find_executable(const string& nam + if (name.find('/') != string::npos) // slash in the path already? + { + retpath = sysroot + name; ++ ++ const char *f = retpath.c_str(); ++ if (sysroot != "" ++ && lstat(f, &st) == 0 ++ && S_ISLNK(st.st_mode)) ++ { ++ retpath = follow_link(f, sysroot); ++ } + } + else // Nope, search $PATH. + { +@@ -493,6 +559,16 @@ string find_executable(const string& nam + retpath = fname; + break; + } ++ else if (sysroot != "" ++ && lstat(f, &st) == 0 ++ && S_ISLNK(st.st_mode)) ++ { ++ retpath = follow_link(f, sysroot); ++ if (retpath != "") ++ { ++ break; ++ } ++ } + } + } + } diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch new file mode 100644 index 000000000..b4f2fbc06 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch b/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch new file mode 100644 index 000000000..b7ee0701b --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch @@ -0,0 +1,40 @@ +From 93fc4744fedf6fc593ee656968da97f7b1862ada Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 4 Oct 2016 16:37:53 +0100 +Subject: [PATCH 4/6] systemtap: rationalise dependencies + +Add an option to explicitly disable the monitor (and therefore the dependency on +json-c and ncurses). + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 6bd0c5fc4..2ea9b3cbf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -752,13 +752,16 @@ dnl We want either (or both) python probe support. + AM_CONDITIONAL([HAVE_PYTHON_PROBES], + [test "x$have_python2_support" = "xyes" -o "x$have_python3_support" = "xyes"]) + ++AC_ARG_ENABLE([monitor], AS_HELP_STRING([--disable-monitor],[Disable monitor])) ++if test "$enable_monitor" != "no"; then + dnl Check for presence of json-c and ncurses for use in monitor mode + PKG_CHECK_MODULES([jsonc], [json-c >= 0.12], [have_jsonc=yes], [have_jsonc=no]) + PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no]) +-AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes"]) + if test "${have_jsonc}" == "yes" -a "${have_ncurses}" == yes; then + AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed]) + fi ++fi ++AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes" -a "$enable_monitor" != "no"]) + + AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [ + old_CFLAGS="$CFLAGS" +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch b/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch new file mode 100644 index 000000000..2c860b19e --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch @@ -0,0 +1,33 @@ +From 43f1b04449bb1cf7e0092263f1c2a25f3fca08ef Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 8 Nov 2016 23:07:41 +0000 +Subject: [PATCH 5/6] systemtap: remove explicit msgfmt check + +There is no need to explicitly check that msgfmt was found as the gettext macros +handle this for us if NLS is enabled. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- + configure.ac | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2ea9b3cbf..95417f59c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -36,10 +36,6 @@ AC_CHECK_FUNCS(openat) + AM_GNU_GETTEXT(external) + AM_GNU_GETTEXT_VERSION([0.19.4]) + +-if test "x$GMSGFMT" = "x:"; then +- AC_MSG_ERROR([missing gnu /usr/bin/msgfmt]) +-fi +- + # We want the 'PYTHON' varible to be python version 2. We also want + # our custom 'PYTHON3' varible to be python version 3. + # +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch new file mode 100644 index 000000000..28a7eae40 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/systemtap/systemtap_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap_git.bb new file mode 100644 index 000000000..b280f583e --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap_git.bb @@ -0,0 +1,36 @@ +SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" +HOMEPAGE = "https://sourceware.org/systemtap/" + +require systemtap_git.inc + +DEPENDS = "elfutils" + +EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ + --without-nss --without-avahi --without-dyninst \ + --disable-server --disable-grapher --enable-prologues \ + --with-python3 --without-python2-probes \ + 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 ??= "translator sqlite monitor python3-probes" +PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,python3-core bash perl" +PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" +PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3" +PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c" +PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native" + +inherit autotools gettext pkgconfig distutils3-base + +do_install_append () { + if [ ! -f ${D}${bindir}/stap ]; then + # translator disabled case, need to leave only minimal runtime + rm -rf ${D}${datadir}/${PN} + rm ${D}${libexecdir}/${PN}/stap-env + fi +} + +BBCLASSEXTEND = "nativesdk" diff --git a/poky/meta/recipes-kernel/systemtap/systemtap_git.inc b/poky/meta/recipes-kernel/systemtap/systemtap_git.inc new file mode 100644 index 000000000..e2f5204a0 --- /dev/null +++ b/poky/meta/recipes-kernel/systemtap/systemtap_git.inc @@ -0,0 +1,38 @@ +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +SRCREV = "4051c70c9318c837981384cbb23f3e9eb1bd0892" +PV = "3.2" + +SRC_URI = "git://sourceware.org/git/systemtap.git \ + file://configure-allow-to-disable-libvirt.patch \ + file://x32_abi_time.patch \ + file://monitor-option.patch \ + file://no-msgfmt-check.patch \ + file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \ + file://0001-Install-python-modules-to-correct-library-dir.patch \ + file://0001-buildrun-remove-quotes-around-I-include-line.patch \ + file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ + file://0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch \ + file://0001-Fixes-for-gcc-8.patch \ + file://0001-Use-sysroot-when-looking-for-the-System.map-file.patch \ + file://0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch \ + file://0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch \ + file://0001-sysroot-fix-short-release-r-option-handling.patch \ + file://0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch \ + file://0001-Added-a-couple-of-small-sysroot-fixes.patch \ + file://0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch \ + file://0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch \ + file://0001-sysroot-fix-short-release-r-option-handling-follow-u.patch \ + " + +COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux' +COMPATIBLE_HOST_libc-musl = 'null' + +S = "${WORKDIR}/git" + +# systemtap can't be built without optimization, if someone tries to compile an +# entire image as -O0, break with fatal. +python () { + if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": + bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.") +} diff --git a/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb b/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb new file mode 100644 index 000000000..9a5e8006c --- /dev/null +++ b/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb @@ -0,0 +1,33 @@ +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" + +inherit distro_features_check +ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}" + +EXTRA_OEMAKE = "\ + 'prefix=${prefix}' \ + 'bindir_relative=${@oe.path.relative(prefix, bindir)}' \ + 'libdir=${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 + rm -rf ${D}${sysconfdir}/bash_completion.d/trace-cmd.bash + rmdir ${D}${libdir} +} diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc b/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc new file mode 100644 index 000000000..0a1789c45 --- /dev/null +++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc @@ -0,0 +1,13 @@ +SRCREV = "7d0147bbba3ed1d5ef6eea4eec3f0ad4c98f02b5" +PV = "2.7" + +inherit pkgconfig + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/trace-cmd:" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git \ + file://blktrace-api-compatibility.patch \ + file://0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch \ +" + +S = "${WORKDIR}/git" diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch new file mode 100644 index 000000000..576308356 --- /dev/null +++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch @@ -0,0 +1,27 @@ +From 9488f92c1d0c7931c3e17950d1f9eea2aeb3e2bd Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 14 Jun 2017 15:56:18 +0300 +Subject: [PATCH] Include limits.h so that PATH_MAX is defined (an issue on + musl). + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + trace-listen.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/trace-listen.c b/trace-listen.c +index 17ff9d8..838d6bc 100644 +--- a/trace-listen.c ++++ b/trace-listen.c +@@ -31,6 +31,7 @@ + #include <fcntl.h> + #include <signal.h> + #include <errno.h> ++#include <limits.h> + + #include "trace-local.h" + #include "trace-msg.h" +-- +2.11.0 + diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch new file mode 100644 index 000000000..320db6a32 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb b/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb new file mode 100644 index 000000000..27c7c1975 --- /dev/null +++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb @@ -0,0 +1,34 @@ +SUMMARY = "User interface to Ftrace" +HOMEPAGE = "http://git.kernel.org/" +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=edb195fe538e4552c1f6ca0fd7bf4f0a \ + 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=${libdir}' \ + \ + NO_PYTHON=1 \ +" + +do_compile_prepend() { + # Make sure the recompile is OK + rm -f ${B}/.*.d +} + +do_install() { + oe_runmake DESTDIR="${D}" install +} + |