Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
SUMMARY = "Generates traces of I/O traffic on block devices"
DESCRIPTION = "blktrace is a block layer IO tracing mechanism which provides \
detailed information about request queue operations up to user space. There \
are three major components: a kernel component, a utility to record the i/o \
trace information for the kernel to user space, and utilities to analyse and \
view the trace information."
HOMEPAGE = "http://brick.kernel.dk/snaps/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
DEPENDS = "libaio"
SRCREV = "366d30b9cdb20345c5d064af850d686da79b89eb"
PV = "1.3.0+git"
SRC_URI = "git://git.kernel.dk/blktrace.git;branch=master;protocol=https"
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
}

View File

@@ -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"

View File

@@ -0,0 +1,13 @@
require cryptodev.inc
SUMMARY = "A /dev/crypto device driver kernel module"
inherit module
# Header file provided by a separate package
DEPENDS += "cryptodev-linux"
EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
RCONFLICTS:${PN} = "ocf-linux"
RREPLACES:${PN} = "ocf-linux"

View File

@@ -0,0 +1,17 @@
require cryptodev.inc
SUMMARY = "A test suite for /dev/crypto device driver"
DEPENDS += "openssl"
EXTRA_OEMAKE='KERNEL_DIR="${STAGING_EXECPREFIXDIR}" PREFIX="${D}"'
do_compile() {
oe_runmake tests
}
do_install() {
oe_runmake install_tests
}
FILES:${PN} = "${bindir}/*"

View File

@@ -0,0 +1,18 @@
HOMEPAGE = "http://cryptodev-linux.org/"
DESCRIPTION = "Cryptodev-linux is a device that allows access to Linux kernel \
cryptographic drivers; thus allowing of userspace applications to take advantage \
of hardware accelerators. Cryptodev-linux is implemented as a standalone \
module that requires no dependencies other than a stock linux kernel. Its \
API is compatible with OpenBSD's cryptodev userspace API (/dev/crypto)."
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://github.com/cryptodev-linux/cryptodev-linux;branch=master;protocol=https \
"
SRCREV = "135cbff90af2ba97d88f1472be595ce78721972c"
PV = "1.14"
S = "${WORKDIR}/git"
CLEANBROKEN = "1"

View File

@@ -0,0 +1,29 @@
From 9153522103bd4ed7e3299c4d073f66bb37cb2d42 Mon Sep 17 00:00:00 2001
From: Nikolay Letov <letov.nikolay@gmail.com>
Date: Wed, 22 Feb 2023 13:36:07 +0300
Subject: [PATCH 1/2] meson.build: bump version to 1.7.0
[This was botched in the actual 1.7.0 release :( - David Gibson]
Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=64a907f08b9bedd89833c1eee674148cff2343c6]
Signed-off-by: Nikolay Letov <letov.nikolay@gmail.com>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 78251eb..d88cd9f 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('dtc', 'c',
- version: '1.6.0',
+ version: '1.7.0',
license: ['GPL2+', 'BSD-2'],
default_options: 'werror=true',
)
--
2.30.2

View File

@@ -0,0 +1,38 @@
From 4415b0baece3c4351a6d3637c2754abbefd4795d Mon Sep 17 00:00:00 2001
From: Peter Marko <peter.marko@siemens.com>
Date: Sat, 16 Dec 2023 18:58:31 +0100
Subject: [PATCH 2/2] meson: allow building from shallow clones
When building from shallow clone, tag is not available
and version defaults to git hash.
Problem is that some builds check DTC version and fail the comparison.
Example is https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
Which fails to build with following error:
dtc version too old (039a994), you need at least version 1.4.4
Drop --always from git describe command, see
https://github.com/mesonbuild/meson/blob/1.3.0/mesonbuild/utils/universal.py#L773
This will make it more closer to build via Makefile.
Upstream-Status: Submitted [https://github.com/dgibson/dtc/pull/122]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/meson.build b/meson.build
index 78251eb..fc0c92a 100644
--- a/meson.build
+++ b/meson.build
@@ -56,6 +56,7 @@ py = py.find_installation(required: get_option('python'))
swig = find_program('swig', required: get_option('python'))
version_gen_h = vcs_tag(
+ command: ['git', 'describe', '--dirty=+'],
input: 'version_gen.h.in',
output: 'version_gen.h',
)
--
2.30.2

View File

@@ -0,0 +1,34 @@
SUMMARY = "Device Tree Compiler"
HOMEPAGE = "https://devicetree.org/"
DESCRIPTION = "The Device Tree Compiler is a toolchain for working with device tree source and binary files."
SECTION = "bootloader"
LICENSE = "GPL-2.0-only | BSD-2-Clause"
LIC_FILES_CHKSUM = "file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 \
file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e"
SRC_URI = " \
git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https \
file://0001-meson.build-bump-version-to-1.7.0.patch \
file://0002-meson-allow-building-from-shallow-clones.patch \
"
SRCREV = "039a99414e778332d8f9c04cbd3072e1dcc62798"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
S = "${WORKDIR}/git"
inherit meson pkgconfig
EXTRA_OEMESON = "-Dpython=disabled -Dvalgrind=disabled"
PACKAGECONFIG ??= "tools"
PACKAGECONFIG[tools] = "-Dtools=true,-Dtools=false,flex-native bison-native"
PACKAGECONFIG[yaml] = "-Dyaml=enabled,-Dyaml=disabled,libyaml"
PACKAGES =+ "${PN}-misc"
FILES:${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
RDEPENDS:${PN}-misc += "${@bb.utils.contains('PACKAGECONFIG', 'tools', 'bash diffutils', '', d)}"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,20 @@
#!/bin/sh
# dt-doc-validate wrapper to allow kernel dt-validation to pass
#
# Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com>
# License: MIT (see COPYING.MIT at the root of the repository for terms)
for arg; do
case "$arg" in
--version)
echo "v2021.10"
;;
esac
done
# TBD: left for future consideration
# exec dt-doc-validate.real "$@"
# we always succeed
exit 0

View File

@@ -0,0 +1,20 @@
#!/bin/sh
# dt-mk-schema wrapper to allow kernel dt-validation to pass
#
# Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com>
# License: MIT (see COPYING.MIT at the root of the repository for terms)
for arg; do
case "$arg" in
--version)
echo "v2021.10"
;;
esac
done
# TBD: left for future consideration
# exec dt-mk-schema.real "$@"
# we always succeed
exit 0

View File

@@ -0,0 +1,20 @@
#!/bin/sh
# dt-validate wrapper to allow kernel dt-validation to pass
#
# Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com>
# License: MIT (see COPYING.MIT at the root of the repository for terms)
for arg; do
case "$arg" in
--version)
echo "v2021.10"
;;
esac
done
# TBD: left for future consideration
# exec dt-validate.real "$@"
# we always succeed
exit 0

View File

@@ -0,0 +1,17 @@
SUMMARY = "Wrapper for tooling for devicetree validation using YAML and jsonschema"
HOMEPAGE = "https://yoctoproject.org"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = "file://dt-doc-validate \
file://dt-mk-schema \
file://dt-validate"
do_install() {
install -d ${D}${bindir}/
install -m 755 ${WORKDIR}/dt-doc-validate ${D}${bindir}/
install -m 755 ${WORKDIR}/dt-mk-schema ${D}${bindir}/
install -m 755 ${WORKDIR}/dt-validate ${D}${bindir}/
}
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,32 @@
SUMMARY = "Tools for managing Yocto Project style branched kernels"
DESCRIPTION = "Powerful set of tools or managing Yocto Linux kernel sources \
and configuration data. You can use these tools to make a single configuration \
change, apply multiple patches, or work with your own kernel sources."
HOMEPAGE = "https://www.yoctoproject.org/"
LICENSE = "GPL-2.0-only & MIT"
LIC_FILES_CHKSUM = "\
file://tools/kgit;beginline=5;endline=9;md5=9c30e971d435e249624278c3e343e501 \
file://Kconfiglib/LICENSE.txt;md5=712177a72a3937909543eda3ad1bfb7c \
"
DEPENDS += "git-replacement-native"
SRCREV = "7160ebe8b865dd6028aef278efa219433db93f7e"
PV = "0.3+git"
inherit native
SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
do_configure() {
:
}
do_compile() {
:
}
do_install() {
oe_runmake DESTDIR=${D}${bindir} install
}

View File

@@ -0,0 +1,70 @@
From d48ec5e1a5fb7907520dee71b1d94045486a0c29 Mon Sep 17 00:00:00 2001
From: Alexander Kamensky <alexander.kamensky42@gmail.com>
Date: Thu, 12 Nov 2020 12:56:46 -0800
Subject: [PATCH] arm64: kexec: disabled check if kaslr-seed dtb property was
wiped
Kexec when loading arm64 kernel checks if chosen/kaslr-seed dtb property is
wiped. It's a good assertion to verify proper behavior of kernel. However,
if bootloader creates and fills kaslr-seed property and kernel is not
configured with CONFIG_RANDOMIZE_BASE then logic of reading and wiping
kaslr-seed does not run. As a result kaslr-seed property is not zero and when
kexec tries to load secondary kernel it fails with the following message:
setup_2nd_dtb: kaslr-seed is not wiped to 0.
kexec: setup_2nd_dtb failed.
kexec: load failed.
This was observed on Yocto Project on qemuarm64 machine with 5.8 kernel,
qemu 5.1.0. Qemu created kaslr-seed property but kernel was not configured
with CONFIG_RANDOMIZE_BASE.
Although check has some value, there is a use-case where it breaks kexec,
this patch removes it.
Note in described use-case the fact that kaslr-seed is not wiped and user
readable through /sys/firmware/fdt or
/sys/firmware/devicetree/base/chosen/kaslr-seed is not a security problem
as kaslr is disabled anyway.
Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com>
Upstream-Status: Submitted [http://lists.infradead.org/pipermail/kexec/2020-November/021740.html]
---
kexec/arch/arm64/kexec-arm64.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index ec6df4b..10238d9 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -503,7 +503,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
int len, range_len;
int nodeoffset;
int new_size;
- int i, result, kaslr_seed;
+ int i, result;
result = fdt_check_header(dtb->buf);
@@ -576,18 +576,6 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
return result;
}
} else {
- kaslr_seed = fdt64_to_cpu(*prop);
-
- /* kaslr_seed must be wiped clean by primary
- * kernel during boot
- */
- if (kaslr_seed != 0) {
- dbgprintf("%s: kaslr-seed is not wiped to 0.\n",
- __func__);
- result = -EINVAL;
- goto on_error;
- }
-
/*
* Invoke the getrandom system call with
* GRND_NONBLOCK, to make sure we
--
2.25.1

View File

@@ -0,0 +1,35 @@
From 211cae4b6a02a4d9d37bfcd76f3702696e095fc3 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(-)
diff --git a/kexec/arch/ppc/kexec-ppc.h b/kexec/arch/ppc/kexec-ppc.h
index 04e728e..6bae9ec 100644
--- a/kexec/arch/ppc/kexec-ppc.h
+++ b/kexec/arch/ppc/kexec-ppc.h
@@ -44,7 +44,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 {

View File

@@ -0,0 +1,54 @@
From 32c8ffa7ace6f1b7e63f9ddffab00b00c36a7b57 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 15 May 2024 21:18:08 -0700
Subject: [PATCH] x86-linux-setup.c: Use POSIX basename API
Musl C library only supports POSIX basename function. while glibc has
both GNU extention as well as POSIX basename implemented. Switch to
using posix version, so it can work across musl and glibc
basename prototype has been removed from string.h from latest musl [1]
compilers e.g. clang-18/GCC-14 flags the absense of prototype as error.
therefore include libgen.h for providing it.
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Upstream-Status: Submitted [https://lists.infradead.org/pipermail/kexec/2024-May/030034.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
kexec/arch/i386/x86-linux-setup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
index 9a281dc..73251b9 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -14,6 +14,7 @@
*
*/
#define _GNU_SOURCE
+#include <libgen.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -329,12 +330,14 @@ static int add_edd_entry(struct x86_linux_param_header *real_mode,
memset(edd_info, 0, sizeof(struct edd_info));
/* extract the device number */
- if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
+ char* sysfs_name_copy = strdup(sysfs_name);
+ if (sscanf(basename(sysfs_name_copy), "int13_dev%hhx", &devnum) != 1) {
fprintf(stderr, "Invalid format of int13_dev dir "
- "entry: %s\n", basename(sysfs_name));
+ "entry: %s\n", basename(sysfs_name_copy));
+ free(sysfs_name_copy);
return -1;
}
-
+ free(sysfs_name_copy);
/* if there's a MBR signature, then add it */
if (file_scanf(sysfs_name, "mbr_signature", "0x%x", &mbr_sig) == 1) {
real_mode->edd_mbr_sig_buffer[*current_mbr] = mbr_sig;
--
2.45.1

View File

@@ -0,0 +1,30 @@
From e5bc9fbd6029057a4e3815a5326af5bd83a450e6 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 4d2d071..6673423 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)

View File

@@ -0,0 +1,50 @@
From b62c1da8f8e641397add10367ee9c4cfdedb1cc0 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: Submitted [via email to horms@kernel.org,http://lists.infradead.org/pipermail/kexec/2024-April/029903.html]
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 1ec1826..cc20f63 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -242,6 +242,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
@@ -283,6 +284,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,
@@ -304,8 +306,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);

View File

@@ -0,0 +1,29 @@
From 494888bcc3bbf070dfce1b2686ee34c8619aa33d 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 6673423..a7405ea 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -60,7 +60,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)

View File

@@ -0,0 +1,95 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Michel Lind <salimma@fedoraproject.org>
Date: Tue, 30 Jan 2024 04:14:31 -0600
Subject: [PATCH] Fix building on x86_64 with binutils 2.41
Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".
Fix by moving ".arch i386" below the relevant ".code32" directive, so
that the assembler is no longer expecting 64-bit instructions to be used
by the time that the ".arch i386" directive is encountered.
Based on similar iPXE fix:
https://github.com/ipxe/ipxe/commit/6ca597eee
Signed-off-by: Michel Lind <michel@michel-slm.name>
Signed-off-by: Simon Horman <horms@kernel.org>
Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?h=main&id=328de8e00e298f00d7ba6b25dc3950147e9642e6]
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
purgatory/arch/i386/entry32-16-debug.S | 2 +-
purgatory/arch/i386/entry32-16.S | 2 +-
purgatory/arch/i386/entry32.S | 2 +-
purgatory/arch/i386/setup-x86.S | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
index 5167944..12e1164 100644
--- a/purgatory/arch/i386/entry32-16-debug.S
+++ b/purgatory/arch/i386/entry32-16-debug.S
@@ -25,10 +25,10 @@
.globl entry16_debug_pre32
.globl entry16_debug_first32
.globl entry16_debug_old_first32
- .arch i386
.balign 16
entry16_debug:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
index c051aab..eace095 100644
--- a/purgatory/arch/i386/entry32-16.S
+++ b/purgatory/arch/i386/entry32-16.S
@@ -20,10 +20,10 @@
#undef i386
.text
.globl entry16, entry16_regs
- .arch i386
.balign 16
entry16:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
index f7a494f..8ce9e31 100644
--- a/purgatory/arch/i386/entry32.S
+++ b/purgatory/arch/i386/entry32.S
@@ -20,10 +20,10 @@
#undef i386
.text
- .arch i386
.globl entry32, entry32_regs
entry32:
.code32
+ .arch i386
/* Setup a gdt that should that is generally usefully */
lgdt %cs:gdt
diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
index 201bb2c..a212eed 100644
--- a/purgatory/arch/i386/setup-x86.S
+++ b/purgatory/arch/i386/setup-x86.S
@@ -21,10 +21,10 @@
#undef i386
.text
- .arch i386
.globl purgatory_start
purgatory_start:
.code32
+ .arch i386
/* Load a gdt so I know what the segment registers are */
lgdt %cs:gdt
--
2.39.2

View File

@@ -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 $?

View File

@@ -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`"

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Reboot and dump vmcore via kexec
DefaultDependencies=no
Requires=sysinit.target
After=sysinit.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@LIBEXECDIR@/kdump-helper start
ExecStop=@LIBEXECDIR@/kdump-helper stop
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,87 @@
SUMMARY = "Kexec fast reboot tools"
DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
SECTION = "kernel/userland"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
DEPENDS = "zlib xz"
SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
file://kdump \
file://kdump.conf \
file://kdump.service \
file://0001-powerpc-change-the-memory-size-limit.patch \
file://0002-purgatory-Pass-r-directly-to-linker.patch \
file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
file://0005-Disable-PIE-during-link.patch \
file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \
file://Fix-building-on-x86_64-with-binutils-2.41.patch \
file://0001-x86-linux-setup.c-Use-POSIX-basename-API.patch \
"
SRC_URI[sha256sum] = "f33d2660b3e38d25a127e87097978e0f7a9a73ab5151a29eb80974d169ff6a29"
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_system_unitdir}/kdump.service
sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/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_system_unitdir}/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 ."
SYSTEMD_PACKAGES = "kdump"
SYSTEMD_SERVICE:kdump = "kdump.service"
SECURITY_PIE_CFLAGS:remove = "-fPIE -pie"
COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
INSANE_SKIP:${PN} = "arch"

View File

@@ -0,0 +1,55 @@
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 [KERNEL_PACKAGE_NAME]" >&2
exit 1
fi
kernelpkgname="kernel"
# If no KERNEL_PACKAGE_NAME, assume "kernel".
[ -z "\$5" ] || kernelpkgname="\$5"
kernelabi=""
if [ -r "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion" ]; then
kernelabi=\$(cat "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion")
fi
if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then
mkdir -p "\$3${nonarch_base_libdir}/depmod.d"
echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf"
fi
if [ ! -r ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then
echo "Unable to read: ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" >&2
exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
else
exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" "\$4"
fi
EOF
chmod +x ${D}${bindir_crossscripts}/depmodwrapper
}
SYSROOT_DIRS += "${bindir_crossscripts}"
PACKAGES = ""
inherit nopackages

View File

@@ -0,0 +1,136 @@
From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 9 Dec 2023 17:35:59 -0800
Subject: [PATCH] Use portable implementation for basename API
musl has removed the non-prototype declaration of basename from
string.h [1] which now results in build errors with clang-17+ compiler
Implement GNU basename behavior using strchr which is portable across libcs
Fixes
../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
71 | "Commands:\n", basename(argv[0]));
| ^
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Upstream-Status: Submitted [https://github.com/kmod-project/kmod/pull/32]
Suggested-by: Rich Felker
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
libkmod/libkmod-config.c | 2 +-
shared/util.c | 4 ++--
shared/util.h | 7 +++++++
testsuite/testsuite.c | 2 +-
tools/depmod.c | 2 +-
tools/kmod.c | 4 ++--
6 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index e83621b..8aa555a 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx,
bool is_single = false;
if (name == NULL) {
- name = basename(path);
+ name = gnu_basename(path);
is_single = true;
}
diff --git a/shared/util.c b/shared/util.c
index e2bab83..0e16670 100644
--- a/shared/util.c
+++ b/shared/util.c
@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t *
char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len)
{
- char *modname;
+ const char *modname;
- modname = basename(path);
+ modname = gnu_basename(path);
if (modname == NULL || modname[0] == '\0')
return NULL;
diff --git a/shared/util.h b/shared/util.h
index c4a3916..073dc5a 100644
--- a/shared/util.h
+++ b/shared/util.h
@@ -5,6 +5,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
@@ -76,6 +77,12 @@ do { \
__p->__v = (val); \
} while(0)
+static _always_inline_ const char *gnu_basename(const char *s)
+{
+ const char *p = strrchr(s, '/');
+ return p ? p+1 : s;
+}
+
static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u)
{
return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1));
diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c
index 318343a..aafc987 100644
--- a/testsuite/testsuite.c
+++ b/testsuite/testsuite.c
@@ -70,7 +70,7 @@ static void help(void)
printf("Usage:\n"
"\t%s [options] <test>\n"
- "Options:\n", basename(progname));
+ "Options:\n", gnu_basename(progname));
for (itr = options, itr_short = options_short;
itr->name != NULL; itr++, itr_short++)
diff --git a/tools/depmod.c b/tools/depmod.c
index 43fc354..cfb15b1 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files
if (name != NULL)
namelen = strlen(name);
else {
- name = basename(dir);
+ name = gnu_basename(dir);
namelen = strlen(name);
dirlen -= namelen + 1;
}
diff --git a/tools/kmod.c b/tools/kmod.c
index 55689c0..df91e5c 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[])
"Options:\n"
"\t-V, --version show version\n"
"\t-h, --help show this help\n\n"
- "Commands:\n", basename(argv[0]));
+ "Commands:\n", gnu_basename(argv[0]));
for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) {
if (kmod_cmds[i]->help != NULL) {
@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[])
const char *cmd;
size_t i;
- cmd = basename(argv[0]);
+ cmd = gnu_basename(argv[0]);
for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) {
if (streq(kmod_compat_cmds[i]->name, cmd))
--
2.43.0

View File

@@ -0,0 +1,32 @@
From be6f82c54f694617c646ca1f8b5bcf93694e20ad Mon Sep 17 00:00:00 2001
From: Tudor Florea <tudor.florea@enea.com>
Date: Fri, 6 Sep 2013 21:11:57 +0000
Subject: [PATCH] kmod: avoid parallel-tests
Avoid parallel-tests as it remove
buildtest-TESTS and runtest-TESTS targets required by ptest.
In automake 1.13.4 parallel-tests is assumed by defauls.
In order to have buildtest-TESTS and runtest-TESTS targets
serial-tests is now required
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Upstream-Status: Inappropriate (disable feature incompatible with ptest)
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ee72283..60980c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,8 +14,8 @@ 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])
AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])])

View File

@@ -0,0 +1,6 @@
#
# /etc/depmod.d/depmod.conf
#
search updates extramodules built-in

View File

@@ -0,0 +1,33 @@
From dd59095f70f774f6d1e767010e25b35ef6db4c4b Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Fri, 8 Dec 2023 22:35:45 +0000
Subject: [PATCH] configure: set docdir in GTK_DOC_CHECK
By passing --docdir in the GTK_DOC_CHECK arguments (to match
autogen.sh) autoreconf will work out of the box.
Without this autoreconf fails due to the documentation not being in
./docs, the default location.
Upstream-Status: Submitted [https://lore.kernel.org/linux-modules/20231208224511.1363066-1-ross.burton@arm.com/T/#u]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index de01e08..67696c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,7 +255,7 @@ AS_IF([test "x$enable_coverage" = "xyes"], [
AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"])
m4_ifdef([GTK_DOC_CHECK], [
-GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
+GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat --docdir libkmod/docs])
], [
AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
--
2.34.1

View File

@@ -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 {} \;

View File

@@ -0,0 +1,89 @@
# 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://kernel.org/pub/linux/utils/kernel/kmod/"
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
LICENSE:libkmod = "LGPL-2.1-or-later"
SECTION = "base"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \
"
inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives
SRCREV = "aff617ea871d0568cc491bd116c0be1e857463bb"
SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master;protocol=https \
file://depmod-search.conf \
file://avoid_parallel_tests.patch \
file://0001-Use-portable-implementation-for-basename-API.patch \
file://gtkdocdir.patch \
"
S = "${WORKDIR}/git"
EXTRA_OECONF += "--enable-tools"
PACKAGECONFIG ??= "zlib xz openssl"
PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz"
PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
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
EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}"
do_install:append () {
install -dm755 ${D}${base_bindir}
install -dm755 ${D}${base_sbindir}
# add symlinks to kmod
ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
for tool in insmod rmmod depmod modinfo modprobe; do
ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
done
# configuration directories
install -dm755 ${D}${nonarch_base_libdir}/depmod.d
install -dm755 ${D}${nonarch_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}${nonarch_base_libdir}/depmod.d/search.conf"
# Add .debug to the exclude path for depmod
echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf
}
ALTERNATIVE_PRIORITY = "70"
ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/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}"
PACKAGES =+ "libkmod"
FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,74 @@
Fixes for the Meson build of libtraceevent:
- Make the plugin directory the same as the Makefiles
- Install the plugins as modules not static and versioned shared libraries
- Add an option to disable building the documentation (needs asciidoc and xmlto)
Upstream-Status: Submitted [https://lore.kernel.org/linux-trace-devel/20240311111140.1789879-1-alex@linutronix.de/T/#u]
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/meson.build b/meson.build
index b61c873..4bba4d8 100644
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,7 @@ htmldir = join_paths(prefixdir, get_option('htmldir'))
libdir = join_paths(prefixdir, get_option('libdir'))
plugindir = get_option('plugindir')
if plugindir == ''
- plugindir = join_paths(libdir, 'libtraceevent/plugins')
+ plugindir = join_paths(libdir, 'traceevent/plugins')
endif
add_project_arguments(
@@ -45,10 +45,13 @@ if cunit_dep.found()
subdir('utest')
endif
subdir('samples')
-subdir('Documentation')
-custom_target(
- 'docs',
- output: 'docs',
- depends: [html, man],
- command: ['echo'])
+if get_option('docs')
+ subdir('Documentation')
+
+ custom_target(
+ 'docs',
+ output: 'docs',
+ depends: [html, man],
+ command: ['echo'])
+endif
diff --git a/meson_options.txt b/meson_options.txt
index b2294f6..0611216 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,6 +4,10 @@
option('plugindir', type : 'string',
description : 'set the plugin dir')
+
+option('docs', type : 'boolean', value: true,
+ description : 'build documentation')
+
option('htmldir', type : 'string', value : 'share/doc/libtraceevent-doc',
description : 'directory for HTML documentation')
option('asciidoctor', type : 'boolean', value: false,
diff --git a/plugins/meson.build b/plugins/meson.build
index 74ad664..4919be4 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -19,11 +19,10 @@ plugins = [
pdeps = []
foreach plugin : plugins
- pdeps += library(
+ pdeps += shared_module(
plugin.replace('.c', ''),
plugin,
name_prefix: '',
- version: library_version,
dependencies: [libtraceevent_dep],
include_directories: [incdir],
install: true,

View File

@@ -0,0 +1,23 @@
# Copyright (C) 2022 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "API to access the kernel tracefs directory"
HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/"
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \
file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd"
SECTION = "libs"
SRCREV = "dd148189b74da3e2f45c7e536319fec97cb71213"
SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \
file://meson.patch"
S = "${WORKDIR}/git"
inherit meson pkgconfig
EXTRA_OEMESON = "-Ddocs=false"
PACKAGES += "${PN}-plugins"
FILES:${PN}-plugins += "${libdir}/traceevent/plugins"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,112 @@
SUMMARY = "Sanitized set of kernel headers for the C library's use"
HOMEPAGE = "https://www.kernel.org/"
DESCRIPTION = "Designed to maintain an Application Programming Interface (API) stable version of the Linux headers"
SECTION = "devel"
LICENSE = "GPL-2.0-only"
#########################################################################
#### 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_BUILDDIR 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=bbea815ee2795b2f4230826c0c6b8814"
RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process"
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")
elif major == "5":
d.setVar("HEADER_FETCH_VER", "5.x")
elif major == "6":
d.setVar("HEADER_FETCH_VER", "6.x")
else:
d.setVar("HEADER_FETCH_VER", "2.6")
}
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[0]}"
MIN_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[1]}"
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[noexec] = "1"
do_compile[noexec] = "1"
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:append:armeb () {
do_install_armmultilib
}
do_install_armmultilib () {
if [ ${MAJ_VER} -gt 5 ]; then
ARM_KVM_HEADER=""
else
if [ ${MAJ_VER} -eq 5 ] && [ ${MIN_VER} -ge 8 ]; then
ARM_KVM_HEADER=""
else
ARM_KVM_HEADER="asm/kvm.h"
fi
fi
oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h $ARM_KVM_HEADER 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"
DEV_PKG_DEPENDENCY = ""
RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS += "unifdef-native bison-native rsync-native"

View File

@@ -0,0 +1,40 @@
From 06e785aeb9ea8a43d0a3967c1ba6e69d758e82d4 Mon Sep 17 00:00:00 2001
From: Matt Jan <zoo868e@gmail.com>
Date: Tue, 14 May 2024 12:10:46 +0800
Subject: [PATCH] connector: Fix invalid conversion in cn_proc.h
The implicit conversion from unsigned int to enum
proc_cn_event is invalid, so explicitly cast it
for compilation in a C++ compiler.
/usr/include/linux/cn_proc.h: In function 'proc_cn_event valid_event(proc_cn_event)':
/usr/include/linux/cn_proc.h:72:17: error: invalid conversion from 'unsigned int' to 'proc_cn_event' [-fpermissive]
72 | ev_type &= PROC_EVENT_ALL;
| ^
| |
| unsigned int
Signed-off-by: Matt Jan <zoo868e@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9258d795978f398ecf2d222a8388cff81d37d34d]
---
include/uapi/linux/cn_proc.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
index f2afb7cc4926..18e3745b86cd 100644
--- a/include/uapi/linux/cn_proc.h
+++ b/include/uapi/linux/cn_proc.h
@@ -69,8 +69,7 @@ struct proc_input {
static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type)
{
- ev_type &= PROC_EVENT_ALL;
- return ev_type;
+ return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL);
}
/*
--
2.50.1

View File

@@ -0,0 +1,38 @@
From 9ca6c6a510bda90954aa2532711200b89dd1df89 Mon Sep 17 00:00:00 2001
From: Dave Martin <Dave.Martin@arm.com>
Date: Tue, 11 Dec 2018 19:26:45 +0000
Subject: [PATCH 1/3] kbuild: install_headers.sh: Strip _UAPI from
#if-defined() guards
install_headers.sh knows how to strip the _UAPI prefix from #ifdef/
ifndef and #define directives used to guard headers against multiple
or inappropriate inclusion. Currently this does not work for guards
in the "#if defined()" style, which may be needed for non-trivial
cases.
This patch adds similar logic so that the _UAPI prefix is also
stripped from guard directives written using "#if defined()" etc.
This is not completely foolproof, but will work for simple cases of
using #if defined() to guard against inappropriate header inclusion.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Upstream-Status: Submitted [https://www.spinics.net/lists/arm-kernel/msg694800.html]
---
scripts/headers_install.sh | 1 +
1 file changed, 1 insertion(+)
Index: linux-5.4/scripts/headers_install.sh
===================================================================
--- linux-5.4.orig/scripts/headers_install.sh
+++ linux-5.4/scripts/headers_install.sh
@@ -36,6 +36,7 @@
s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g
s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g
s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @
+ :1;s/(#(if|elif)(.*[^A-Za-z0-9_])defined\([[:space:]]*)_UAPI/\1/;t1
' $INFILE > $TMPFILE || exit 1
scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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-5.12.11/include/uapi/linux/kernel.h
===================================================================
--- linux-5.12.11.orig/include/uapi/linux/kernel.h
+++ linux-5.12.11/include/uapi/linux/kernel.h
@@ -2,7 +2,9 @@
#ifndef _UAPI_LINUX_KERNEL_H
#define _UAPI_LINUX_KERNEL_H
+#ifdef __GLIBC__
#include <linux/sysinfo.h>
#include <linux/const.h>
+#endif
#endif /* _UAPI_LINUX_KERNEL_H */

View File

@@ -0,0 +1,18 @@
require linux-libc-headers.inc
SRC_URI:append:libc-musl = "\
file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.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 \
"
SRC_URI += "\
file://0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch \
file://0001-connector-Fix-invalid-conversion-in-cn_proc.h.patch \
"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
SRC_URI[sha256sum] = "d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0"

View File

@@ -0,0 +1,34 @@
CVE_STATUS[CVE-1999-0656] = "not-applicable-config: specific to ugidd, part of the old user-mode NFS server"
CVE_STATUS[CVE-2006-2932] = "not-applicable-platform: specific to RHEL"
CVE_STATUS[CVE-2007-2764] = "not-applicable-platform: specific to Sun/Brocade SilkWorm switches"
CVE_STATUS[CVE-2007-4998] = "cpe-incorrect: a historic cp bug, no longer an issue as per https://bugzilla.redhat.com/show_bug.cgi?id=356471#c5"
CVE_STATUS[CVE-2008-2544] = "disputed: not an issue as per https://bugzilla.redhat.com/show_bug.cgi?id=449089#c22"
CVE_STATUS[CVE-2010-0298] = "fixed-version: 2.6.34 (1871c6)"
CVE_STATUS[CVE-2014-2648] = "cpe-incorrect: not Linux"
CVE_STATUS[CVE-2016-0774] = "ignored: result of incomplete backport"
CVE_STATUS[CVE-2016-3695] = "not-applicable-platform: specific to RHEL with securelevel patches"
CVE_STATUS[CVE-2016-3699] = "not-applicable-platform: specific to RHEL with securelevel patches"
CVE_STATUS[CVE-2017-6264] = "not-applicable-platform: Android specific"
CVE_STATUS[CVE-2017-1000377] = "not-applicable-platform: GRSecurity specific"
CVE_STATUS[CVE-2018-6559] = "not-applicable-platform: Issue only affects Ubuntu"
CVE_STATUS[CVE-2020-11935] = "not-applicable-config: Issue only affects aufs, which is not in linux-yocto"
# Introduced in version v6.1 7b88bda3761b95856cf97822efe8281c8100067b
# Patched in kernel since v6.2 4a625ceee8a0ab0273534cb6b432ce6b331db5ee
# But, the CVE is disputed:
CVE_STATUS[CVE-2023-23005] = "disputed: There are no realistic cases \
in which a user can cause the alloc_memory_type error case to be reached. \
See: https://bugzilla.suse.com/show_bug.cgi?id=1208844#c2"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,98 @@
#! /usr/bin/env python3
# Generate granular CVE status metadata for a specific version of the kernel
# using data from linuxkernelcves.com.
#
# SPDX-License-Identifier: GPL-2.0-only
import argparse
import datetime
import json
import pathlib
import re
from packaging.version import Version
def parse_version(s):
"""
Parse the version string and either return a packaging.version.Version, or
None if the string was unset or "unk".
"""
if s and s != "unk":
# packaging.version.Version doesn't approve of versions like v5.12-rc1-dontuse
s = s.replace("-dontuse", "")
return Version(s)
return None
def main(argp=None):
parser = argparse.ArgumentParser()
parser.add_argument("datadir", type=pathlib.Path, help="Path to a clone of https://github.com/nluedtke/linux_kernel_cves")
parser.add_argument("version", type=Version, help="Kernel version number to generate data for, such as 6.1.38")
args = parser.parse_args(argp)
datadir = args.datadir
version = args.version
base_version = f"{version.major}.{version.minor}"
with open(datadir / "data" / "kernel_cves.json", "r") as f:
cve_data = json.load(f)
with open(datadir / "data" / "stream_fixes.json", "r") as f:
stream_data = json.load(f)
print(f"""
# Auto-generated CVE metadata, DO NOT EDIT BY HAND.
# Generated at {datetime.datetime.now(datetime.timezone.utc)} for version {version}
python check_kernel_cve_status_version() {{
this_version = "{version}"
kernel_version = d.getVar("LINUX_VERSION")
if kernel_version != this_version:
bb.warn("Kernel CVE status needs updating: generated for %s but kernel is %s" % (this_version, kernel_version))
}}
do_cve_check[prefuncs] += "check_kernel_cve_status_version"
""")
for cve, data in cve_data.items():
if "affected_versions" not in data:
print(f"# Skipping {cve}, no affected_versions")
print()
continue
affected = data["affected_versions"]
first_affected, fixed = re.search(r"(.+) to (.+)", affected).groups()
first_affected = parse_version(first_affected)
fixed = parse_version(fixed)
if not fixed:
print(f"# {cve} has no known resolution")
elif first_affected and version < first_affected:
print(f'CVE_STATUS[{cve}] = "fixed-version: only affects {first_affected} onwards"')
elif fixed <= version:
print(
f'CVE_STATUS[{cve}] = "fixed-version: Fixed from version {fixed}"'
)
else:
if cve in stream_data:
backport_data = stream_data[cve]
if base_version in backport_data:
backport_ver = Version(backport_data[base_version]["fixed_version"])
if backport_ver <= version:
print(
f'CVE_STATUS[{cve}] = "cpe-stable-backport: Backported in {backport_ver}"'
)
else:
# TODO print a note that the kernel needs bumping
print(f"# {cve} needs backporting (fixed from {backport_ver})")
else:
print(f"# {cve} needs backporting (fixed from {fixed})")
else:
print(f"# {cve} needs backporting (fixed from {fixed})")
print()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,407 @@
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 = "GPL-2.0-only"
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"
deltask do_populate_sysroot
S = "${STAGING_KERNEL_DIR}"
B = "${STAGING_KERNEL_BUILDDIR}"
PACKAGE_ARCH = "${MACHINE_ARCH}"
KERNEL_BUILD_ROOT="${nonarch_base_libdir}/modules/"
do_install() {
kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
install -d $kerneldir
# create the directory structure
rm -f $kerneldir/build
rm -f $kerneldir/source
mkdir -p $kerneldir/build
# for compatibility with some older variants of this package, we
# create a /usr/src/kernel symlink to /lib/modules/<version>/source
mkdir -p ${D}/usr/src
(
cd ${D}/usr/src
ln -rs ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
)
# for on target purposes, we unify build and source
(
cd $kerneldir
ln -s build source
)
# first copy everything
(
cd ${S}
cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build
cp --parents $(find -type f -name "Build" -o -name "Build.include") $kerneldir/build
)
# then drop all but the needed Makefiles/Kconfig files
rm -rf $kerneldir/build/scripts
rm -rf $kerneldir/build/include
# now copy in parts from the build that we'll need later
(
cd ${B}
if [ -s Module.symvers ]; then
cp Module.symvers $kerneldir/build
fi
cp System.map* $kerneldir/build
if [ -s Module.markers ]; then
cp Module.markers $kerneldir/build
fi
cp -a .config $kerneldir/build
# This scripts copy blow up QA, so for now, we require a more
# complex 'make scripts' to restore these, versus copying them
# here. Left as a reference to indicate that we know the scripts must
# be dealt with.
# cp -a scripts $kerneldir/build
# although module.lds can be regenerated on target via 'make modules_prepare'
# there are several places where 'makes scripts prepare' is done, and that won't
# regenerate the file. So we copy it onto the target as a migration to using
# modules_prepare
cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
if [ -d arch/${ARCH}/scripts ]; then
cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
fi
if [ -f arch/${ARCH}/*lds ]; then
cp -a arch/${ARCH}/*lds $kerneldir/build/arch/${ARCH}
fi
rm -f $kerneldir/build/scripts/*.o
rm -f $kerneldir/build/scripts/*/*.o
if [ "${ARCH}" = "powerpc" ]; then
if [ -e arch/powerpc/lib/crtsavres.S ] ||
[ -e arch/powerpc/lib/crtsavres.o ]; then
cp -a --parents arch/powerpc/lib/crtsavres.[So] $kerneldir/build/
fi
fi
if [ "${ARCH}" = "arm64" -o "${ARCH}" = "riscv" ]; then
if [ -e arch/${ARCH}/kernel/vdso/vdso.lds ]; then
cp -a --parents arch/${ARCH}/kernel/vdso/vdso.lds $kerneldir/build/
fi
fi
if [ "${ARCH}" = "powerpc" ]; then
cp -a --parents arch/powerpc/kernel/vdso32/vdso32.lds $kerneldir/build 2>/dev/null || :
cp -a --parents arch/powerpc/kernel/vdso64/vdso64.lds $kerneldir/build 2>/dev/null || :
# v5.19+
cp -a --parents arch/powerpc/kernel/vdso/vdso*.lds $kerneldir/build 2>/dev/null || :
fi
cp -a include $kerneldir/build/include
# we don't usually copy generated files, since they can be rebuilt on the target,
# but without this file, we get a forced syncconfig run in v5.8+, which prompts and
# breaks workflows.
cp -a --parents include/generated/autoconf.h $kerneldir/build 2>/dev/null || :
rm -f $kerneldir/include/generated/.vdso-offsets.h.cmd
rm -f $kerneldir/build/include/generated/.vdso-offsets.h.cmd
rm -f $kerneldir/build/include/generated/.compat_vdso-offsets.h.cmd
rm -f $kerneldir/build/include/generated/.vdso32-offsets.h.cmd
rm -f $kerneldir/build/include/generated/.vdso64-offsets.h.cmd
)
# now grab the chunks from the source tree that we need
(
cd ${S}
cp -a scripts $kerneldir/build
# for v6.1+ (otherwise we are missing multiple default targets)
cp -a --parents Kbuild $kerneldir/build 2>/dev/null || :
# For v6.6+ the debian packing is moved out to seperate rules file
# Remove as we else would ned to RDEPEND on make
rm $kerneldir/build/scripts/package/debian/rules 2>/dev/null || :
# if our build dir had objtool, it will also be rebuilt on target, so
# we copy what is required for that build
if [ -f ${B}/tools/objtool/objtool ]; then
# these are a few files associated with objtool, since we'll need to
# rebuild it
cp -a --parents tools/build/Build.include $kerneldir/build/
cp -a --parents tools/build/Build $kerneldir/build/
cp -a --parents tools/build/fixdep.c $kerneldir/build/
cp -a --parents tools/scripts/utilities.mak $kerneldir/build/
# extra files, just in case
cp -a --parents tools/objtool/* $kerneldir/build/
cp -a --parents tools/lib/* $kerneldir/build/
cp -a --parents tools/lib/subcmd/* $kerneldir/build/
cp -a --parents tools/include/* $kerneldir/build/
cp -a --parents $(find tools/arch/${ARCH}/ -type f) $kerneldir/build/
fi
if [ "${ARCH}" = "arm64" ]; then
# arch/arm64/include/asm/xen references arch/arm
cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
# arch/arm64/include/asm/opcodes.h references arch/arm
cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/
# v6.1+
cp -a --parents arch/arm64/kernel/asm-offsets.c $kerneldir/build/
cp -a --parents arch/arm64/kernel/vdso/*gettimeofday.* $kerneldir/build/
cp -a --parents arch/arm64/kernel/vdso/sigreturn.S $kerneldir/build/
cp -a --parents arch/arm64/kernel/vdso/note.S $kerneldir/build/
cp -a --parents arch/arm64/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
cp -a --parents arch/arm64/kernel/module.lds $kerneldir/build/ 2>/dev/null || :
# 5.13+ needs these tools
cp -a --parents arch/arm64/tools/gen-cpucaps.awk $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/arm64/tools/cpucaps $kerneldir/build/ 2>/dev/null || :
# 5.19+
cp -a --parents arch/arm64/tools/gen-sysreg.awk $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/arm64/tools/sysreg $kerneldir/build/ 2>/dev/null || :
if [ -e $kerneldir/build/arch/arm64/tools/gen-cpucaps.awk ]; then
sed -i -e "s,#!.*awk.*,#!${USRBINPATH}/env awk," $kerneldir/build/arch/arm64/tools/gen-cpucaps.awk
fi
if [ -e $kerneldir/build/arch/arm64/tools/gen-sysreg.awk ]; then
sed -i -e "s,#!.*awk.*,#!${USRBINPATH}/env awk," $kerneldir/build/arch/arm64/tools/gen-sysreg.awk
fi
fi
if [ "${ARCH}" = "powerpc" ]; then
# 5.0 needs these files, but don't error if they aren't present in the source
cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/${ARCH}/kernel/syscalls/syscallhdr.sh $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/${ARCH}/kernel/vdso32/* $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/${ARCH}/kernel/vdso64/* $kerneldir/build/ 2>/dev/null || :
# v5.19+
cp -a --parents arch/powerpc/kernel/vdso/*.S $kerneldir/build 2>/dev/null || :
cp -a --parents arch/powerpc/kernel/vdso/*gettimeofday.* $kerneldir/build 2>/dev/null || :
cp -a --parents arch/powerpc/kernel/vdso/gen_vdso*_offsets.sh $kerneldir/build/ 2>/dev/null || :
# v6,1+
cp -a --parents arch/powerpc/kernel/asm-offsets.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/powerpc/kernel/head_booke.h $kerneldir/build/ 2>/dev/null || :
fi
if [ "${ARCH}" = "riscv" ]; then
cp -a --parents arch/riscv/kernel/vdso/*gettimeofday.* $kerneldir/build/
cp -a --parents arch/riscv/kernel/vdso/note.S $kerneldir/build/
# v6.1+
cp -a --parents arch/riscv/kernel/asm-offsets.c $kerneldir/build/
if [ -e arch/riscv/kernel/vdso/gen_vdso_offsets.sh ]; then
cp -a --parents arch/riscv/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
fi
cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
if [ -e arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh ]; then
cp -a --parents arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh $kerneldir/build/
fi
cp -a --parents arch/riscv/kernel/compat_vdso/* $kerneldir/build/ 2>/dev/null || :
fi
# include the machine specific headers for ARM variants, if available.
if [ "${ARCH}" = "arm" ]; then
cp -a --parents arch/${ARCH}/mach-*/include $kerneldir/build/
# include a few files for 'make prepare'
cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/
cp -a --parents arch/arm/tools/mach-types $kerneldir/build/
# 5.19+
cp -a --parents arch/arm/tools/gen-sysreg.awk $kerneldir/build/ 2>/dev/null || :
# ARM syscall table tools only exist for kernels v4.10 or later
SYSCALL_TOOLS=$(find arch/arm/tools -name "syscall*")
if [ -n "$SYSCALL_TOOLS" ] ; then
cp -a --parents $SYSCALL_TOOLS $kerneldir/build/
fi
cp -a --parents arch/arm/kernel/module.lds $kerneldir/build/ 2>/dev/null || :
# v6.1+
cp -a --parents arch/arm/kernel/asm-offsets.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/arm/kernel/signal.h $kerneldir/build/ 2>/dev/null || :
fi
if [ -d arch/${ARCH}/include ]; then
cp -a --parents arch/${ARCH}/include $kerneldir/build/
fi
cp -a include $kerneldir/build
cp -a --parents lib/vdso/* $kerneldir/build/ 2>/dev/null || :
cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/
cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/
# required for generate missing syscalls prepare phase
cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build
cp -a --parents $(find arch/arm -type f -name "*.tbl") $kerneldir/build 2>/dev/null || :
if [ "${ARCH}" = "x86" ]; then
# files for 'make prepare' to succeed with kernel-devel
cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build/ 2>/dev/null || :
cp -a --parents $(find arch/x86 -type f -name "syscalltbl.sh") $kerneldir/build/ 2>/dev/null || :
cp -a --parents $(find arch/x86 -type f -name "syscallhdr.sh") $kerneldir/build/ 2>/dev/null || :
cp -a --parents $(find arch/x86 -type f -name "syscall_64.tbl") $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/
cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/
cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/
cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/
cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/
cp -a --parents arch/x86/tools/gen-insn-attr-x86.awk $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/
# 4.18 + have unified the purgatory files, so we ignore any errors if
# these files are not present
cp -a --parents arch/x86/purgatory/sha256.h $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/
cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/
cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/
cp -a --parents arch/x86/boot/string.h $kerneldir/build/
cp -a --parents arch/x86/boot/string.c $kerneldir/build/
cp -a --parents arch/x86/boot/compressed/string.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/
# objtool requires these files
cp -a --parents arch/x86/lib/inat.c $kerneldir/build/ 2>/dev/null || :
cp -a --parents arch/x86/lib/insn.c $kerneldir/build/ 2>/dev/null || :
# v6.1+
cp -a --parents arch/x86/kernel/asm-offsets* $kerneldir/build || :
# for capabilities.h, vmx.h
cp -a --parents arch/x86/kvm/vmx/*.h $kerneldir/build || :
# for lapic.h, hyperv.h ....
cp -a --parents arch/x86/kvm/*.h $kerneldir/build || :
fi
# moved from arch/mips to all arches for v6.1+
cp -a --parents kernel/time/timeconst.bc $kerneldir/build 2>/dev/null || :
cp -a --parents kernel/bounds.c $kerneldir/build 2>/dev/null || :
if [ "${ARCH}" = "mips" ]; then
cp -a --parents arch/mips/Kbuild.platforms $kerneldir/build/
cp --parents $(find -type f -name "Platform") $kerneldir/build
cp --parents arch/mips/boot/tools/relocs* $kerneldir/build
cp -a --parents arch/mips/kernel/asm-offsets.c $kerneldir/build
cp -a --parents Kbuild $kerneldir/build
cp -a --parents arch/mips/kernel/syscalls/*.sh $kerneldir/build 2>/dev/null || :
cp -a --parents arch/mips/kernel/syscalls/*.tbl $kerneldir/build 2>/dev/null || :
cp -a --parents arch/mips/tools/elf-entry.c $kerneldir/build 2>/dev/null || :
fi
if [ "${ARCH}" = "loongarch" ]; then
cp -a --parents arch/loongarch/kernel/asm-offsets.c $kerneldir/build
cp -a --parents Kbuild $kerneldir/build
cp -a --parents arch/loongarch/vdso/*.S $kerneldir/build 2>/dev/null || :
cp -a --parents arch/loongarch/vdso/*gettimeofday.* $kerneldir/build 2>/dev/null || :
cp -a --parents arch/loongarch/vdso/*getcpu.* $kerneldir/build 2>/dev/null || :
cp -a --parents arch/loongarch/vdso/gen_vdso*_offsets.sh $kerneldir/build/ 2>/dev/null || :
fi
# required to build scripts/selinux/genheaders/genheaders
cp -a --parents security/selinux/include/* $kerneldir/build/
# copy any localversion files
cp -a localversion* $kerneldir/build/ 2>/dev/null || :
)
# Make sure the Makefile and version.h have a matching timestamp so that
# external modules can be built
touch -r $kerneldir/build/Makefile $kerneldir/build/include/generated/uapi/linux/version.h
# This fixes a warning that the compilers don't match when building a module
# Change: CONFIG_CC_VERSION_TEXT="x86_64-poky-linux-gcc (GCC) 12.2.0" to "gcc (GCC) 12.2.0"
# #define CONFIG_CC_VERSION_TEXT "x86_64-poky-linux-gcc (GCC) 12.2.0" to "gcc (GCC) 12.2.0"
sed -i 's/CONFIG_CC_VERSION_TEXT=".*\(gcc.*\)"/CONFIG_CC_VERSION_TEXT="\1"/' "$kerneldir/build/.config"
sed -i 's/#define CONFIG_CC_VERSION_TEXT ".*\(gcc.*\)"/#define CONFIG_CC_VERSION_TEXT "\1"/' $kerneldir/build/include/generated/autoconf.h
sed -i 's/CONFIG_CC_VERSION_TEXT=".*\(gcc.*\)"/CONFIG_CC_VERSION_TEXT="\1"/' $kerneldir/build/include/config/auto.conf
# make sure these are at least as old as the .config, or rebuilds will trigger
touch -r $kerneldir/build/.config $kerneldir/build/include/generated/autoconf.h 2>/dev/null || :
touch -r $kerneldir/build/.config $kerneldir/build/include/config/auto.conf* 2>/dev/null || :
if [ -e "$kerneldir/build/include/config/auto.conf.cmd" ]; then
sed -i 's/ifneq "$(CC)" ".*-linux-.*gcc.*$/ifneq "$(CC)" "gcc"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(LD)" ".*-linux-.*ld.bfd.*$/ifneq "$(LD)" "ld"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(AR)" ".*-linux-.*ar.*$/ifneq "$(AR)" "ar"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(OBJCOPY)" ".*-linux-.*objcopy.*$/ifneq "$(OBJCOPY)" "objcopy"/' "$kerneldir/build/include/config/auto.conf.cmd"
if [ "${ARCH}" = "powerpc" ]; then
sed -i 's/ifneq "$(NM)" ".*-linux-.*nm.*$/ifneq "$(NM)" "nm --synthetic"/' "$kerneldir/build/include/config/auto.conf.cmd"
else
sed -i 's/ifneq "$(NM)" ".*-linux-.*nm.*$/ifneq "$(NM)" "nm"/' "$kerneldir/build/include/config/auto.conf.cmd"
fi
sed -i 's/ifneq "$(HOSTCXX)" ".*$/ifneq "$(HOSTCXX)" "g++"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(HOSTCC)" ".*$/ifneq "$(HOSTCC)" "gcc"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(CC_VERSION_TEXT)".*\(gcc.*\)"/ifneq "$(CC_VERSION_TEXT)" "\1"/' "$kerneldir/build/include/config/auto.conf.cmd"
sed -i 's/ifneq "$(srctree)" ".*"/ifneq "$(srctree)" "."/' "$kerneldir/build/include/config/auto.conf.cmd"
# we don't build against the defconfig, so make sure it isn't the trigger for syncconfig
sed -i 's/ifneq "$(KBUILD_DEFCONFIG)".*"\(.*\)"/ifneq "\1" "\1"/' "$kerneldir/build/include/config/auto.conf.cmd"
fi
# make the scripts python3 safe. We won't be running these, and if they are
# left as /usr/bin/python rootfs assembly will fail, since we only have python3
# in the RDEPENDS (and the python3 package does not include /usr/bin/python)
for ss in $(find $kerneldir/build/scripts -type f -name '*'); do
sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "$ss"
sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss"
sed -i 's,/usr/bin/python,/usr/bin/env python3,' "$ss"
done
chown -R root:root ${D}
}
# Ensure we don't race against "make scripts" during cpio
do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
FILES:${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
FILES:${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
RDEPENDS:${PN} = "bc python3-core flex bison ${TCLIBC}-utils gawk"
# 4.15+ needs these next two RDEPENDS
RDEPENDS:${PN} += "openssl-dev util-linux"
# and x86 needs a bit more for 4.15+
RDEPENDS:${PN} += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-dev', '', d)}"
# powerpc needs elfutils on 6.3+
RDEPENDS:${PN} += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-dev', '', d)}"
# 5.8+ needs gcc-plugins libmpc-dev
RDEPENDS:${PN} += "gcc-plugins libmpc-dev"
# 5.13+ needs grep for powerpc
RDEPENDS:${PN}:append:powerpc = " grep"

View File

@@ -0,0 +1,66 @@
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 = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
PROVIDES += "virtual/kernel"
inherit deploy linux-dummy
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_HOST = ".*-linux"
SRC_URI = "file://COPYING.GPL"
S = "${WORKDIR}"
do_configure() {
:
}
do_compile () {
:
}
do_compile_kernelmodules() {
:
}
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
addtask compile_kernelmodules

View File

@@ -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.

View File

@@ -0,0 +1,61 @@
# 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 = "v6.9/standard/base"
KMETA = "kernel-meta"
SRC_URI = "git://git.yoctoproject.org/linux-yocto-dev.git;branch=${KBRANCH};name=machine;protocol=https \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=master;destsuffix=${KMETA};protocol=https"
# 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 ?= "6.9"
LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
PV = "${LINUX_VERSION}+git"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
# yaml and dtschema are required for 5.16+ device tree validation, libyaml is checked
# via pkgconfig, so must always be present, but we can wrap the others to make them
# conditional
DEPENDS += "libyaml-native"
PACKAGECONFIG ??= ""
PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
# we need the wrappers if validation isn't in the packageconfig
DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
KERNEL_DEVICETREE:qemuarmv5 = "arm/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 features/drm-bochs/drm-bochs.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)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/scsi/scsi-debug.scc", "", d)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -0,0 +1,48 @@
KBRANCH ?= "v6.6/standard/preempt-rt/base"
require recipes-kernel/linux/linux-yocto.inc
# CVE exclusions
include recipes-kernel/linux/cve-exclusion_6.6.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 ?= "a02058f9508e565ca6d62ff4fda707d1b8894ea0"
SRCREV_meta ?= "533e8057057d5eb7400a400e53972c54ac1169b0"
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine;protocol=https \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-6.6;destsuffix=${KMETA};protocol=https"
LINUX_VERSION ?= "6.6.96"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
DEPENDS += "openssl-native util-linux-native"
PV = "${LINUX_VERSION}+git"
KMETA = "kernel-meta"
KCONF_BSP_AUDIT_LEVEL = "1"
LINUX_KERNEL_TYPE = "preempt-rt"
COMPATIBLE_MACHINE = "^(qemux86|qemux86-64|qemuarm|qemuarmv5|qemuarm64|qemuppc|qemumips)$"
KERNEL_DEVICETREE:qemuarmv5 = "arm/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 features/drm-bochs/drm-bochs.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("DISTRO_FEATURES", "ptest", " features/scsi/scsi-debug.scc", "", d)}"
KERNEL_FEATURES:append = "${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"

View File

@@ -0,0 +1,33 @@
KBRANCH ?= "v6.6/standard/tiny/base"
LINUX_KERNEL_TYPE = "tiny"
KCONFIG_MODE = "--allnoconfig"
require recipes-kernel/linux/linux-yocto.inc
# CVE exclusions
include recipes-kernel/linux/cve-exclusion_6.6.inc
LINUX_VERSION ?= "6.6.96"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
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 ?= "d68fff9b37fe90feaef6e6e24d560f07420d2044"
SRCREV_meta ?= "533e8057057d5eb7400a400e53972c54ac1169b0"
PV = "${LINUX_VERSION}+git"
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine;protocol=https \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-6.6;destsuffix=${KMETA};protocol=https"
COMPATIBLE_MACHINE = "^(qemux86|qemux86-64|qemuarm64|qemuarm|qemuarmv5)$"
# Functionality flags
KERNEL_FEATURES = ""
KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"

View File

@@ -0,0 +1,81 @@
SUMMARY = "Linux kernel"
SECTION = "kernel"
LICENSE = "GPL-2.0-only"
HOMEPAGE = "https://www.yoctoproject.org/"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process"
# 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}"
DEPENDS:append:arc = " libgcc"
KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}"
KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}"
KERNEL_FEATURES:append:qemuall=" features/debug/printk.scc features/taskstats/taskstats.scc"
KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/efi.scc', '', d)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
# A KMACHINE is the mapping of a yocto $MACHINE to what is built
# by the kernel. This is typically the branch that should be built,
# and it can be specific to the machine or shared
# KMACHINE = "UNDEFINED"
LINUX_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
}
# enable kernel-sample for oeqa/runtime/cases's ksample.py test
KERNEL_FEATURES:append:qemuall=" features/kernel-sample/kernel-sample.scc"
KERNEL_DEBUG ?= ""
# These used to be version specific, but are now common dependencies. New
# tools / dependencies will continue to be added in version specific recipes.
DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
DEPENDS += "openssl-native util-linux-native"
DEPENDS += "gmp-native libmpc-native"
# Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
EXTRA_OEMAKE += '${@bb.utils.contains("KERNEL_DEBUG", "True", "", "PAHOLE=false", d)}'
do_devshell:prepend() {
# setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
}

View File

@@ -0,0 +1,74 @@
KBRANCH ?= "v6.6/standard/base"
require recipes-kernel/linux/linux-yocto.inc
# CVE exclusions
include recipes-kernel/linux/cve-exclusion.inc
include recipes-kernel/linux/cve-exclusion_6.6.inc
# board specific branches
KBRANCH:qemuarm ?= "v6.6/standard/arm-versatile-926ejs"
KBRANCH:qemuarm64 ?= "v6.6/standard/qemuarm64"
KBRANCH:qemumips ?= "v6.6/standard/mti-malta32"
KBRANCH:qemuppc ?= "v6.6/standard/qemuppc"
KBRANCH:qemuriscv64 ?= "v6.6/standard/base"
KBRANCH:qemuriscv32 ?= "v6.6/standard/base"
KBRANCH:qemux86 ?= "v6.6/standard/base"
KBRANCH:qemux86-64 ?= "v6.6/standard/base"
KBRANCH:qemuloongarch64 ?= "v6.6/standard/base"
KBRANCH:qemumips64 ?= "v6.6/standard/mti-malta64"
SRCREV_machine:qemuarm ?= "a2c45f6283ecd822468883d493f90ab0cc4f3a8a"
SRCREV_machine:qemuarm64 ?= "d72e5d8e6d1a220a18fb2d9848fadbe443c9d555"
SRCREV_machine:qemuloongarch64 ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_machine:qemumips ?= "09314f2a0c95b59863247654f75555489cae9e11"
SRCREV_machine:qemuppc ?= "7ee481d1b7be6cb8897494430119c4a00d40c29e"
SRCREV_machine:qemuriscv64 ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_machine:qemuriscv32 ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_machine:qemux86 ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_machine:qemux86-64 ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_machine:qemumips64 ?= "3b2b3b16411baea07773b9c74093d139a0d0ab25"
SRCREV_machine ?= "cfb2162b885f040f7d3d2c95103af0d62ad94b28"
SRCREV_meta ?= "533e8057057d5eb7400a400e53972c54ac1169b0"
# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll
# get the <version>/base branch, which is pure upstream -stable, and the same
# meta SRCREV as the linux-yocto-standard builds. Select your version using the
# normal PREFERRED_VERSION settings.
BBCLASSEXTEND = "devupstream:target"
SRCREV_machine:class-devupstream ?= "a5df3a702b2cba82bcfb066fa9f5e4a349c33924"
PN:class-devupstream = "linux-yocto-upstream"
KBRANCH:class-devupstream = "v6.6/base"
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-6.6;destsuffix=${KMETA};protocol=https"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
LINUX_VERSION ?= "6.6.96"
PV = "${LINUX_VERSION}+git"
KMETA = "kernel-meta"
KCONF_BSP_AUDIT_LEVEL = "1"
KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"
COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$"
# Functionality flags
KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
KERNEL_FEATURES:append:qemuall=" cfg/virtio.scc features/drm-bochs/drm-bochs.scc cfg/net/mdio.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)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/scsi/scsi-debug.scc features/nf_tables/nft_test.scc", "", d)}"
KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
# libteam ptests from meta-oe needs it
KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/net/team/team.scc", "", d)}"
KERNEL_FEATURES:append:powerpc =" arch/powerpc/powerpc-debug.scc"
KERNEL_FEATURES:append:powerpc64 =" arch/powerpc/powerpc-debug.scc"
KERNEL_FEATURES:append:powerpc64le =" arch/powerpc/powerpc-debug.scc"
INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel"

View File

@@ -0,0 +1,9 @@
#!/bin/sh
# use target=recheck if you want to recheck failing tests
[ "$target" = "" ] && target=check
# 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"
exec make -C tests -k -s $makeargs $target 2>/dev/null

View File

@@ -0,0 +1,28 @@
From 56986190e4b0c10945ce6aaa7ca10d6bd8a26a39 Mon Sep 17 00:00:00 2001
From: Jeremy Puhlman <jpuhlman@mvista.com>
Date: Mon, 9 Mar 2020 21:10:35 +0000
Subject: [PATCH] Make manpages multilib identical
Upstream-Status: Pending
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
---
doc/man/asciidoc-attrs.conf.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/man/asciidoc-attrs.conf.in b/doc/man/asciidoc-attrs.conf.in
index ad1183f1..e11c7031 100644
--- a/doc/man/asciidoc-attrs.conf.in
+++ b/doc/man/asciidoc-attrs.conf.in
@@ -1,7 +1,7 @@
[attributes]
# default values
-system_plugin_path="@LIBDIR@/babeltrace2/plugins"
-system_plugin_provider_path="@LIBDIR@/babeltrace2/plugin-providers"
+system_plugin_path="@prefix@/lib*/babeltrace2/plugins"
+system_plugin_provider_path="@prefix@/lib*/babeltrace2/plugin-providers"
babeltrace_version="@PACKAGE_VERSION@"
enable_debug_info="@ENABLE_DEBUG_INFO_VAL@"
defrdport=5344
--
2.24.1

View File

@@ -0,0 +1,28 @@
From 582713cc9a013481eeef253195d644020f637ec4 Mon Sep 17 00:00:00 2001
Message-Id: <582713cc9a013481eeef253195d644020f637ec4.1583403622.git.wallinux@gmail.com>
From: Anders Wallin <wallinux@gmail.com>
Date: Thu, 5 Mar 2020 11:20:04 +0100
Subject: [PATCH] tests: do not run test applications from .libs
Cross compile specific change
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
tests/lib/test_plugin | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/lib/test_plugin b/tests/lib/test_plugin
index 652c90cc..1f817c50 100755
--- a/tests/lib/test_plugin
+++ b/tests/lib/test_plugin
@@ -26,4 +26,4 @@ fi
# shellcheck source=../utils/utils.sh
source "$UTILSSH"
-"${BT_TESTS_BUILDDIR}/lib/plugin" "${BT_TESTS_BUILDDIR}/lib/test-plugin-plugins/.libs"
+"${BT_TESTS_BUILDDIR}/lib/plugin" "${BT_TESTS_BUILDDIR}/lib/test-plugin-plugins"
--
2.25.1

View File

@@ -0,0 +1,19 @@
#!/bin/sh
# use target=recheck if you want to recheck failing tests
[ "$target" = "" ] && target=check
# 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 abs_top_srcdir=$PWD abs_top_builddir=$PWD GREP=grep SED=sed PYTHON=python3"
exec 2> error.log
make -C tests -k -s $makeargs $target
exitcode=$?
if [ -e error.log ]; then
cat error.log
fi
if [ -e tests/test-suite.log ]; then
cat tests/test-suite.log
fi
exit $exitcode

View File

@@ -0,0 +1,107 @@
SUMMARY = "Babeltrace2 - 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://babeltrace.org/"
BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only & BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e"
DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0;protocol=https \
file://run-ptest \
file://0001-tests-do-not-run-test-applications-from-.libs.patch \
file://0001-Make-manpages-multilib-identical.patch \
"
SRCREV = "0a6632f77801f3218a288604c646f8a39cb0d2c4"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
S = "${WORKDIR}/git"
inherit autotools pkgconfig ptest python3targetconfig
EXTRA_OECONF = "--disable-debug-info --disable-Werror"
PACKAGECONFIG ??= "manpages"
PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native"
FILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a"
FILES:${PN} += "${libdir}/babeltrace2/plugins/*.so"
ASNEEDED = ""
LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd ', '', d)}"
# coreutils since we need full mktemp
RDEPENDS:${PN}-ptest += "bash gawk python3 make grep coreutils findutils"
do_compile_ptest () {
make -C tests all
}
do_install_ptest () {
install -d "${D}${PTEST_PATH}/tests"
# Copy required files from source directory
for d in $(find "${S}/tests" -type d -printf '%P ') ; do
install -d "${D}${PTEST_PATH}/tests/$d"
find "${S}/tests/$d" -maxdepth 1 -executable -type f \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
find "${S}/tests/$d" -maxdepth 1 -name *.sh \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
find "${S}/tests/$d" -maxdepth 1 -name *.py \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
find "${S}/tests/$d" -maxdepth 1 -name *.expect \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
done
install -d "${D}${PTEST_PATH}/tests/data/ctf-traces/"
cp -a ${S}/tests/data/ctf-traces/* ${D}${PTEST_PATH}/tests/data/ctf-traces/
# Copy the tests directory tree and the executables and
# Makefiles found within.
install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
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"
find "${B}/tests/$d" -maxdepth 1 -name *.sh \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
done
for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
done
done
# 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:/' \
{} +
# Substitute links to installed binaries.
install -d "${D}${PTEST_PATH}/src/cli/"
ln -s "${bindir}/babeltrace2" ${D}${PTEST_PATH}/src/cli/
# Remove architechture specific testfiles
rm -rf ${D}${PTEST_PATH}/tests/data/plugins/flt.lttng-utils.debug-info/*
}
do_install:append:class-nativesdk() {
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/babeltrace2.sh
export BABELTRACE_PLUGIN_PATH="${libdir}/babeltrace2/plugins"
export LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="${libdir}/babeltrace2/plugin-providers"
EOF
}
FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/babeltrace2.sh"
BBCLASSEXTEND = "nativesdk"

View File

@@ -0,0 +1,100 @@
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://babeltrace.org/"
BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5;protocol=https \
file://run-ptest \
"
SRCREV = "91c00f70884887ff5c4849a8e3d47e311a22ba9d"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$"
S = "${WORKDIR}/git"
inherit autotools pkgconfig ptest
EXTRA_OECONF = "--disable-debug-info"
ASNEEDED = ""
RDEPENDS:${PN}-ptest += "bash gawk make"
addtask do_patch_ptest_path after do_patch before do_configure
do_patch_ptest_path () {
for f in $(grep -l -r abs_top_srcdir ${S}/tests); do
sed -i 's:\@abs_top_srcdir\@:${PTEST_PATH}:' ${f}
done
for f in $(grep -l -r abs_top_builddir ${S}/tests); do
sed -i 's:\@abs_top_builddir\@:${PTEST_PATH}:' ${f}
done
for f in $(grep -l -r GREP ${S}/tests); do
sed -i 's:\@GREP\@:grep:' ${f}
done
for f in $(grep -l -r SED ${S}/tests); do
sed -i 's:\@SED\@:sed:' ${f}
done
}
do_compile_ptest () {
make -C tests all
}
do_install_ptest () {
# Copy required files from source directory
for f in config/tap-driver.sh config/test-driver; do
install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
done
install -d "$f" "${D}${PTEST_PATH}/tests/ctf-traces/"
cp -a ${S}/tests/ctf-traces/* ${D}${PTEST_PATH}/tests/ctf-traces/
# Copy the tests directory tree and the executables and
# Makefiles found within.
install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
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"
find "${B}/tests/$d" -maxdepth 1 -name *.sh \
-exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
done
for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
done
done
install -D ${B}/formats/ctf/metadata/.libs/ctf-parser-test \
${D}${PTEST_PATH}/formats/ctf/metadata/ctf-parser-test
# 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 '/$(check_SCRIPTS)/s/^/#/' \
-e '/%: %.in/,/^$/d' \
-e '/echo "Making $$target in $$subdir"; \\/d' \
-e 's/^srcdir = \(.*\)/srcdir = ./' \
-e 's/^builddir = \(.*\)/builddir = ./' \
-e 's/^all-am:.*/all-am:/' \
{} +
# Remove path to babeltrace.
for f in $(grep -l -r "^BABELTRACE_BIN" ${D}${PTEST_PATH}); do
sed -i 's:^BABELTRACE_BIN.*:BABELTRACE_BIN=/usr/bin/babeltrace:' ${f}
done
for f in $(grep -l -r "^BTBIN" ${D}${PTEST_PATH}); do
sed -i 's:^BTBIN.*:BTBIN=/usr/bin/babeltrace:' ${f}
done
}
BBCLASSEXTEND = "nativesdk"

View File

@@ -0,0 +1,93 @@
From fec007d9630e010062cf5699a08460f71f46b527 Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 25 Mar 2024 08:54:42 -0400
Subject: [PATCH 1/4] Fix: ASoC snd_doc_dapm on linux 6.9-rc1
See upstream commit:
commit 7df3eb4cdb6bbfa482f51548b9fd47c2723c68ba
Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
Date: Wed Mar 6 10:30:01 2024 +0100
ASoC: trace: add event to snd_soc_dapm trace events
Add the event value to the snd_soc_dapm_start and snd_soc_dapm_done trace
events to make them more informative.
Trace before:
aplay-229 [000] 250.140309: snd_soc_dapm_start: card=vscn-2046
aplay-229 [000] 250.167531: snd_soc_dapm_done: card=vscn-2046
aplay-229 [000] 251.169588: snd_soc_dapm_start: card=vscn-2046
aplay-229 [000] 251.195245: snd_soc_dapm_done: card=vscn-2046
Trace after:
aplay-214 [000] 693.290612: snd_soc_dapm_start: card=vscn-2046 event=1
aplay-214 [000] 693.315508: snd_soc_dapm_done: card=vscn-2046 event=1
aplay-214 [000] 694.537349: snd_soc_dapm_start: card=vscn-2046 event=2
aplay-214 [000] 694.563241: snd_soc_dapm_done: card=vscn-2046 event=2
Upstream-Status: Backport [88c4e0fe Fix: ASoC snd_doc_dapm on linux 6.9-rc1]
Change-Id: If0d33544b8dd1dfb3d12ca9390892190fc0444b0
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
include/instrumentation/events/asoc.h | 33 +++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/include/instrumentation/events/asoc.h b/include/instrumentation/events/asoc.h
index 21d13a0f..5126d4c1 100644
--- a/include/instrumentation/events/asoc.h
+++ b/include/instrumentation/events/asoc.h
@@ -51,6 +51,38 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done,
)
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
+
+ TP_PROTO(struct snd_soc_card *card, int event),
+
+ TP_ARGS(card, event),
+
+ TP_FIELDS(
+ ctf_string(name, card->name)
+ ctf_integer(int, event, event)
+ )
+)
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start,
+
+ asoc_snd_soc_dapm_start,
+
+ TP_PROTO(struct snd_soc_card *card, int event),
+
+ TP_ARGS(card, event)
+
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done,
+
+ asoc_snd_soc_dapm_done,
+
+ TP_PROTO(struct snd_soc_card *card, int event),
+
+ TP_ARGS(card, event)
+
+)
+#else
LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
TP_PROTO(struct snd_soc_card *card),
@@ -81,6 +113,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done,
TP_ARGS(card)
)
+#endif
LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget,
--
2.39.2

View File

@@ -0,0 +1,51 @@
From a04234d63999f91405574928c80ded870dca157a Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Sun, 22 Dec 2024 17:39:35 +0800
Subject: [PATCH] Fix: sched_stat_runtime changed in Linux 6.6.66
The following commit has been backported into the 6.6.y branch.
See upstream commit:
commit 5fe6ec8f6ab549b6422e41551abb51802bd48bc7
Author: Peter Zijlstra <peterz@infradead.org>
Date: Mon Nov 6 13:41:43 2023 +0100
sched: Remove vruntime from trace_sched_stat_runtime()
Tracing the runtime delta makes sense, observer can sum over time.
Tracing the absolute vruntime makes less sense, inconsistent:
absolute-vs-delta, but also vruntime delta can be computed from
runtime delta.
Removing the vruntime thing also makes the two tracepoint sites
identical, allowing to unify the code in a later patch.
Change-Id: I74acf0b8340c371e8411116e07e5c97b10f9c756
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Upstream-Status: Pending [https://review.lttng.org/c/lttng-modules/+/13813]
[Xiangyu: BP to fix compile error on linux 6.6.66, Minor conflict resolution]
Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
include/instrumentation/events/sched.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h
index 24cf37c8..637a1e3a 100644
--- a/include/instrumentation/events/sched.h
+++ b/include/instrumentation/events/sched.h
@@ -646,7 +646,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_blocked,
TP_ARGS(tsk, delay))
#endif
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0) || \
+ LTTNG_KERNEL_RANGE(6,6,66, 6,7,0))
/*
* Tracepoint for accounting runtime (time the task is executing
* on a CPU).
--
2.43.0

View File

@@ -0,0 +1,46 @@
From 878f89b6136ff7b870a19e04901cc6f316bbe10a Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Sat, 15 May 2021 10:26:38 -0400
Subject: [PATCH] src/Kbuild: change missing CONFIG_TRACEPOINTS to warning
Taken from a previous patch to the main lttng-modules Makefile, by
Otavio Salvador:
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: Bruce Ashfield <bruce.ashfield@gmail.com>
---
src/Kbuild | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: lttng-modules-2.13.10/src/Kbuild
===================================================================
--- lttng-modules-2.13.10.orig/src/Kbuild
+++ lttng-modules-2.13.10/src/Kbuild
@@ -2,10 +2,13 @@
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)
+ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
+ DISABLE_MODULE = y
endif # CONFIG_TRACEPOINTS
endif # ifdef CONFIG_LOCALVERSION
+ifneq ($(DISABLE_MODULE),y)
+
TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
lttng_check_linux_version = $(shell pwd)/include/linux/version.h
@@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump-
obj-$(CONFIG_LTTNG) += probes/
obj-$(CONFIG_LTTNG) += lib/
obj-$(CONFIG_LTTNG) += tests/
+
+endif # DISABLE_MODULE

View File

@@ -0,0 +1,132 @@
From d8379ec6365a925db33cae94fb6783cdbdb6a922 Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 25 Mar 2024 09:40:29 -0400
Subject: [PATCH 2/4] Fix: ASoC add component to set_bias_level events in linux
6.9-rc1
See upstream commit:
commit 6ef46a69ec32fe1cf56de67742fcd01af4bf48af
Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
Date: Wed Mar 6 10:30:00 2024 +0100
ASoC: trace: add component to set_bias_level trace events
The snd_soc_bias_level_start and snd_soc_bias_level_done trace events
currently look like:
aplay-229 [000] 1250.140778: snd_soc_bias_level_start: card=vscn-2046 val=1
aplay-229 [000] 1250.140784: snd_soc_bias_level_done: card=vscn-2046 val=1
aplay-229 [000] 1250.140786: snd_soc_bias_level_start: card=vscn-2046 val=2
aplay-229 [000] 1250.140788: snd_soc_bias_level_done: card=vscn-2046 val=2
kworker/u8:1-21 [000] 1250.140871: snd_soc_bias_level_start: card=vscn-2046 val=1
kworker/u8:0-11 [000] 1250.140951: snd_soc_bias_level_start: card=vscn-2046 val=1
kworker/u8:0-11 [000] 1250.140956: snd_soc_bias_level_done: card=vscn-2046 val=1
kworker/u8:0-11 [000] 1250.140959: snd_soc_bias_level_start: card=vscn-2046 val=2
kworker/u8:0-11 [000] 1250.140961: snd_soc_bias_level_done: card=vscn-2046 val=2
kworker/u8:1-21 [000] 1250.167219: snd_soc_bias_level_done: card=vscn-2046 val=1
kworker/u8:1-21 [000] 1250.167222: snd_soc_bias_level_start: card=vscn-2046 val=2
kworker/u8:1-21 [000] 1250.167232: snd_soc_bias_level_done: card=vscn-2046 val=2
kworker/u8:0-11 [000] 1250.167440: snd_soc_bias_level_start: card=vscn-2046 val=3
kworker/u8:0-11 [000] 1250.167444: snd_soc_bias_level_done: card=vscn-2046 val=3
kworker/u8:1-21 [000] 1250.167497: snd_soc_bias_level_start: card=vscn-2046 val=3
kworker/u8:1-21 [000] 1250.167506: snd_soc_bias_level_done: card=vscn-2046 val=3
There are clearly multiple calls, one per component, but they cannot be
discriminated from each other.
Change the ftrace events to also print the component name, to make it clear
which part of the code is involved. This requires changing the passed value
from a struct snd_soc_card, where the DAPM context is not kwown, to a
struct snd_soc_dapm_context where it is obviously known but the a card
pointer is also available.
With this change, the resulting trace becomes:
aplay-247 [000] 1436.357332: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=1
aplay-247 [000] 1436.357338: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=1
aplay-247 [000] 1436.357340: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=2
aplay-247 [000] 1436.357343: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=2
kworker/u8:4-215 [000] 1436.357437: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=1
kworker/u8:5-231 [000] 1436.357518: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=1
kworker/u8:5-231 [000] 1436.357523: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=1
kworker/u8:5-231 [000] 1436.357526: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=2
kworker/u8:5-231 [000] 1436.357528: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=2
kworker/u8:4-215 [000] 1436.383217: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=1
kworker/u8:4-215 [000] 1436.383221: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=2
kworker/u8:4-215 [000] 1436.383231: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=2
kworker/u8:5-231 [000] 1436.383468: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=3
kworker/u8:5-231 [000] 1436.383472: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=3
kworker/u8:4-215 [000] 1436.383503: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=3
kworker/u8:4-215 [000] 1436.383513: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=3
Upstream-Status: Backport [303434ab Fix: ASoC add component to set_bias_level events in linux 6.9-rc1]
Change-Id: I959f1680c002acdf29828b968d3975247f5433d8
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
include/instrumentation/events/asoc.h | 36 +++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
Index: lttng-modules-2.13.12/include/instrumentation/events/asoc.h
===================================================================
--- lttng-modules-2.13.12.orig/include/instrumentation/events/asoc.h
+++ lttng-modules-2.13.12/include/instrumentation/events/asoc.h
@@ -10,6 +10,7 @@
#include <lttng/kernel-version.h>
#define DAPM_DIRECT "(direct)"
+#define DAPM_COMPONENT_NONE "(none)"
#ifndef _TRACE_ASOC_DEF
#define _TRACE_ASOC_DEF
@@ -119,6 +120,40 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc
)
#endif
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_context,
+
+ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
+
+ TP_ARGS(dapm, val),
+
+ TP_FIELDS(
+ ctf_string(name, dapm->card->name)
+ ctf_string(component, dapm->component ? dapm->component->name : DAPM_COMPONENT_NONE)
+ ctf_integer(int, val, val)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_start,
+
+ asoc_snd_soc_bias_level_start,
+
+ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
+
+ TP_ARGS(dapm, val)
+
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_done,
+
+ asoc_snd_soc_bias_level_done,
+
+ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
+
+ TP_ARGS(dapm, val)
+
+)
+#else
LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card,
TP_PROTO(struct snd_soc_card *card, int val),
@@ -150,6 +185,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc
TP_ARGS(card, val)
)
+#endif
#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,

View File

@@ -0,0 +1,81 @@
From f4a6415f8d5fa447868d1fdc7119e0a328966379 Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 25 Mar 2024 10:30:32 -0400
Subject: [PATCH 3/4] Fix: mm_compaction_migratepages changed in linux 6.9-rc1
See upstream commit:
commit ab755bf4249b992fc2140d615ab0a686d50765b4
Author: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: Tue Feb 20 14:16:31 2024 +0800
mm: compaction: update the cc->nr_migratepages when allocating or freeing the freepages
Currently we will use 'cc->nr_freepages >= cc->nr_migratepages' comparison
to ensure that enough freepages are isolated in isolate_freepages(),
however it just decreases the cc->nr_freepages without updating
cc->nr_migratepages in compaction_alloc(), which will waste more CPU
cycles and cause too many freepages to be isolated.
So we should also update the cc->nr_migratepages when allocating or
freeing the freepages to avoid isolating excess freepages. And I can see
fewer free pages are scanned and isolated when running thpcompact on my
Arm64 server:
k6.7 k6.7_patched
Ops Compaction pages isolated 120692036.00 118160797.00
Ops Compaction migrate scanned 131210329.00 154093268.00
Ops Compaction free scanned 1090587971.00 1080632536.00
Ops Compact scan efficiency 12.03 14.26
Moreover, I did not see an obvious latency improvements, this is likely
because isolating freepages is not the bottleneck in the thpcompact test
case.
k6.7 k6.7_patched
Amean fault-both-1 1089.76 ( 0.00%) 1080.16 * 0.88%*
Amean fault-both-3 1616.48 ( 0.00%) 1636.65 * -1.25%*
Amean fault-both-5 2266.66 ( 0.00%) 2219.20 * 2.09%*
Amean fault-both-7 2909.84 ( 0.00%) 2801.90 * 3.71%*
Amean fault-both-12 4861.26 ( 0.00%) 4733.25 * 2.63%*
Amean fault-both-18 7351.11 ( 0.00%) 6950.51 * 5.45%*
Amean fault-both-24 9059.30 ( 0.00%) 9159.99 * -1.11%*
Amean fault-both-30 10685.68 ( 0.00%) 11399.02 * -6.68%*
Upstream-Status: Backport [175fe77c Fix: mm_compaction_migratepages changed in linux 6.9-rc1]
Change-Id: I103a43fd1b549360b3fc978fd409b7c17ef3e192
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
include/instrumentation/events/compaction.h | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
Index: lttng-modules-2.13.12/include/instrumentation/events/compaction.h
===================================================================
--- lttng-modules-2.13.12.orig/include/instrumentation/events/compaction.h
+++ lttng-modules-2.13.12/include/instrumentation/events/compaction.h
@@ -97,7 +97,22 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(comp
#endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
+LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
+
+ compaction_migratepages,
+
+ TP_PROTO(unsigned int nr_migratepages,
+ unsigned int nr_succeeded),
+
+ TP_ARGS(nr_migratepages, nr_succeeded),
+
+ TP_FIELDS(
+ ctf_integer(unsigned long, nr_migrated, nr_succeeded)
+ ctf_integer(unsigned long, nr_failed, nr_migratepages - nr_succeeded)
+ )
+)
+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0))
LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,

View File

@@ -0,0 +1,57 @@
From 217bc2e4685050dddce9bdd2557b64f6b8c16622 Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 25 Mar 2024 10:53:46 -0400
Subject: [PATCH 4/4] Fix: dev_base_lock removed in linux 6.9-rc1
See upstream commit:
commit 1b3ef46cb7f2618cc0b507393220a69810f6da12
Author: Eric Dumazet <edumazet@google.com>
Date: Tue Feb 13 06:32:45 2024 +0000
net: remove dev_base_lock
dev_base_lock is not needed anymore, all remaining users also hold RTNL.
Upstream-Status: Backport [52eb2ee9 Fix: dev_base_lock removed in linux 6.9-rc1]
Change-Id: I6b07e6eed07fd398302ca14d23162ed24d74df15
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
src/lttng-statedump-impl.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: lttng-modules-2.13.12/src/lttng-statedump-impl.c
===================================================================
--- lttng-modules-2.13.12.orig/src/lttng-statedump-impl.c
+++ lttng-modules-2.13.12/src/lttng-statedump-impl.c
@@ -392,6 +392,20 @@ void lttng_enumerate_device(struct lttng
}
}
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
+static
+int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)
+{
+ struct net_device *dev;
+
+ rtnl_lock();
+ for_each_netdev(&init_net, dev)
+ lttng_enumerate_device(session, dev);
+ rtnl_unlock();
+
+ return 0;
+}
+#else
static
int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)
{
@@ -404,6 +418,7 @@ int lttng_enumerate_network_ip_interface
return 0;
}
+#endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) */
#else /* CONFIG_INET */
static inline
int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)

View File

@@ -0,0 +1,46 @@
SECTION = "devel"
SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
HOMEPAGE = "https://lttng.org/"
LICENSE = "LGPL-2.1-only & GPL-2.0-only & MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4"
inherit module
include lttng-platforms.inc
SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
file://0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch \
file://0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch \
file://0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch \
file://0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch \
file://0001-Fix-sched_stat_runtime-changed-in-Linux-6.6.66.patch \
"
# Use :append here so that the patch is applied also when using devupstream
SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch"
SRC_URI[sha256sum] = "d85fcb66c7bd31003ab8735e8c77700e5e4f417b4c22fe1f20112cf435abad79"
export INSTALL_MOD_DIR="kernel/lttng-modules"
EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
MODULES_MODULE_SYMVERS_LOCATION = "src"
do_install:append() {
# Delete empty directories to avoid QA failures if no modules were built
if [ -d ${D}/${nonarch_base_libdir} ]; then
find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
fi
}
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'))
}
BBCLASSEXTEND = "devupstream:target"
SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13;protocol=https"
SRCREV:class-devupstream = "7584cfc04914cb0842a986e9808686858b9c8630"
SRCREV_FORMAT ?= "lttng_git"

View File

@@ -0,0 +1,21 @@
#
# Whether the platform supports kernel tracing
#
LTTNGMODULES = "lttng-modules"
LTTNGMODULES:arc = ""
LTTNGMODULES:riscv64 = ""
COMPATIBLE_HOST:riscv64:pn-lttng-modules = "null"
COMPATIBLE_HOST:arc:pn-lttng-modules = "null"
# Whether the platform supports userspace tracing
# lttng-ust uses sched_getcpu() which is not there on for some platforms.
LTTNGUST = "lttng-ust"
LTTNGUST:arc = ""
COMPATIBLE_HOST:arc:pn-lttng-ust = "null"
# Whether the platform supports lttng-tools
# lttng-tools requires SYS_ppoll and SYS_pselect6 which are not supported on riscv32.
# It's also turned off for riscv32 in meta-riscv. See https://github.com/riscv/meta-riscv/blob/master/conf/layer.conf
COMPATIBLE_HOST:riscv32:pn-lttng-tools = "null"

View File

@@ -0,0 +1,56 @@
From 6b45c5f80d20e7bbf3d98c1fa17d2cf8716af3bb Mon Sep 17 00:00:00 2001
From: Xiangyu Chen <xiangyu.chen@windriver.com>
Date: Mon, 25 Mar 2024 18:20:14 +0800
Subject: [PATCH] Fix: rotation-destroy-flush: fix session daemon abort if no
kernel module present
Testing rotation-destroy-flush when no lttng kernel modules present, it would
be failed with error message:
Error: Unable to load required module lttng-ring-buffer-client-discard
not ok 1 - Start session daemon
Failed test 'Start session daemon'
not ok 2 - Create session rotation_destroy_flush in -o /tmp/tmp.test_rot ...
...
This because test script that sets the LTTNG_ABORT_ON_ERROR environment
variable. It's this environment variable that causes the sessiond to handle the
kernel module loading failure as an abort rather than a warning.
Using "check_skip_kernel_test" to detect whether the kernel module fails to
load is expected or not. If the failure is expected, the script won't set that
environment variable any more.
Fixes: 3a174400
("tests:add check_skip_kernel_test to check root user and lttng kernel modules")
Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/12155]
Change-Id: I371e9ba717613e2940186f710cf3cccd35baed6c
Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
.../ust/rotation-destroy-flush/test_rotation_destroy_flush | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
index 669bcbc43..64161768f 100755
--- a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
+++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
@@ -23,11 +23,11 @@ SIZE_LIMIT=$PAGE_SIZE
NR_ITER=10
NUM_TESTS=$((15*$NR_ITER))
-# Ensure the daemons invoke abort on error.
-export LTTNG_ABORT_ON_ERROR=1
-
source $TESTDIR/utils/utils.sh
+# Ensure the daemons invoke abort on error.
+check_skip_kernel_test || export LTTNG_ABORT_ON_ERROR=1
+
# MUST set TESTDIR before calling those functions
function run_app()
{
--
2.25.1

View File

@@ -0,0 +1,74 @@
From 74b3844737b03492756b4f896c938b504b069f14 Mon Sep 17 00:00:00 2001
From: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Date: Tue, 17 Jan 2023 16:57:35 -0500
Subject: [PATCH] compat: off64_t is not defined by musl
This helps compile with latest musl, where off64_t is not defined unless
_LARGEFILE64_SOURCE is defined. On glibc, _LARGEFILE64_SOURCE is defined
if _GNU_SOURCE is defined, so the problem is only seen with musl.
Since the project uses AC_SYS_LARGEFILE, which from the autoconf doc:
"arrange for 64-bit file offsets, known as large-file support."
As such, it is safe to assume off_t is 64-bit wide. This is checked by a
static_assert to catch any platform where autoconf would let a 32-bit
off_t slip.
Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/9268]
Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8
---
--- a/src/common/compat/compat-fcntl.c
+++ b/src/common/compat/compat-fcntl.c
@@ -8,14 +8,17 @@
#define _LGPL_SOURCE
#include <common/compat/fcntl.h>
#include <common/macros.h>
+#include <common/bug.h>
+#include <stdint.h>
#include <unistd.h>
#ifdef __linux__
LTTNG_HIDDEN
-int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
+int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
unsigned int flags)
{
+ LTTNG_BUILD_BUG_ON(sizeof(off_t) != sizeof(int64_t));
#ifdef HAVE_SYNC_FILE_RANGE
return sync_file_range(fd, offset, nbytes, flags);
#else
--- a/src/common/compat/fcntl.h
+++ b/src/common/compat/fcntl.h
@@ -13,16 +13,12 @@
#include <common/compat/errno.h>
-#if (defined(__CYGWIN__))
-typedef long long off64_t;
-#endif
-
#if (defined(__FreeBSD__) || defined(__sun__))
typedef off64_t loff_t;
#endif
#ifdef __linux__
-extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
+extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
unsigned int flags);
#define lttng_sync_file_range(fd, offset, nbytes, flags) \
compat_sync_file_range(fd, offset, nbytes, flags)
@@ -37,8 +33,8 @@ extern int compat_sync_file_range(int fd
#define SYNC_FILE_RANGE_WAIT_BEFORE 0
#define SYNC_FILE_RANGE_WRITE 0
-static inline int lttng_sync_file_range(int fd, off64_t offset,
- off64_t nbytes, unsigned int flags)
+static inline int lttng_sync_file_range(int fd, off_t offset,
+ off_t nbytes, unsigned int flags)
{
return -ENOSYS;
}

View File

@@ -0,0 +1,24 @@
From 2237748af00467ad8250a7ccd944200f811db69a Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Thu, 12 Dec 2019 16:52:07 +0100
Subject: [PATCH] tests: do not strip a helper library
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
index 836f13e..e19a554 100644
--- a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
+++ b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
@@ -14,7 +14,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la
libfoo.strip: libfoo.la
$(OBJCOPY) --strip-all .libs/libfoo.so
-all-local: libfoo.strip
+all-local:
@if [ x"$(srcdir)" != x"$(builddir)" ]; then \
for script in $(EXTRA_DIST); do \
cp -f $(srcdir)/$$script $(builddir); \

View File

@@ -0,0 +1,34 @@
Upstream-Status: Inappropriate [need to root cause the test hangs]
We keep seeing hangs in the tools/notifications tests on x86 and arm for
a variety of distros. Exclude them for now to work out if this is the
only place we see them and give SWAT/triage a break from the stream
of them.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14263
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Index: lttng-tools-2.13.1/tests/regression/Makefile.am
===================================================================
--- lttng-tools-2.13.1.orig/tests/regression/Makefile.am
+++ lttng-tools-2.13.1/tests/regression/Makefile.am
@@ -29,18 +29,6 @@ TESTS = tools/base-path/test_ust \
tools/crash/test_crash \
tools/regen-metadata/test_ust \
tools/regen-statedump/test_ust \
- tools/notification/test_notification_ust_error \
- tools/notification/test_notification_ust_buffer_usage \
- tools/notification/test_notification_ust_capture \
- tools/notification/test_notification_ust_event_rule_condition_exclusion \
- tools/notification/test_notification_kernel_error \
- tools/notification/test_notification_kernel_buffer_usage \
- tools/notification/test_notification_kernel_capture \
- tools/notification/test_notification_kernel_instrumentation \
- tools/notification/test_notification_kernel_syscall \
- tools/notification/test_notification_notifier_discarded_count \
- tools/notification/test_notification_kernel_userspace_probe \
- tools/notification/test_notification_multi_app \
tools/rotation/test_ust \
tools/rotation/test_kernel \
tools/rotation/test_save_load_mi \

View File

@@ -0,0 +1,9 @@
[Unit]
Description=LTTng 2.x central tracing registry session daemon
[Service]
Type=forking
ExecStart=/usr/bin/lttng-sessiond -d
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,45 @@
#!/bin/sh
# Without --ignore-exit, the tap harness causes any FAILs within a
# test plan to raise ERRORs; this is just noise.
#Detecting whether current system has lttng kernel modules
LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko
function validate_lttng_modules_present()
{
# Check for loadable modules.
if [ -f "$LTTNG_KMOD_PATH" ]; then
return 0
fi
# Check for builtin modules.
ls /proc/lttng > /dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
fi
return 1
}
export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs
makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH"
#If current system doesn't have lttng kernel modules, disable lttng kernel related tests.
validate_lttng_modules_present || {
makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1"
}
make -k -t all >error.log 2>&1
# Can specify a test e.g.:
# -C tests/regression/ check TESTS='kernel/test_callstack'
make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g'
exitcode=$?
if [ -e error.log ]; then
cat error.log
fi
if [ -e tests/unit/test-suite.log ]; then
cat tests/unit/test-suite.log
fi
if [ -e tests/regression/test-suite.log ]; then
cat tests/regression/test-suite.log
fi
exit $exitcode

View File

@@ -0,0 +1,197 @@
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."
HOMEPAGE = "https://github.com/lttng/lttng-tools"
LICENSE = "GPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \
file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \
file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95"
include lttng-platforms.inc
DEPENDS = "liburcu popt libxml2 util-linux bison-native"
RDEPENDS:${PN} = "libgcc"
RRECOMMENDS:${PN} += "${LTTNGMODULES}"
RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep binutils"
RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils"
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils"
# 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 ??= "${LTTNGUST} kmod"
PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod"
PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
file://0001-tests-do-not-strip-a-helper-library.patch \
file://run-ptest \
file://lttng-sessiond.service \
file://disable-tests.patch \
file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \
file://0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch \
file://0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch \
"
SRC_URI[sha256sum] = "ff5f4f00b081dac66092afe8e72b7c790670931cf1c1ee0deaa7f80fbc53883e"
inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep"
SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service"
SYSTEMD_AUTO_ENABLE = "disable"
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"
PRIVATE_LIBS:${PN}-ptest = "libfoo.so"
do_install:append () {
# install systemd unit file
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir}
}
do_install_ptest () {
for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/*.lttng \
tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \
tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \
tests/regression/tools/notification/util_event_generator.sh \
tests/regression/tools/base-path/*.lttng; do
install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
done
for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do
install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
done
# Patch in the correct path for the custom libraries a helper executable needs
sed -i -e 's!FIXMEPTESTPATH!${PTEST_PATH}!g' "${D}${PTEST_PATH}/run-ptest"
# 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" {} +
# Take all .py scripts for tests using the python bindings.
find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \
-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
for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
case $f in
*.so|userspace-probe-elf-*)
install -d ${D}${PTEST_PATH}/tests/$d/
ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f
# Remove any rpath/runpath to pass QA check.
chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f
;;
esac
done
done
chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary
chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so
chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so
#
# Use the versioned libs of liblttng-ust-dl.
#
ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py"
if [ -e $ustdl ]; then
sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl
fi
install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/
# 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:/' \
{} +
find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
touch -r "${B}/Makefile" {} +
#
# Need to stop generated binaries from rebuilding by removing their source dependencies
#
sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \
-e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \
-e 's#\(^test.*SOURCES.=\)#disable\1#g' \
-e 's#\(^test.*LDADD.=\)#disable\1#g' \
-i ${D}${PTEST_PATH}/tests/unit/Makefile
# Fix hardcoded build path
sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH="${PTEST_PATH}/tests/regression/#' \
-i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging
# Substitute links to installed binaries.
for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; 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
}
INHIBIT_PACKAGE_STRIP_FILES = "\
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary \
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary \
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary \
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/.libs/userspace-probe-elf-cxx-binary \
${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/gen-syscall-events \
${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/.libs/gen-syscall-events \
${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack \
${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/.libs/gen-syscall-events-callstack \
"

View File

@@ -0,0 +1,161 @@
From 5d10459b6b5182fcbc98240d9dace026c87a5037 Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 5 Aug 2024 15:41:34 -0400
Subject: [PATCH] Fix: Build examples when rpath is stripped from in-build-tree
libs
Observed issue
==============
Certain tool chains[1, 2] emit warnings or errors when building the
example applications.
```
make[3]: Entering directory
'/home/xxx/src/efficios/lttng/master/src/lttng-ust/doc/examples/easy-ust'
CC sample.o
CC tp.o
CCLD sample
/usr/bin/ld: warning: liblttng-ust-common.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblttng-ust-tracepoint.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_add_fd_to_tracker'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_after_fork_child'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_common_ctor'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_tp_init'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_tp_probe_register_queue_release'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_cancelstate_disable_pop'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_synchronize_rcu'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_register_thread'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_tp_probe_prune_release_queue'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_cancelstate_disable_push'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_before_fork'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_lock_fd_tracker'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_trace_clock'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_has_sys_membarrier'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_unlock_fd_tracker'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_tp_exit'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_get_cpu_sym'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_common_alloc_tls'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_after_fork_parent'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_delete_fd_from_tracker'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_register'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_reader'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_urcu_gp'
/usr/bin/ld: ../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined reference to `lttng_ust_tp_probe_unregister_queue_release'
collect2: error: ld returned 1 exit status
```
=== Reproducer ===
The easiest way to consistently reproduce this type of build failure
is to perform the following steps:
```
./configure
make -j$(nproc)
find . -iname '*.so' -exec chrpath -d {} \;
make -C doc/examples clean
make -j$(nproc)
```
As the examples are not built with libtool, finding the libraries to
link against depends on the shared objects having an rpath.
E.g.
```
$ chrpath src/lib/lttng-ust/.libs/liblttng-ust.so.1.0.0
src/lib/lttng-ust/.libs/liblttng-ust.so.1.0.0: RUNPATH=/home/xxx/src/efficios/lttng/master/src/lttng-ust/src/lib/lttng-ust-common/.libs:/home/xxx/src/efficios/lttng/master/src/lttng-ust/src/lib/lttng-ust-tracepoint/.libs:/home/xxx/src/efficios/lttng/master/usr/lib
```
The current examples build with `-Wl,-rpath` for `liblttng-ust`, but
not the dependencies of `liblttng-ust` (which would normally be found
via it's own rpath). If the `rpath` is stripped from
`liblttng-ust.so`, or if the tool chain ignores `rpath` explicitly,
then the build with fail.
In the case of a yocto build environment as in GitHub#61[1], the
following commands reproduced the warnings and the errors seen in the
above test case.
```
git clone git://git.yoctoproject.org/poky && cd poky/
. oe-init-build-env
echo "PACKAGECONFIG:pn-lttng-ust = 'examples'" >>conf/local.conf
bitbake lttng-ust
```
=== Solution ===
Explicitly add library search paths and set linker rpath-link are set
for both the standard and cmake examples. Similar changes were
proposed for each of those parts respectively in GitHub#61[1] and GitHub#63[2].
=== Known issues ===
While the `rpath-link` for the second order library dependencies will
allow the builds to complete, the examples will not work at
runtime even when using `rpath`. From `man ld.so`, the rpaths in an
executable or shared object are only considered for direct
dependencies. Therefore, without setting `LD_LIBRARY_PATH` or
installing the libraries test applications will fail as follows:
```
$ ./doc/examples/easy-ust/sample
./doc/examples/easy-ust/sample: error while loading shared libraries: liblttng-ust-common.so.1: cannot open shared object file: No such file or directory
```
References
==========
[1]: https://github.com/lttng/lttng-ust/pull/61
[2]: https://github.com/lttng/lttng-ust/pull/63
Change-Id: I273ccddd0d0b7a1b57b9e09ddf48d8b5b41e6f8e
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Upstream-Status: Backport [https://github.com/lttng/lttng-ust/commit/5d10459b6b5182fcbc98240d9dace026c87a5037]
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
doc/examples/Makefile.am | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index aebf63bd..79766ec0 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -169,7 +169,10 @@ all-local:
CFLAGS='$(CFLAGS)' \
AM_CFLAGS='$(AM_CFLAGS)' \
LDFLAGS="$(LDFLAGS)" \
- AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/lib/lttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/lib/lttng-ust/.libs/"' \
+ AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -L../../../src/lib/lttng-ust-common/.libs -L../../../src/lib/lttng-ust-tracepoint/.libs \
+ -Wl,-rpath="$(abs_top_builddir)/src/lib/lttng-ust/.libs/" \
+ -Wl,-rpath-link="$(abs_top_builddir)/src/lib/lttng-ust-common/.libs/" \
+ -Wl,-rpath-link="$(abs_top_builddir)/src/lib/lttng-ust-tracepoint/.libs/"' \
LTTNG_GEN_TP_PATH="$$rel_src_subdir$(top_srcdir)/tools/" \
AM_V_P="$(AM_V_P)" \
AM_V_at="$(AM_V_at)" \
@@ -222,10 +225,14 @@ all-local:
CXX="$(CXX)" \
$(CMAKE) \
-DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \
- -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/src/lib/lttng-ust/.libs" \
+ -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/src/lib/lttng-ust/.libs;$(abs_top_builddir)/src/lib/lttng-ust-common/.libs;$(abs_top_builddir)/src/lib/lttng-ust-tracepoint/.libs" \
-DCMAKE_C_FLAGS="$(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(AM_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS)" \
- -DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
+ -DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS) \
+ -L../../../src/lib/lttng-ust/.libs -L../../../src/lib/lttng-ust-common/.libs -L../../../src/lib/lttng-ust-tracepoint/.libs \
+ -Wl,-rpath=$(abs_top_builddir)/src/lib/lttng-ust/.libs/ \
+ -Wl,-rpath-link=$(abs_top_builddir)/src/lib/lttng-ust-common/.libs/ \
+ -Wl,-rpath-link=$(abs_top_builddir)/src/lib/lttng-ust-tracepoint/.libs/" \
.. && \
$(MAKE) \
) || exit 1; \
--
2.43.0

View File

@@ -0,0 +1,26 @@
From 27402453f25fbdb5a9fb1a1b88d1c4d9852187d2 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Sun, 5 Sep 2021 10:44:19 +0200
Subject: [PATCH] lttng-ust-common: link with liburcu explicitly
Otherwise linking errors are seen on x86-32.
Upstream-Status: Submitted [by email to lttng-dev, Francis, Jonathan]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/lib/lttng-ust-common/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lib/lttng-ust-common/Makefile.am b/src/lib/lttng-ust-common/Makefile.am
index 1ccc290..6531fa0 100644
--- a/src/lib/lttng-ust-common/Makefile.am
+++ b/src/lib/lttng-ust-common/Makefile.am
@@ -16,6 +16,7 @@ liblttng_ust_common_la_SOURCES = \
liblttng_ust_common_la_LIBADD = \
$(top_builddir)/src/common/libcommon.la \
+ $(URCU_LIBS) \
$(DL_LIBS)
liblttng_ust_common_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION)

View File

@@ -0,0 +1,29 @@
From f65efd963e52de51d35e2e03fb773f33dd64f565 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Tue, 20 Feb 2024 12:19:06 +0000
Subject: [PATCH] python-lttngust/Makefile.am: Add --install-lib to setup.py
Otherwise it may install to /usr/lib, but should be /usr/lib64 when cross
building.
Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/59]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
src/python-lttngust/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am
index d53e21d..283901e 100644
--- a/src/python-lttngust/Makefile.am
+++ b/src/python-lttngust/Makefile.am
@@ -45,7 +45,7 @@ install-exec-local: build-python-bindings.stamp
if [ "$(DESTDIR)" != "" ]; then \
opts="$$opts --root=$(DESTDIR)"; \
fi; \
- $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts;
+ $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts --install-lib=$(pythondir);
clean-local:
rm -rf $(builddir)/build

View File

@@ -0,0 +1,53 @@
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 = "LGPL-2.1-or-later & MIT & GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a46577a38ad0c36ff6ff43ccf40c480f"
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}' \
"
inherit autotools lib_package manpages python3native pkgconfig
include lttng-platforms.inc
EXTRA_OECONF = "--disable-numa"
CPPFLAGS:append:arm = "${@oe.utils.vartrue('DEBUG_BUILD', '-DUATOMIC_NO_LINK_ERROR', '', d)}"
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://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \
file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \
file://0001-Fix-Build-examples-when-rpath-is-stripped-from-in-bu.patch \
"
SRC_URI[sha256sum] = "d4ef98dab9a37ad4f524ccafdfd50af4f266039b528dd5afabce78e49024d937"
CVE_PRODUCT = "ust"
PACKAGECONFIG[examples] = "--enable-examples, --disable-examples,"
PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3"
FILES:${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*"
FILES:${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a"
FILES:${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la"
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
}

View File

@@ -0,0 +1,38 @@
SUMMARY = "Build tools needed by external modules"
HOMEPAGE = "https://www.yoctoproject.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
inherit kernel-arch linux-kernel-base
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"
DEV_PKG_DEPENDENCY = ""
DEPENDS += "bc-native bison-native"
DEPENDS += "gmp-native"
EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}"
KERNEL_LOCALVERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}"
export LOCALVERSION="${KERNEL_LOCALVERSION}"
# 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
for t in prepare scripts_basic scripts; do
oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
STRIP="${KERNEL_STRIP}" \
-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
done
}

View File

@@ -0,0 +1,59 @@
#!/bin/sh
#
# SPDX-License-Identifier: MIT
#
### 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
[ -d /lib/modules/`uname -r` ] || exit 0
# Test if modules.dep exists and has a size greater than zero
if [ ! -s /lib/modules/`uname -r`/modules.dep ]; then
[ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
depmod -a
fi
[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
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

View File

@@ -0,0 +1,31 @@
SUMMARY = "Initscript for auto-loading kernel modules on boot"
SECTION = "base"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://modutils.sh;beginline=3;endline=3;md5=b2dccaa94b3629a08bfb4f983cad6f89"
SRC_URI = "file://modutils.sh"
S = "${WORKDIR}"
INITSCRIPT_NAME = "modutils.sh"
INITSCRIPT_PARAMS = "start 06 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 type systemctl >/dev/null 2>/dev/null; then
if [ -n "$D" ]; then
OPTS="--root=$D"
fi
systemctl $OPTS mask modutils.service
fi
}

View File

@@ -0,0 +1,11 @@
inherit perlnative cpan-base
# Env var which tells perl if it should use host (no) or target (yes) settings
export PERLCONFIGTARGET = "${@is_target(d)}"
export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE"
export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}"
export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
# The perl symbols CPPSTDIN and CPPRUN embed the sysroot into the
# binaries, work needed to remove this
INSANE_SKIP:${PN}-dbg += "buildpaths"

View File

@@ -0,0 +1,422 @@
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 = "GPL-2.0-only"
PACKAGECONFIG ??= "python tui libunwind libtraceevent"
PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl"
PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3 python3-setuptools-native"
# 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[bfd] = ",NO_LIBBFD=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"
PACKAGECONFIG[manpages] = ",,xmlto-native asciidoc-native"
PACKAGECONFIG[cap] = ",,libcap"
PACKAGECONFIG[libtraceevent] = ",NO_LIBTRACEEVENT=1,libtraceevent"
# jevents requires host python for generating a .c file, but is
# unrelated to the python item.
PACKAGECONFIG[jevents] = ",NO_JEVENTS=1,python3-native"
# Arm CoreSight
PACKAGECONFIG[coresight] = "CORESIGHT=1,,opencsd"
PACKAGECONFIG[pfm4] = ",NO_LIBPFM4=1,libpfm4"
PACKAGECONFIG[babeltrace] = ",NO_LIBBABELTRACE=1,babeltrace"
# libunwind is not yet ported for some architectures
PACKAGECONFIG:remove:arc = "libunwind"
PACKAGECONFIG:remove:riscv32 = "libunwind"
DEPENDS = " \
virtual/${MLPREFIX}libc \
${MLPREFIX}elfutils \
${MLPREFIX}binutils \
bison-native flex-native xz \
"
do_configure[depends] += "virtual/kernel:do_shared_workdir"
PROVIDES = "virtual/perf"
inherit linux-kernel-base kernel-arch manpages
# needed for building the tools/perf Python bindings
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
inherit python3-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_shared_workdir"
# needed for building the tools/perf Perl binding
include ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perf-perl.inc', '', 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"
# Perf's build system adds its own optimization flags for most TUs,
# overriding the flags included here. But for some, perf does not add
# any -O option, so ensure the distro's chosen optimization gets used
# for those. Since ${SELECTED_OPTIMIZATION} always includes
# ${DEBUG_FLAGS} which in turn includes ${DEBUG_PREFIX_MAP}, this also
# ensures perf is built with appropriate -f*-prefix-map options,
# avoiding the 'buildpaths' QA warning.
TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}"
EXTRA_OEMAKE = '\
V=1 \
VF=1 \
-C ${S}/tools/perf \
O=${B} \
CROSS_COMPILE=${TARGET_PREFIX} \
ARCH=${ARCH} \
CC="${CC}" \
CCLD="${CC}" \
LDSHARED="${CC} -shared" \
AR="${AR}" \
LD="${LD}" \
EXTRA_CFLAGS="-ldw -I${S}" \
YFLAGS='-y --file-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}' \
EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \
perfexecdir=${libexecdir} \
NO_GTK2=1 \
${PACKAGECONFIG_CONFARGS} \
PKG_CONFIG=pkg-config \
TMPDIR="${B}" \
LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \
'
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)}' \
${@bb.utils.contains('PACKAGECONFIG', 'python', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
"
# During do_configure, we might run a 'make clean'. That often breaks
# when done in parallel, so disable parallelism for do_configure. Note
# that it has to be done this way rather than by passing -j1, since
# perf's build system by default ignores any -j argument, but does
# honour a JOBS variable.
EXTRA_OEMAKE:append:task-configure = " JOBS=1"
# the architectures that need this file can be found in
# tools/include/uapi/asm/bpf_perf_event.h
# We are only listing supported arches at the moment
PERF_BPF_EVENT_SRC ?= '${@bb.utils.contains_any("ARCH", [ "riscv", "arm64" ], "arch/${ARCH}/include/uapi/asm/bpf_perf_event.h", "", d)}'
PERF_SRC ?= "Makefile \
tools/arch \
tools/build \
tools/include \
tools/lib \
tools/Makefile \
tools/perf \
tools/scripts \
scripts/ \
arch/arm64/tools \
${PERF_BPF_EVENT_SRC} \
arch/${ARCH}/Makefile \
"
PERF_EXTRA_LDFLAGS = ""
# MIPS N32/N64
PERF_EXTRA_LDFLAGS:mipsarchn32eb = "-m elf32btsmipn32"
PERF_EXTRA_LDFLAGS:mipsarchn32el = "-m elf32ltsmipn32"
PERF_EXTRA_LDFLAGS:mipsarchn64eb = "-m elf64btsmip"
PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip"
do_compile() {
# Linux kernel build system is expected to do the right thing
unset CFLAGS
test -e ${S}/tools/lib/traceevent/plugins/Makefile && \
sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile
test -e ${S}/tools/perf/Makefile.config && \
sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/perf/Makefile.config
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', 'python', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
oe_runmake DESTDIR=${D} install-python_ext
if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then
sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt
fi
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)
bb.utils.prunedir(dest_dir)
for s in sources:
src = oe.path.join(src_dir, s)
dest = oe.path.join(dest_dir, s)
if not os.path.exists(src):
bb.warn("Path does not exist: %s. Maybe PERF_SRC lists more files than what your kernel version provides and needs." % src)
continue
if os.path.isdir(src):
oe.path.copyhardlinktree(src, dest)
else:
src_path = os.path.dirname(s)
os.makedirs(os.path.join(dest_dir,src_path),exist_ok=True)
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
# Variant with linux-yocto-specific patch
sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \
${S}/tools/perf/Makefile.perf
# Variant for mainline Linux
sed -i -e "s,root='/\$(DESTDIR_SQ)',prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='/\$(DESTDIR_SQ)',g" \
${S}/tools/perf/Makefile.perf
# backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_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
# start reproducibility substitutions
if [ -e "${S}/tools/perf/Makefile.config" ]; then
# The following line in the Makefle:
# override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON_AUTO))
# "PYTHON" / "PYTHON_AUTO" have the full path as part of the variable. We've
# ensure that the environment is setup and we do not need the full path to be
# captured, since the symbol gets built into the executable, making it not
# reproducible.
sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO)),$(notdir $(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO))),g' \
${S}/tools/perf/Makefile.config
# The same line is in older releases, but looking explicitly for Python 2
sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(PYTHON2)),$(notdir $(call get-executable-or-default\,PYTHON\,$(PYTHON2))),g' \
${S}/tools/perf/Makefile.config
# likewise with this substitution. Kernels with commit 18f2967418d031a39
# [perf tools: Use Python devtools for version autodetection rather than runtime]
# need this substitution for reproducibility.
sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(subst -config\,\,$(PYTHON_AUTO))),$(notdir $(call get-executable-or-default\,PYTHON\,$(subst -config\,\,$(PYTHON_AUTO)))),g' \
${S}/tools/perf/Makefile.config
# The following line:
# srcdir_SQ = $(patsubst %tools/perf,tools/perf,$(subst ','\'',$(srcdir))),
# Captures the full src path of perf, which of course makes it not
# reproducible. We really only need the relative location 'tools/perf', so we
# change the Makefile line to remove everything before 'tools/perf'
sed -i -e "s%srcdir_SQ = \$(subst ','\\\'',\$(srcdir))%srcdir_SQ = \$(patsubst \%tools/perf,tools/perf,\$(subst ','\\\'',\$(srcdir)))%g" \
${S}/tools/perf/Makefile.config
# Avoid hardcoded path to python-native
sed -i -e 's#\(PYTHON_WORD := \)$(call shell-wordify,$(PYTHON))#\1 python3#g' \
${S}/tools/perf/Makefile.config
fi
if [ -e "${S}/tools/perf/tests/Build" ]; then
# OUTPUT is the full path, we have python on the path so we remove it from the
# definition. This is captured in the perf binary, so breaks reproducibility
sed -i -e 's,PYTHONPATH="BUILD_STR($(OUTPUT)python)",PYTHONPATH="BUILD_STR(python)",g' \
${S}/tools/perf/tests/Build
fi
if [ -e "${S}/tools/perf/util/Build" ]; then
# To avoid bison generating #ifdefs that have captured paths, we make sure
# all the calls have YFLAGS, which contains prefix mapping information.
sed -i -e 's,$(BISON),$(BISON) $(YFLAGS),g' ${S}/tools/perf/util/Build
fi
if [ -e "${S}/scripts/Makefile.host" ]; then
# To avoid yacc (bison) generating #ifdefs that have captured paths, we make sure
# all the calls have YFLAGS, which contains prefix mapping information.
sed -i -e 's,$(YACC),$(YACC) $(YFLAGS),g' ${S}/scripts/Makefile.host
fi
if [ -e "${S}/tools/perf/pmu-events/Build" ]; then
target='$(OUTPUT)pmu-events/pmu-events.c $(V)'
replacement1='$(OUTPUT)pmu-events/pmu-events.c $(V)\n'
replacement2='\t$(srctree)/sort-pmuevents.py $(OUTPUT)pmu-events/pmu-events.c $(OUTPUT)pmu-events/pmu-events.c.new\n'
replacement3='\tcp $(OUTPUT)pmu-events/pmu-events.c.new $(OUTPUT)pmu-events/pmu-events.c'
sed -i -e "s,$target,$replacement1$replacement2$replacement3,g" \
"${S}/tools/perf/pmu-events/Build"
fi
if [ -e "${S}/tools/perf/pmu-events/jevents.py" ]; then
sed -i -e "s#os.scandir(path)#sorted(os.scandir(path), key=lambda e: e.name)#g" \
"${S}/tools/perf/pmu-events/jevents.py"
fi
if [ -e "${S}/tools/perf/arch/arm64/Makefile" ]; then
sed -i 's,sysdef := $(srctree)/,sysdef := ,' ${S}/tools/perf/arch/arm64/Makefile
sed -i 's,$(incpath) $(sysdef),$(incpath) $(srctree)/$(sysdef) $(sysdef),' ${S}/tools/perf/arch/arm64/Makefile
fi
if [ -e "${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl" ]; then
if ! grep -q input_rel ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl; then
sed -i 's,input=$4,input=$4\ninput_rel=$5,' ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
fi
sed -i 's,#include \\"\$input\\",#include \\"\$input_rel\\",' ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
fi
# end reproducibility substitutions
# 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
sed -i 's,PKG_CONFIG = $(CROSS_COMPILE)pkg-config,#PKG_CONFIG,' ${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
# The libperl feature check produces fatal warnings due to -Werror being
# used, silence enough errors that the check passes.
sed -i 's/\(FLAGS_PERL_EMBED=.*\)/\1 -Wno-error=unused-function -Wno-error=attributes/' ${S}/tools/build/feature/Makefile
# 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/ -name '*.py'` `find ${S}/scripts/ -name 'bpf_helpers_doc.py'`; do
sed -i -e "s,#!.*python.*,#!${USRBINPATH}/env python3," ${s}
done
# unistd.h can be out of sync between libc-headers and the captured version in the perf source
# so we copy it from the sysroot unistd.h to the perf unistd.h
install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h
install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/include/uapi/asm-generic/unistd.h
# the fetcher is inhibited by the 'inherit kernelsrc', so we do a quick check and
# copy for a helper script we need
for p in $(echo ${FILESPATH} | tr ':' '\n'); do
if [ -e $p/sort-pmuevents.py ]; then
cp $p/sort-pmuevents.py ${S}
fi
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}-archive =+ "bash"
RDEPENDS:${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}"
RDEPENDS:${PN}-perl =+ "bash perl perl-modules"
RDEPENDS:${PN}-tests =+ "python3 bash perl"
RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests \
${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)} \
"
FILES_SOLIBSDEV = ""
FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent* ${libdir}/libperf-jvmti.so"
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"
DEBUG_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized"
PACKAGESPLITFUNCS =+ "perf_fix_sources"
perf_fix_sources () {
for f in util/parse-events-flex.h util/parse-events-flex.c util/pmu-flex.c \
util/pmu-flex.h util/expr-flex.h util/expr-flex.c; do
f=${PKGD}${TARGET_DBGSRC_DIR}/$f
if [ -e $f ]; then
sed -i -e 's#${S}/##g' $f
fi
done
}

View File

@@ -0,0 +1,100 @@
#!/usr/bin/env python3
# perf pmu-events sorting tool
#
# Copyright (C) 2021 Bruce Ashfield
#
# SPDX-License-Identifier: MIT
#
import sys
import os
import re
from collections import OrderedDict
if len(sys.argv) < 2:
print( "[ERROR]: input and output pmu files missing" )
sys.exit(1)
if len(sys.argv) < 3:
print( "[ERROR]: output pmu file missing" )
sys.exit(1)
infile = sys.argv[1]
outfile = sys.argv[2]
if not os.path.exists(infile):
print( "ERROR. input file does not exist: %s" % infile )
sys.exit(1)
if os.path.exists(outfile):
print( "WARNING. output file will be overwritten: %s" % infile )
with open(infile, 'r') as file:
data = file.read()
preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL )
preamble = re.search( preamble_regex, data )
struct_block_regex = re.compile(r'^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL )
field_regex = re.compile(r'{.*?},', re.MULTILINE | re.DOTALL )
cpuid_regex = re.compile(r'\.cpuid = (.*?),', re.MULTILINE | re.DOTALL )
name_regex = re.compile(r'\.name = (.*?),', re.MULTILINE | re.DOTALL )
# create a dictionary structure to store all the structs, their
# types and then their fields.
entry_dict = {}
for struct in re.findall( struct_block_regex, data ):
# print( "struct: %s %s %s" % (struct[0],struct[1],struct[2]) )
entry_dict[struct[2]] = {}
entry_dict[struct[2]]['type_prefix'] = struct[0]
entry_dict[struct[2]]['type'] = struct[1]
entry_dict[struct[2]]['fields'] = {}
for entry in re.findall( field_regex, struct[3] ):
#print( " entry: %s" % entry )
cpuid = re.search( cpuid_regex, entry )
if cpuid:
#print( " cpuid found: %s" % cpuid.group(1) )
entry_dict[struct[2]]['fields'][cpuid.group(1)] = entry
name = re.search( name_regex, entry )
if name:
#print( " name found: %s" % name.group(1) )
entry_dict[struct[2]]['fields'][name.group(1)] = entry
# unmatched entries are most likely array terminators and
# should end up as the last element in the sorted list, which
# is achieved by using '0' as the key
if not cpuid and not name:
entry_dict[struct[2]]['fields']['0'] = entry
# created ordered dictionaries from the captured values. These are ordered by
# a sorted() iteration of the keys. We don't care about the order we read
# things, just the sorted order. Hency why we couldn't create these during
# reading.
#
# yes, there's a more concise way to do this, but our nested dictionaries of
# fields make it complex enough that it becomes unreadable.
entry_dict_sorted = OrderedDict()
for i in sorted(entry_dict.keys()):
entry_dict_sorted[i] = {}
entry_dict_sorted[i]['type_prefix'] = entry_dict[i]['type_prefix']
entry_dict_sorted[i]['type'] = entry_dict[i]['type']
entry_dict_sorted[i]['fields'] = {}
for f in sorted(entry_dict[i]['fields'].keys()):
entry_dict_sorted[i]['fields'][f] = entry_dict[i]['fields'][f]
# dump the sorted elements to the outfile
outf = open( outfile, 'w' )
print( preamble.group(1) )
outf.write( preamble.group(1) )
for d in entry_dict_sorted:
outf.write( "%s %s %s[] = {\n" % (entry_dict_sorted[d]['type_prefix'], entry_dict_sorted[d]['type'],d) )
for f in entry_dict_sorted[d]['fields']:
outf.write( entry_dict_sorted[d]['fields'][f] + '\n' )
outf.write( "};\n" )
outf.close()

View File

@@ -0,0 +1,55 @@
From 4c24fdd8e0a42359df7308155b2d43c28a5e02fd Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Mon, 20 May 2019 20:25:00 +0200
Subject: [PATCH] wakeup_xxx.h: include limits.h
limits.h must be included to define PATH_MAX otherwise build will fail
on:
In file included from wakeup/wakeup_ethernet.cpp:45:0:
wakeup/wakeup_ethernet.h:35:16: error: 'PATH_MAX' was not declared in this scope
char eth_path[PATH_MAX];
In file included from wakeup/wakeup_usb.cpp:45:0:
wakeup/wakeup_usb.h:35:16: error: 'PATH_MAX' was not declared in this scope
char usb_path[PATH_MAX];
Fixes:
- http://autobuild.buildroot.org/results/a0b3337cf4a827e6566f8b15b6bb180f0dcef7a3
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Upstream-Status: Submitted [https://lists.01.org/pipermail/powertop/2019-May/002052.html]
---
src/wakeup/wakeup_ethernet.h | 1 +
src/wakeup/wakeup_usb.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/wakeup/wakeup_ethernet.h b/src/wakeup/wakeup_ethernet.h
index 682bf95..e0fa628 100644
--- a/src/wakeup/wakeup_ethernet.h
+++ b/src/wakeup/wakeup_ethernet.h
@@ -25,6 +25,7 @@
#ifndef _INCLUDE_GUARD_ETHERNET_WAKEUP_H
#define _INCLUDE_GUARD_ETHERNET_WAKEUP_H
+#include <limits.h>
#include <vector>
#include "wakeup.h"
diff --git a/src/wakeup/wakeup_usb.h b/src/wakeup/wakeup_usb.h
index f7a1f7e..15898e3 100644
--- a/src/wakeup/wakeup_usb.h
+++ b/src/wakeup/wakeup_usb.h
@@ -25,6 +25,7 @@
#ifndef _INCLUDE_GUARD_USB_WAKEUP_H
#define _INCLUDE_GUARD_USB_WAKEUP_H
+#include <limits.h>
#include <vector>
#include "wakeup.h"
--
2.20.1

View File

@@ -0,0 +1,24 @@
SUMMARY = "Power usage tool"
DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management."
HOMEPAGE = "https://01.org/powertop/"
BUGTRACKER = "https://app.devzing.com/powertopbugs/bugzilla"
DEPENDS = "ncurses libnl pciutils autoconf-archive-native"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
SRC_URI = "git://github.com/fenrus75/powertop;protocol=https;branch=master \
file://0001-wakeup_xxx.h-include-limits.h.patch \
"
SRCREV = "d51ad395436d4d1dcc3ca46e1519ffeb475bf651"
S = "${WORKDIR}/git"
LDFLAGS:append = " -pthread"
inherit autotools gettext pkgconfig bash-completion
inherit update-alternatives
ALTERNATIVE:${PN} = "powertop"
ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop"
ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop"
ALTERNATIVE_PRIORITY = "100"

View File

@@ -0,0 +1,6 @@
require systemtap_git.bb
inherit_defer native
addtask addto_recipe_sysroot after do_populate_sysroot before do_build

View File

@@ -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

View File

@@ -0,0 +1,56 @@
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>
Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
setup.py
Supply "--root" directory to the "install" command, and use
it as a prefix to strip off the purported filename encoded
in bytecode files. (It strips build path prefix from .pyc files)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
python/Makefile.am | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index a254480..578602f 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -8,6 +8,10 @@ AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = -I$(srcdir)/../includes
AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys
+# Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
+# fix build path issue
+AM_CPPFLAGS += $(CFLAGS)
+
# Any script in the following variable will get byte-compiled at
# install time.
pkglibexecpython_PYTHON =
@@ -47,7 +51,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 --root $(DESTDIR) --prefix $(prefix) --prefix $(prefix) --install-lib=${pythondir} \
--single-version-externally-managed \
--record $(shell readlink -f $(builddir))/py2build/install_files.txt \
--verbose)
@@ -55,7 +59,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 --root $(DESTDIR) --prefix $(prefix) --install-lib=${python3dir} \
--single-version-externally-managed \
--record $(shell readlink -f $(builddir))/py3build/install_files.txt \
--verbose)
--
2.7.4

View File

@@ -0,0 +1,40 @@
From 5a01e28bd806326b2143e3e6bb28d4780c5d879d Mon Sep 17 00:00:00 2001
From: Victor Kamensky <victor.kamensky7@gmail.com>
Date: Sun, 3 Dec 2023 18:40:05 -0800
Subject: [PATCH] Makefile.am: remove runtime/linux/uprobes and
runtime/linux/uprobes2 install
"PR30434 continuation: Removed old uprobes, uprobes2 implementation,
uprobes-inc.h & any mentions of CONFIG_UTRACE." commit removed uprobes,
and uprobes2 sources and directories, but Makefile.am still tries to
install them. In fact after failing to 'cd' into runtime/linux/uprobes
directory it copies top level *.[ch] files into
${prefix}/share/systemtap/runtime/linux/uprobes directory.
The issue was caught by OpenEmbedded project do_package_qa checks.
Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
Upstream-Status: Submitted [https://sourceware.org/pipermail/systemtap/2023q4/027880.html]
---
Makefile.am | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 5737c6b20..2ba896088 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -277,10 +277,6 @@ endif
do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/softfloat/$$f; done)
(cd $(srcdir)/runtime/linux; for f in *.[ch]; \
do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/$$f; done)
- (cd $(srcdir)/runtime/linux/uprobes; for f in Makefile *.[ch]; \
- do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes/$$f; done)
- (cd $(srcdir)/runtime/linux/uprobes2; for f in *.[ch]; \
- do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes2/$$f; done)
(cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name '*.stpm' -o -name README \) -print \
| while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
(cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
--
2.31.1

View File

@@ -0,0 +1,40 @@
From d42139cf9cd26d0c0363fcfe007716baeb8de517 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Fri, 22 Dec 2023 19:42:38 +0000
Subject: [PATCH] bpf-translate.cxx: fix build against upcoming `gcc-14`
(`-Werror=calloc-transposed-args`)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `systemtap`:
bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)':
bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
5044 | bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
| ^~~~~~~~~~~~~~~~
bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of each element
Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=d42139cf9cd26d0c0363fcfe007716baeb8de517]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
bpf-translate.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bpf-translate.cxx b/bpf-translate.cxx
index 1a9302463..aa8ef65ce 100644
--- a/bpf-translate.cxx
+++ b/bpf-translate.cxx
@@ -5041,9 +5041,9 @@ output_probe(BPF_Output &eo, program &prog,
}
}
- bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
+ bpf_insn *buf = (bpf_insn*) calloc (ninsns, sizeof(bpf_insn));
assert (buf);
- Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc);
+ Elf64_Rel *rel = (Elf64_Rel*) calloc (nreloc, sizeof(Elf64_Rel));
assert (rel);
unsigned i = 0, r = 0;
--
2.43.0

View File

@@ -0,0 +1,51 @@
From 3913ad3e28a19811e1b52338112344a487057e4f Mon Sep 17 00:00:00 2001
From: Victor Kamensky <victor.kamensky7@gmail.com>
Date: Mon, 18 Dec 2023 03:13:38 +0000
Subject: [PATCH 1/2] configure.ac: fix broken libdebuginfod library auto
detection
After 2e67b053e3796ee7cf29a39f9698729b52078406 "configury: rework debuginfod searches"
commit, libdebuginfod.so library auto detection is broken. It was reported by Martin Jansa
on openembedded-core mailing list [1].
Currently configure.ac does "AC_DEFINE([HAVE_LIBDEBUGINFOD], [1] ..." as long as
no --without-debuginfod option is passed, regardless PKG_CHECK_MODULES check result.
It seems to be bad copy/paste. Address the issue by moving the AC_DEFINE back to
PKG_CHECK_MODULES action-if-found block.
To reproduce the issue on FC system, one can do the following
"sudo dnf remove elfutils-debuginfod-client-devel" and then try to build SystemTap
util.cxx will fail to compile because of missing elfutils/debuginfod.h because
config.h will have "#define HAVE_LIBDEBUGINFOD 1", while config.log and configure
output indicates that check for libdebuginfod library failed.
[1] https://lists.openembedded.org/g/openembedded-core/message/192109?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Acreated%2C0%2Csystemtap%2C20%2C2%2C0%2C102987514
Upstream-Status: Submitted [https://sourceware.org/pipermail/systemtap/2023q4/027914.html]
Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
---
configure.ac | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index d9559c5c3..18cd7f84a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,12 +219,11 @@ dnl take the user at his or her word
elif test "x$with_debuginfod" != xno; then
dnl check in the system pkgconfig
PKG_CHECK_MODULES([debuginfod], [libdebuginfod >= 0.179],
- [have_debuginfod=1],
+ [have_debuginfod=1
+ AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
[if test "x$with_debuginfod" = xyes; then
AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
fi])
- AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])
- AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
--
2.31.1

View File

@@ -0,0 +1,32 @@
From 91caf37e4dfe862f9b68447b1597c0d0f31523c3 Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <fche@redhat.com>
Date: Tue, 7 May 2024 15:04:04 -0400
Subject: [PATCH] elaborate.cxx: gcc version compatibility hack redux
Note __GNUC__ >= 14 for this diagnostic.
Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=91caf37e4dfe862f9b68447b1597c0d0f31523c3]
Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
---
elaborate.cxx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/elaborate.cxx b/elaborate.cxx
index 88505559b..c08023f1d 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -2656,9 +2656,11 @@ symresolution_info::symresolution_info (systemtap_session& s, bool omniscient_un
session (s), unmangled_p(omniscient_unmangled), current_function (0), current_probe (0)
{
#pragma GCC diagnostic push
+ #if __GNUC__ >= 14
// c10s early snapshot GCC complains about this construct, which is
// made safe via our dtor usage
#pragma GCC diagnostic ignored "-Wdangling-pointer"
+ #endif
saved_session_symbol_resolver = s.symbol_resolver;
s.symbol_resolver = this; // save resolver for early PR25841 function resolution
#pragma GCC diagnostic pop
--
2.45.2

View File

@@ -0,0 +1,52 @@
From d11241bdd05bc4c745c8aef53a2725331e1a93b4 Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <fche@redhat.com>
Date: Tue, 7 May 2024 14:25:12 -0400
Subject: [PATCH] elaborate.cxx: gcc version compatibility hack
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Suppress -Wdangling-pointer for a construct that appears valid, but
one particular GCC snapshot version complains about.
In constructor symresolution_info::symresolution_info(systemtap_session&, bool),
inlined from int semantic_pass_symbols(systemtap_session&) at ../systemtap/elaborate.cxx:1872:28:
../systemtap/elaborate.cxx:2659:21: error: storing the address of local variable sym in *s.systemtap_session::symbol_resolver [-Werror=dangling-pointer=]
2659 | s.symbol_resolver = this; // save resolver for early PR25841 function resolution
| ~~~~~~~~~~~~~~~~~~^~~~~~
../systemtap/elaborate.cxx: In function int semantic_pass_symbols(systemtap_session&):
../systemtap/elaborate.cxx:1872:22: note: sym declared here
1872 | symresolution_info sym (s);
| ^~~
../systemtap/elaborate.cxx:1870:43: note: s declared here
1870 | semantic_pass_symbols (systemtap_session& s)
| ~~~~~~~~~~~~~~~~~~~^
cc1plus: all warnings being treated as errors
Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=d11241bdd05bc4c745c8aef53a2725331e1a93b4]
Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
---
elaborate.cxx | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/elaborate.cxx b/elaborate.cxx
index 8bf9e6c06..88505559b 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -2655,8 +2655,13 @@ semantic_pass (systemtap_session& s)
symresolution_info::symresolution_info (systemtap_session& s, bool omniscient_unmangled):
session (s), unmangled_p(omniscient_unmangled), current_function (0), current_probe (0)
{
+ #pragma GCC diagnostic push
+ // c10s early snapshot GCC complains about this construct, which is
+ // made safe via our dtor usage
+ #pragma GCC diagnostic ignored "-Wdangling-pointer"
saved_session_symbol_resolver = s.symbol_resolver;
s.symbol_resolver = this; // save resolver for early PR25841 function resolution
+ #pragma GCC diagnostic pop
}
--
2.45.2

View File

@@ -0,0 +1,31 @@
From 6288ba5df0a8c73ef842b609081449ac4de86123 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 18 Jul 2018 16:58:33 +0800
Subject: [PATCH] improve reproducibility for c++ compiling
Use relative dir to include header string_ref to
strip build path prefix in c++ object file
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
stringtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stringtable.h b/stringtable.h
index 5fc42e7..6fd8a1e 100644
--- a/stringtable.h
+++ b/stringtable.h
@@ -19,7 +19,7 @@
#if defined(HAVE_BOOST_UTILITY_STRING_REF_HPP)
#include <boost/version.hpp>
-#include <boost/utility/string_ref.hpp> //header with string_ref
+#include "@RELATIVE_STAGING_INCDIR@/boost/utility/string_ref.hpp" //header with string_ref
// XXX: experimental tunables
#define INTERNED_STRING_FIND_MEMMEM 1 /* perf stat indicates a very slight benefit */
--
2.7.4

View File

@@ -0,0 +1,23 @@
From cfc2c1d53924face11e3fab78ded61c359778eb9 Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <fche@redhat.com>
Date: Sat, 4 Nov 2023 12:19:59 -0400
Subject: [PATCH] prerelease datestamp fixes
Upstream-Status: Backport
---
NEWS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index c7f31e8b7..f0f9056c4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-* What's new in version 5.0, 2023-11-03
+* What's new in version 5.0, 2023-11-04
- Performance improvements in uprobe registration and module startup.
--
2.31.1

View File

@@ -0,0 +1,61 @@
From 191f528da19193d713d94ee252e2485efd9af4d3 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 25 Oct 2021 17:59:24 +0200
Subject: [PATCH] staprun: address ncurses 6.3 failures
Upstream-Status: Submitted [by email to smakarov@redhat.com,systemtap@sourceware.org]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
staprun/monitor.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/staprun/monitor.c b/staprun/monitor.c
index 478634c09..f4fbfd686 100644
--- a/staprun/monitor.c
+++ b/staprun/monitor.c
@@ -448,12 +448,12 @@ void monitor_render(void)
if (active_window == 0)
wattron(status, A_BOLD);
wprintw(status, "\n%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%s\n",
- width[p_index], HIGHLIGHT("index", p_index, comp_fn_index),
- width[p_state], HIGHLIGHT("state", p_state, comp_fn_index),
- width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index),
- width[p_min], HIGHLIGHT("min", p_min, comp_fn_index),
- width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index),
- width[p_max], HIGHLIGHT("max", p_max, comp_fn_index),
+ (int)width[p_index], HIGHLIGHT("index", p_index, comp_fn_index),
+ (int)width[p_state], HIGHLIGHT("state", p_state, comp_fn_index),
+ (int)width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index),
+ (int)width[p_min], HIGHLIGHT("min", p_min, comp_fn_index),
+ (int)width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index),
+ (int)width[p_max], HIGHLIGHT("max", p_max, comp_fn_index),
HIGHLIGHT("name", p_name, comp_fn_index));
if (active_window == 0)
wattroff(status, A_BOLD);
@@ -466,17 +466,17 @@ void monitor_render(void)
json_object *probe, *field;
probe = json_object_array_get_idx(jso_probe_list, i);
json_object_object_get_ex(probe, "index", &field);
- wprintw(status, "%*s\t", width[p_index], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_index], json_object_get_string(field));
json_object_object_get_ex(probe, "state", &field);
- wprintw(status, "%*s\t", width[p_state], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_state], json_object_get_string(field));
json_object_object_get_ex(probe, "hits", &field);
- wprintw(status, "%*s\t", width[p_hits], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_hits], json_object_get_string(field));
json_object_object_get_ex(probe, "min", &field);
- wprintw(status, "%*s\t", width[p_min], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_min], json_object_get_string(field));
json_object_object_get_ex(probe, "avg", &field);
- wprintw(status, "%*s\t", width[p_avg], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_avg], json_object_get_string(field));
json_object_object_get_ex(probe, "max", &field);
- wprintw(status, "%*s\t", width[p_max], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_max], json_object_get_string(field));
getyx(status, discard, cur_x);
json_object_object_get_ex(probe, "name", &field);
wprintw(status, "%.*s", max_cols-cur_x-1, json_object_get_string(field));
--
2.20.1

View File

@@ -0,0 +1,36 @@
From 52596f023652114642faba5726c99488529029ce Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Thu, 21 Dec 2023 10:00:06 +0000
Subject: [PATCH] staprun: fix build against upcoming `gcc-14`
(`-Werror=calloc-transposed-args`)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `systemtap`:
staprun.c: In function 'main':
staprun.c:550:50: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
550 | char ** new_argv = calloc(sizeof(char *),argc+2);
| ^~~~
Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=52596f023652114642faba5726c99488529029ce]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
staprun/staprun.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/staprun/staprun.c b/staprun/staprun.c
index 8437f3af6..d1b0b221b 100644
--- a/staprun/staprun.c
+++ b/staprun/staprun.c
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
us to extend argv[], with all the C fun that entails. */
#ifdef HAVE_OPENAT
if (relay_basedir_fd >= 0) {
- char ** new_argv = calloc(sizeof(char *),argc+2);
+ char ** new_argv = calloc(argc+2, sizeof(char *));
const int new_Foption_size = 10; /* -FNNNNN */
char * new_Foption = malloc(new_Foption_size);
int i;
--
2.43.0

View File

@@ -0,0 +1,37 @@
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(-)
Index: git/stapbpf/Makefile.am
===================================================================
--- git.orig/stapbpf/Makefile.am
+++ git/stapbpf/Makefile.am
@@ -41,10 +41,10 @@
# 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 ] && (getent group stapusr >/dev/null \
- || groupadd -f -g 156 -r stapusr); then \
- chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
- && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
- fi
+#install-exec-hook:
+## if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \
+## || groupadd -f -g 156 -r stapusr); then \
+## chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
+# && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
+# fi
endif

View File

@@ -0,0 +1,103 @@
SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
DESCRIPTION = "It provides free software infrastructure to simplify the \
gathering of information about the running Linux system. This assists \
diagnosis of a performance or functional problem."
HOMEPAGE = "https://sourceware.org/systemtap/"
require systemtap_git.inc
SRC_URI += " \
file://0001-improve-reproducibility-for-c-compiling.patch \
file://0001-staprun-address-ncurses-6.3-failures.patch \
"
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 ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
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"
PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod"
inherit autotools gettext pkgconfig systemd
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=]
CXXFLAGS += "-Wno-dangling-pointer"
# exporter comes with python3-probes
PACKAGES =+ "${PN}-exporter"
FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \
${sysconfdir}/sysconfig/stap-exporter \
${systemd_system_unitdir}/stap-exporter.service \
${sbindir}/stap-exporter"
RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient"
SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service"
PACKAGES =+ "${PN}-runtime"
FILES:${PN}-runtime = "\
${bindir}/staprun \
${bindir}/stap-merge \
${bindir}/stapsh \
${libexecdir}/${BPN}/stapio \
"
RDEPENDS:${PN}:class-target += "${PN}-runtime"
PACKAGES =+ "${PN}-examples"
FILES:${PN}-examples = "${datadir}/${BPN}/examples/"
RDEPENDS:${PN}-examples += "${PN}"
# don't complain that some examples involve bash, perl, php...
INSANE_SKIP:${PN}-examples += "file-rdeps"
PACKAGES =+ "${PN}-python"
FILES:${PN}-python += "\
${bindir}/dtrace \
${libdir}/python*/ \
${libexecdir}/${BPN}/python/ \
"
# python material requires sdt headers
RDEPENDS:${PN}-python += "${PN}-dev python3-core"
INSANE_SKIP:${PN}-python += "dev-deps"
do_configure:prepend () {
# Improve reproducibility for c++ object files
reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}"
sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h
}
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
if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
# Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
# without usrmerge distro feature enabled
install -d `dirname ${D}${systemd_unitdir}`
mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
fi
# Ensure correct ownership for files copied in
if [ -d ${D}${sysconfdir}/stap-exporter ]; then
chown root:root ${D}${sysconfdir}/stap-exporter/* -R
fi
}
BBCLASSEXTEND = "nativesdk"

Some files were not shown because too many files have changed in this diff Show More