diff options
Diffstat (limited to 'meta-oe/recipes-kernel')
41 files changed, 995 insertions, 459 deletions
diff --git a/meta-oe/recipes-kernel/agent-proxy/agent-proxy_1.97.bb b/meta-oe/recipes-kernel/agent-proxy/agent-proxy_1.97.bb index 0e17800c4b..3bbfe4cf9f 100644 --- a/meta-oe/recipes-kernel/agent-proxy/agent-proxy_1.97.bb +++ b/meta-oe/recipes-kernel/agent-proxy/agent-proxy_1.97.bb | |||
@@ -16,7 +16,6 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git;protoc | |||
16 | 16 | ||
17 | BBCLASSEXTEND = "native nativesdk" | 17 | BBCLASSEXTEND = "native nativesdk" |
18 | 18 | ||
19 | S = "${WORKDIR}/git" | ||
20 | 19 | ||
21 | do_install () { | 20 | do_install () { |
22 | install -d ${D}${bindir} | 21 | install -d ${D}${bindir} |
diff --git a/meta-oe/recipes-kernel/blktests/blktests.bb b/meta-oe/recipes-kernel/blktests/blktests.bb new file mode 100644 index 0000000000..ded03a4de2 --- /dev/null +++ b/meta-oe/recipes-kernel/blktests/blktests.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Linux kernel block layer testing framework" | ||
2 | DESCRIPTION = "blktests is a test framework for the Linux kernel block layer and storage stack. It is inspired by the xfstests filesystem testing framework." | ||
3 | DEPENDS = "gnutls keyutils glib-2.0 libnl" | ||
4 | RDEPENDS:${PN} += " bash coreutils gawk util-linux fio" | ||
5 | LICENSE = "GPL-3.0-or-later" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSES/GPL-3.0;md5=d32239bcb673463ab874e80d47fae504" | ||
7 | |||
8 | SRCREV = "9aa2023312bfcdd6b31c24b6e4a4a5c2d4f870d2" | ||
9 | SRC_URI = " \ | ||
10 | git://github.com/osandov/blktests.git;nobranch=1;protocol=https \ | ||
11 | " | ||
12 | |||
13 | |||
14 | inherit autotools-brokensep | ||
15 | |||
16 | do_configure[noexec] = "1" | ||
17 | |||
18 | FILES:${PN} = "/usr/blktests/*" | ||
diff --git a/meta-oe/recipes-kernel/bpftool/bpftool.bb b/meta-oe/recipes-kernel/bpftool/bpftool.bb index b22334fe90..d19746184c 100644 --- a/meta-oe/recipes-kernel/bpftool/bpftool.bb +++ b/meta-oe/recipes-kernel/bpftool/bpftool.bb | |||
@@ -14,7 +14,7 @@ EXTRA_OEMAKE = "\ | |||
14 | -C ${S}/tools/bpf/bpftool \ | 14 | -C ${S}/tools/bpf/bpftool \ |
15 | O=${B} \ | 15 | O=${B} \ |
16 | CROSS=${TARGET_PREFIX} \ | 16 | CROSS=${TARGET_PREFIX} \ |
17 | CC="${CC} ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" \ | 17 | CC="${CC} ${DEBUG_PREFIX_MAP} -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} ${CFLAGS}" \ |
18 | HOSTCC="${BUILD_CC} ${BUILD_CFLAGS}" \ | 18 | HOSTCC="${BUILD_CC} ${BUILD_CFLAGS}" \ |
19 | LD="${LD}" \ | 19 | LD="${LD}" \ |
20 | AR=${AR} \ | 20 | AR=${AR} \ |
@@ -26,7 +26,7 @@ SECURITY_CFLAGS = "" | |||
26 | 26 | ||
27 | do_configure[depends] += "virtual/kernel:do_shared_workdir" | 27 | do_configure[depends] += "virtual/kernel:do_shared_workdir" |
28 | 28 | ||
29 | COMPATIBLE_HOST = "(x86_64|aarch64).*-linux" | 29 | COMPATIBLE_HOST = "(x86_64|aarch64|riscv64).*-linux" |
30 | COMPATIBLE_HOST:libc-musl = 'null' | 30 | COMPATIBLE_HOST:libc-musl = 'null' |
31 | 31 | ||
32 | do_compile() { | 32 | do_compile() { |
diff --git a/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_12.0.1.1105_p3.bb b/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_12.0.1.1105_p3.bb index 4b6026ebc0..fe980e3e6f 100644 --- a/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_12.0.1.1105_p3.bb +++ b/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_12.0.1.1105_p3.bb | |||
@@ -14,7 +14,6 @@ SRCREV = "a0eb4805dbb232f02f156b9351a23790c1a4cec7" | |||
14 | 14 | ||
15 | PE = "1" | 15 | PE = "1" |
16 | 16 | ||
17 | S = "${WORKDIR}/git" | ||
18 | 17 | ||
19 | inherit allarch | 18 | inherit allarch |
20 | 19 | ||
diff --git a/meta-oe/recipes-kernel/cpupower/cpupower.bb b/meta-oe/recipes-kernel/cpupower/cpupower.bb index 18e3638052..453ebe8c7f 100644 --- a/meta-oe/recipes-kernel/cpupower/cpupower.bb +++ b/meta-oe/recipes-kernel/cpupower/cpupower.bb | |||
@@ -7,7 +7,7 @@ PROVIDES = "virtual/cpupower" | |||
7 | 7 | ||
8 | inherit kernelsrc kernel-arch bash-completion | 8 | inherit kernelsrc kernel-arch bash-completion |
9 | 9 | ||
10 | do_populate_lic[depends] += "virtual/kernel:do_patch" | 10 | do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" |
11 | 11 | ||
12 | EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" | 12 | EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" |
13 | 13 | ||
diff --git a/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb b/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.6.bb index 54883cef38..bafe56d2c4 100644 --- a/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb +++ b/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.6.bb | |||
@@ -15,9 +15,9 @@ DEPENDS = "\ | |||
15 | nativesdk-mpfr \ | 15 | nativesdk-mpfr \ |
16 | nativesdk-readline \ | 16 | nativesdk-readline \ |
17 | nativesdk-zlib \ | 17 | nativesdk-zlib \ |
18 | virtual/${HOST_PREFIX}gcc \ | 18 | virtual/nativesdk-cross-cc \ |
19 | virtual/${HOST_PREFIX}binutils \ | 19 | virtual/nativesdk-cross-binutils \ |
20 | virtual/nativesdk-${HOST_PREFIX}compilerlibs \ | 20 | virtual/nativesdk-compilerlibs \ |
21 | virtual/nativesdk-libc" | 21 | virtual/nativesdk-libc" |
22 | 22 | ||
23 | RDEPENDS:${PN} = "nativesdk-liblzma" | 23 | RDEPENDS:${PN} = "nativesdk-liblzma" |
diff --git a/meta-oe/recipes-kernel/crash/crash.inc b/meta-oe/recipes-kernel/crash/crash.inc index 04318b1505..3c9a99ae4a 100644 --- a/meta-oe/recipes-kernel/crash/crash.inc +++ b/meta-oe/recipes-kernel/crash/crash.inc | |||
@@ -14,16 +14,21 @@ DEPENDS = "zlib readline coreutils-native ncurses-native" | |||
14 | 14 | ||
15 | INC_PR = "r1" | 15 | INC_PR = "r1" |
16 | 16 | ||
17 | S = "${WORKDIR}/git" | ||
18 | SRC_URI = "git://github.com/crash-utility/${BPN}.git;branch=master;protocol=https \ | 17 | SRC_URI = "git://github.com/crash-utility/${BPN}.git;branch=master;protocol=https \ |
19 | ${GNU_MIRROR}/gdb/gdb-10.2.tar.gz;name=gdb;subdir=git \ | 18 | ${GNU_MIRROR}/gdb/gdb-10.2.tar.gz;name=gdb;subdir=${BB_GIT_DEFAULT_DESTSUFFIX} \ |
20 | file://7001force_define_architecture.patch \ | 19 | file://7001force_define_architecture.patch \ |
21 | file://7003cross_ranlib.patch \ | 20 | file://7003cross_ranlib.patch \ |
22 | file://0001-cross_add_configure_option.patch \ | 21 | file://0001-cross_add_configure_option.patch \ |
23 | file://donnot-extract-gdb-during-do-compile.patch \ | 22 | file://donnot-extract-gdb-during-do-compile.patch \ |
24 | file://gdb_build_jobs_and_not_write_crash_target.patch \ | 23 | file://gdb_build_jobs_and_not_write_crash_target.patch \ |
24 | file://0001-symbol-fix-S-cannot-work-with-kaslr-detection.patch \ | ||
25 | file://0002-arm64-add-pac-mask-to-better-support-gdb-stack-unwin.patch \ | ||
26 | file://0003-Fix-build-failure-in-readline-lib.patch \ | ||
27 | file://0004-tools.c-do-not-use-keywords-nullptr-as-a-variable-in.patch \ | ||
28 | file://0005-Fix-build-failure-on-32bit-machine-i686.patch \ | ||
29 | file://0001-Use-CC-env-var-to-get-compiler-version.patch \ | ||
25 | " | 30 | " |
26 | SRCREV = "a6832f608cb5d473739cf33bbf84ab1df8d98fd5" | 31 | SRCREV = "f13853cef53f5c5463a51021edbc81977e2b1405" |
27 | 32 | ||
28 | SRC_URI[gdb.sha256sum] = "b33ad58d687487a821ec8d878daab0f716be60d0936f2e3ac5cf08419ce70350" | 33 | SRC_URI[gdb.sha256sum] = "b33ad58d687487a821ec8d878daab0f716be60d0936f2e3ac5cf08419ce70350" |
29 | 34 | ||
diff --git a/meta-oe/recipes-kernel/crash/crash/0001-Use-CC-env-var-to-get-compiler-version.patch b/meta-oe/recipes-kernel/crash/crash/0001-Use-CC-env-var-to-get-compiler-version.patch new file mode 100644 index 0000000000..773598def1 --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0001-Use-CC-env-var-to-get-compiler-version.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 6ad5e9302057e157ab701880a8543ca59058df2d Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?K=C3=A9l=C3=A9fa=20San=C3=A9?= <kelefa.sane@smile.fr> | ||
3 | Date: Fri, 16 May 2025 16:18:28 +0200 | ||
4 | Subject: [PATCH v2] Use CC env var to get compiler version | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | The source file build_data.c generated at compilation time define a | ||
10 | variable compiler_version which is obtained by calling "gcc --version" | ||
11 | cmd. This call retrieve the native gcc compiler install on host build | ||
12 | machine but not necessarily the compiler use to build the project (ex: | ||
13 | cross compilation). | ||
14 | |||
15 | The CC env variable commonly used in Makefile project define the | ||
16 | compiler to use at build, so this is the appropriate way to retrieve the | ||
17 | compiler version, when the CC env var is define. | ||
18 | |||
19 | Upstream-Status: Submitted [https://lists.crash-utility.osci.io/archives/list/devel@lists.crash-utility.osci.io/thread/V3G3QH3YW6WZWD56TVTFQIHYLZ33UIJL/] | ||
20 | |||
21 | Signed-off-by: Kéléfa Sané <kelefa.sane@smile.fr> | ||
22 | --- | ||
23 | configure.c | 12 +++++++++++- | ||
24 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
25 | |||
26 | diff --git a/configure.c b/configure.c | ||
27 | index 4668c9a..4b65bd7 100644 | ||
28 | --- a/configure.c | ||
29 | +++ b/configure.c | ||
30 | @@ -1362,7 +1362,17 @@ make_build_data(char *target) | ||
31 | |||
32 | fp1 = popen("date", "r"); | ||
33 | fp2 = popen("id", "r"); | ||
34 | - fp3 = popen("gcc --version", "r"); | ||
35 | + | ||
36 | + const char *cc_env = getenv("CC"); | ||
37 | + if(NULL == cc_env) { | ||
38 | + fp3 = popen("gcc --version", "r"); | ||
39 | + } | ||
40 | + else { | ||
41 | + char compiler_version_cmd[512]; | ||
42 | + | ||
43 | + snprintf(compiler_version_cmd, sizeof(compiler_version_cmd), "%s --version", cc_env); | ||
44 | + fp3 = popen(compiler_version_cmd, "r"); | ||
45 | + } | ||
46 | |||
47 | if ((fp4 = fopen("build_data.c", "w")) == NULL) { | ||
48 | perror("build_data.c"); | ||
diff --git a/meta-oe/recipes-kernel/crash/crash/0001-symbol-fix-S-cannot-work-with-kaslr-detection.patch b/meta-oe/recipes-kernel/crash/crash/0001-symbol-fix-S-cannot-work-with-kaslr-detection.patch new file mode 100644 index 0000000000..47182f8b6c --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0001-symbol-fix-S-cannot-work-with-kaslr-detection.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | From 329bd56da28fc1b5b53a60ca2172643d2090435d Mon Sep 17 00:00:00 2001 | ||
2 | From: Tao Liu <ltao@redhat.com> | ||
3 | Date: Fri, 13 Dec 2024 08:36:03 +0000 | ||
4 | Subject: [PATCH] symbol: fix -S cannot work with kaslr detection | ||
5 | |||
6 | When kernel enabled the CONFIG_RANDOMIZE_BASE, crash needs to add "kaslr=auto" | ||
7 | in crash command line to tell crash to decode the random address. | ||
8 | But when with "-S" in command line, crash would bypass the kaslr option | ||
9 | that cause symbol from kernel image is mismatch with ram on a live system. | ||
10 | |||
11 | The fix is provided by Tao Liu <ltao@redhat.com> from crash-utility upstream, | ||
12 | and not merged to crash master yet. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | [https://lists.crash-utility.osci.io/archives/list/devel@lists.crash-utility.osci.io/thread/5OXNYPPU6GLLQKCWH7WBNBJXLNZ4EBZD/] | ||
16 | |||
17 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
18 | --- | ||
19 | symbols.c | 18 ++++++++++-------- | ||
20 | 1 file changed, 10 insertions(+), 8 deletions(-) | ||
21 | |||
22 | diff --git a/symbols.c b/symbols.c | ||
23 | index a3cd0f3..6062d21 100644 | ||
24 | --- a/symbols.c | ||
25 | +++ b/symbols.c | ||
26 | @@ -25,7 +25,7 @@ | ||
27 | |||
28 | static void store_symbols(bfd *, int, void *, long, unsigned int); | ||
29 | static void store_sysmap_symbols(void); | ||
30 | -static ulong relocate(ulong, char *, int); | ||
31 | +static ulong relocate(ulong, char *, int *); | ||
32 | static int relocate_force(ulong, char *); | ||
33 | static void kaslr_init(void); | ||
34 | static void strip_module_symbol_end(char *s); | ||
35 | @@ -230,6 +230,7 @@ symtab_init(void) | ||
36 | DEBUGINFO_ERROR_MESSAGE1 : | ||
37 | DEBUGINFO_ERROR_MESSAGE2); | ||
38 | } | ||
39 | + kt->flags |= RELOC_FORCE; | ||
40 | store_sysmap_symbols(); | ||
41 | return; | ||
42 | } else if (LKCD_KERNTYPES()) | ||
43 | @@ -817,7 +818,7 @@ store_symbols(bfd *abfd, int dynamic, void *minisyms, long symcount, | ||
44 | syminfo.type)) { | ||
45 | if (kt->flags & (RELOC_SET|RELOC_FORCE)) | ||
46 | sp->value = relocate(syminfo.value, | ||
47 | - (char *)syminfo.name, !(first++)); | ||
48 | + (char *)syminfo.name, &first); | ||
49 | else | ||
50 | sp->value = syminfo.value; | ||
51 | sp->type = syminfo.type; | ||
52 | @@ -893,9 +894,9 @@ store_sysmap_symbols(void) | ||
53 | |||
54 | if (machdep->verify_symbol(name, syment.value, | ||
55 | syment.type)) { | ||
56 | - if (kt->flags & RELOC_SET) | ||
57 | + if (kt->flags & (RELOC_SET|RELOC_FORCE)) | ||
58 | sp->value = relocate(syment.value, | ||
59 | - syment.name, !(first++)); | ||
60 | + syment.name, &first); | ||
61 | else | ||
62 | sp->value = syment.value; | ||
63 | sp->type = syment.type; | ||
64 | @@ -924,7 +925,7 @@ store_sysmap_symbols(void) | ||
65 | * are not as loaded into the kernel (not unity-mapped). | ||
66 | */ | ||
67 | static ulong | ||
68 | -relocate(ulong symval, char *symname, int first_symbol) | ||
69 | +relocate(ulong symval, char *symname, int *first_symbol) | ||
70 | { | ||
71 | if (XEN_HYPER_MODE()) { | ||
72 | kt->flags &= ~(RELOC_SET|RELOC_FORCE); | ||
73 | @@ -937,9 +938,10 @@ relocate(ulong symval, char *symname, int first_symbol) | ||
74 | break; | ||
75 | |||
76 | case RELOC_FORCE: | ||
77 | - if (first_symbol && !relocate_force(symval, symname)) | ||
78 | - kt->flags &= ~RELOC_FORCE; | ||
79 | - break; | ||
80 | + if (!(*first_symbol) && relocate_force(symval, symname)) { | ||
81 | + *first_symbol += 1; | ||
82 | + } | ||
83 | + return symval - kt->relocate; | ||
84 | } | ||
85 | |||
86 | if (machine_type("X86_64")) { | ||
87 | -- | ||
88 | 2.35.5 | ||
89 | |||
diff --git a/meta-oe/recipes-kernel/crash/crash/0002-arm64-add-pac-mask-to-better-support-gdb-stack-unwin.patch b/meta-oe/recipes-kernel/crash/crash/0002-arm64-add-pac-mask-to-better-support-gdb-stack-unwin.patch new file mode 100644 index 0000000000..42a585d366 --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0002-arm64-add-pac-mask-to-better-support-gdb-stack-unwin.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | From 0f39e33d3504f3a17b83574c3be97640460b7eef Mon Sep 17 00:00:00 2001 | ||
2 | From: "Guanyou.Chen" <chenguanyou@xiaomi.com> | ||
3 | Date: Wed, 25 Dec 2024 23:50:28 +0800 | ||
4 | Subject: [PATCH] arm64: add pac mask to better support gdb stack unwind | ||
5 | |||
6 | Currently, gdb passthroughs of 'bt', 'frame', 'up', 'down', | ||
7 | 'info, locals' don't work on arm64 machine enabled pauth. | ||
8 | This is because gdb does not know the lr register actual values | ||
9 | to unwind the stack frames. | ||
10 | |||
11 | Without the patch: | ||
12 | crash> gdb bt | ||
13 | #0 __switch_to (prev=0xffffff8001af92c0, next=0xffffff889da7a580) at /proc/self/cwd/common/arch/arm64/kernel/process.c:569 | ||
14 | #1 0x9fc5c5d3602132c0 in ?? () | ||
15 | Backtrace stopped: previous frame identical to this frame (corrupt stack?) | ||
16 | |||
17 | With the patch: | ||
18 | crash> gdb bt | ||
19 | #0 __switch_to (prev=prev@entry=0xffffff8001af92c0, next=next@entry=0xffffff889da7a580) at /proc/self/cwd/common/arch/arm64/kernel/process.c:569 | ||
20 | #1 0xffffffd3602132c0 in context_switch (rq=0xffffff8a7295a080, prev=0xffffff8001af92c0, next=0xffffff889da7a580, rf=<optimized out>) at /proc/self/cwd/common/kernel/sched/core.c:5515 | ||
21 | #2 __schedule (sched_mode=<optimized out>, sched_mode@entry=2147859424) at /proc/self/cwd/common/kernel/sched/core.c:6843 | ||
22 | #3 0xffffffd3602136d8 in schedule () at /proc/self/cwd/common/kernel/sched/core.c:6917 | ||
23 | ... | ||
24 | |||
25 | Signed-off-by: Guanyou.Chen <chenguanyou@xiaomi.com> | ||
26 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
27 | |||
28 | Upstream-Status: Backport [0f39e33 arm64: add pac mask to better support gdb stack unwind] | ||
29 | --- | ||
30 | gdb-10.2.patch | 23 +++++++++++++++++++++++ | ||
31 | gdb_interface.c | 10 ++++++++++ | ||
32 | 2 files changed, 33 insertions(+) | ||
33 | |||
34 | diff --git a/gdb-10.2.patch b/gdb-10.2.patch | ||
35 | index c867660..fd6fadb 100644 | ||
36 | --- a/gdb-10.2.patch | ||
37 | +++ b/gdb-10.2.patch | ||
38 | @@ -16216,3 +16216,26 @@ exit 0 | ||
39 | printf_filtered (_("Backtrace stopped: %s\n"), | ||
40 | frame_stop_reason_string (trailing)); | ||
41 | } | ||
42 | +--- gdb-10.2/gdb/frame.c.orig | ||
43 | ++++ gdb-10.2/gdb/frame.c | ||
44 | +@@ -944,6 +944,10 @@ frame_find_by_id (struct frame_id id) | ||
45 | + return NULL; | ||
46 | + } | ||
47 | + | ||
48 | ++#ifdef CRASH_MERGE | ||
49 | ++extern "C" void crash_decode_ptrauth_pc(ulong* pc); | ||
50 | ++#endif | ||
51 | ++ | ||
52 | + static CORE_ADDR | ||
53 | + frame_unwind_pc (struct frame_info *this_frame) | ||
54 | + { | ||
55 | +@@ -974,6 +978,9 @@ frame_unwind_pc (struct frame_info *this_frame) | ||
56 | + try | ||
57 | + { | ||
58 | + pc = gdbarch_unwind_pc (prev_gdbarch, this_frame); | ||
59 | ++#ifdef CRASH_MERGE | ||
60 | ++ crash_decode_ptrauth_pc(&pc); | ||
61 | ++#endif | ||
62 | + pc_p = true; | ||
63 | + } | ||
64 | + catch (const gdb_exception_error &ex) | ||
65 | diff --git a/gdb_interface.c b/gdb_interface.c | ||
66 | index 315711e..e108d09 100644 | ||
67 | --- a/gdb_interface.c | ||
68 | +++ b/gdb_interface.c | ||
69 | @@ -1083,3 +1083,13 @@ int crash_get_current_task_reg (int regno, const char *regname, | ||
70 | return machdep->get_current_task_reg(regno, regname, regsize, value); | ||
71 | } | ||
72 | |||
73 | +/* arm64 kernel lr maybe has patuh */ | ||
74 | +void crash_decode_ptrauth_pc(ulong *pc); | ||
75 | +void crash_decode_ptrauth_pc(ulong *pc) | ||
76 | +{ | ||
77 | +#ifdef ARM64 | ||
78 | + struct machine_specific *ms = machdep->machspec; | ||
79 | + if (is_kernel_text(*pc | ms->CONFIG_ARM64_KERNELPACMASK)) | ||
80 | + *pc |= ms->CONFIG_ARM64_KERNELPACMASK; | ||
81 | +#endif /* !ARM64 */ | ||
82 | +} | ||
83 | -- | ||
84 | 2.34.1 | ||
85 | |||
diff --git a/meta-oe/recipes-kernel/crash/crash/0003-Fix-build-failure-in-readline-lib.patch b/meta-oe/recipes-kernel/crash/crash/0003-Fix-build-failure-in-readline-lib.patch new file mode 100644 index 0000000000..f3318b3a6a --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0003-Fix-build-failure-in-readline-lib.patch | |||
@@ -0,0 +1,136 @@ | |||
1 | From 772fbb1022911410b5fb773fde37910fc8286041 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lianbo Jiang <lijiang@redhat.com> | ||
3 | Date: Fri, 24 Jan 2025 16:12:40 +0800 | ||
4 | Subject: [PATCH] Fix build failure in readline lib | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | This is a backported patch from gdb upstream, see the commit | ||
10 | 425f843d58c5 ("Import GNU Readline 8.2"), and only backported | ||
11 | patch related to compilation errors. | ||
12 | |||
13 | Without the patch: | ||
14 | |||
15 | signals.c: In function ‘_rl_handle_signal’: | ||
16 | signals.c:62:36: error: ‘return’ with a value, in function returning void [-Wreturn-mismatch] | ||
17 | 62 | # define SIGHANDLER_RETURN return (0) | ||
18 | | ^ | ||
19 | signals.c:290:3: note: in expansion of macro ‘SIGHANDLER_RETURN’ | ||
20 | 290 | SIGHANDLER_RETURN; | ||
21 | | ^~~~~~~~~~~~~~~~~ | ||
22 | signals.c:178:1: note: declared here | ||
23 | 178 | _rl_handle_signal (int sig) | ||
24 | | ^~~~~~~~~~~~~~~~~ | ||
25 | signals.c: In function ‘rl_sigwinch_handler’: | ||
26 | signals.c:306:32: error: passing argument 2 of ‘rl_set_sighandler’ from incompatible pointer type [-Wincompatible-pointer-types] | ||
27 | 306 | rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch); | ||
28 | | ^~~~~~~~~~~~~~~~~~~ | ||
29 | | | | ||
30 | | void (*)(int) | ||
31 | In file included from rldefs.h:31, | ||
32 | from signals.c:37: | ||
33 | signals.c:81:51: note: expected ‘void (*)(void)’ but argument is of type ‘void (*)(int)’ | ||
34 | 81 | static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); | ||
35 | |||
36 | Note: the current build failure was observed on gcc (GCC) 15.0.0. | ||
37 | |||
38 | Signed-off-by: Lianbo Jiang <lijiang@redhat.com> | ||
39 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
40 | |||
41 | Upstream-Status: Backport [772fbb1 Fix build failure in readline lib] | ||
42 | --- | ||
43 | gdb-10.2.patch | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
44 | 1 file changed, 82 insertions(+) | ||
45 | |||
46 | diff --git a/gdb-10.2.patch b/gdb-10.2.patch | ||
47 | index fd6fadb..8f5d7db 100644 | ||
48 | --- a/gdb-10.2.patch | ||
49 | +++ b/gdb-10.2.patch | ||
50 | @@ -16239,3 +16239,85 @@ exit 0 | ||
51 | pc_p = true; | ||
52 | } | ||
53 | catch (const gdb_exception_error &ex) | ||
54 | +--- gdb-10.2/readline/readline/signals.c.orig | ||
55 | ++++ gdb-10.2/readline/readline/signals.c | ||
56 | +@@ -48,23 +48,11 @@ | ||
57 | + | ||
58 | + #if defined (HANDLE_SIGNALS) | ||
59 | + | ||
60 | +-#if !defined (RETSIGTYPE) | ||
61 | +-# if defined (VOID_SIGHANDLER) | ||
62 | +-# define RETSIGTYPE void | ||
63 | +-# else | ||
64 | +-# define RETSIGTYPE int | ||
65 | +-# endif /* !VOID_SIGHANDLER */ | ||
66 | +-#endif /* !RETSIGTYPE */ | ||
67 | +- | ||
68 | +-#if defined (VOID_SIGHANDLER) | ||
69 | +-# define SIGHANDLER_RETURN return | ||
70 | +-#else | ||
71 | +-# define SIGHANDLER_RETURN return (0) | ||
72 | +-#endif | ||
73 | ++#define SIGHANDLER_RETURN return | ||
74 | + | ||
75 | + /* This typedef is equivalent to the one for Function; it allows us | ||
76 | + to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */ | ||
77 | +-typedef RETSIGTYPE SigHandler (); | ||
78 | ++typedef void SigHandler (int); | ||
79 | + | ||
80 | + #if defined (HAVE_POSIX_SIGNALS) | ||
81 | + typedef struct sigaction sighandler_cxt; | ||
82 | +@@ -78,12 +66,12 @@ typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt | ||
83 | + # define SA_RESTART 0 | ||
84 | + #endif | ||
85 | + | ||
86 | +-static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); | ||
87 | +-static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); | ||
88 | +-static void rl_maybe_restore_sighandler PARAMS((int, sighandler_cxt *)); | ||
89 | ++static SigHandler *rl_set_sighandler (int, SigHandler *, sighandler_cxt *); | ||
90 | ++static void rl_maybe_set_sighandler (int, SigHandler *, sighandler_cxt *); | ||
91 | ++static void rl_maybe_restore_sighandler (int, sighandler_cxt *); | ||
92 | + | ||
93 | +-static RETSIGTYPE rl_signal_handler PARAMS((int)); | ||
94 | +-static RETSIGTYPE _rl_handle_signal PARAMS((int)); | ||
95 | ++static void rl_signal_handler (int); | ||
96 | ++static void _rl_handle_signal (int); | ||
97 | + | ||
98 | + /* Exported variables for use by applications. */ | ||
99 | + | ||
100 | +@@ -137,7 +125,7 @@ void *_rl_sigcleanarg; | ||
101 | + /* Readline signal handler functions. */ | ||
102 | + | ||
103 | + /* Called from RL_CHECK_SIGNALS() macro */ | ||
104 | +-RETSIGTYPE | ||
105 | ++void | ||
106 | + _rl_signal_handler (int sig) | ||
107 | + { | ||
108 | + _rl_caught_signal = 0; /* XXX */ | ||
109 | +@@ -160,7 +148,7 @@ _rl_signal_handler (int sig) | ||
110 | + SIGHANDLER_RETURN; | ||
111 | + } | ||
112 | + | ||
113 | +-static RETSIGTYPE | ||
114 | ++static void | ||
115 | + rl_signal_handler (int sig) | ||
116 | + { | ||
117 | + if (_rl_interrupt_immediately) | ||
118 | +@@ -174,7 +162,7 @@ rl_signal_handler (int sig) | ||
119 | + SIGHANDLER_RETURN; | ||
120 | + } | ||
121 | + | ||
122 | +-static RETSIGTYPE | ||
123 | ++static void | ||
124 | + _rl_handle_signal (int sig) | ||
125 | + { | ||
126 | + #if defined (HAVE_POSIX_SIGNALS) | ||
127 | +@@ -291,7 +279,7 @@ _rl_handle_signal (int sig) | ||
128 | + } | ||
129 | + | ||
130 | + #if defined (SIGWINCH) | ||
131 | +-static RETSIGTYPE | ||
132 | ++static void | ||
133 | + rl_sigwinch_handler (int sig) | ||
134 | + { | ||
135 | + SigHandler *oh; | ||
136 | |||
diff --git a/meta-oe/recipes-kernel/crash/crash/0004-tools.c-do-not-use-keywords-nullptr-as-a-variable-in.patch b/meta-oe/recipes-kernel/crash/crash/0004-tools.c-do-not-use-keywords-nullptr-as-a-variable-in.patch new file mode 100644 index 0000000000..e4bd4cd3a9 --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0004-tools.c-do-not-use-keywords-nullptr-as-a-variable-in.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 325a9d1b3b4ce76bf4556235c885e619e219622c Mon Sep 17 00:00:00 2001 | ||
2 | From: Lianbo Jiang <lijiang@redhat.com> | ||
3 | Date: Fri, 24 Jan 2025 15:32:59 +0800 | ||
4 | Subject: [PATCH] tools.c: do not use keywords 'nullptr' as a variable in code | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Without the patch: | ||
10 | |||
11 | tools.c: In function ‘drop_core’: | ||
12 | tools.c:6251:23: error: expected identifier or ‘(’ before ‘nullptr’ | ||
13 | 6251 | volatile int *nullptr; | ||
14 | | ^~~~~~~ | ||
15 | tools.c:6259:17: error: lvalue required as left operand of assignment | ||
16 | 6259 | nullptr = NULL; | ||
17 | | ^ | ||
18 | tools.c:6261:21: error: invalid type argument of unary ‘*’ (have ‘typeof (nullptr)’) | ||
19 | 6261 | i = *nullptr; | ||
20 | | ^~~~~~~~ | ||
21 | make[6]: *** [Makefile:345: tools.o] Error 1 | ||
22 | |||
23 | Note: this was observed on gcc version 15.0.1 | ||
24 | |||
25 | Signed-off-by: Lianbo Jiang <lijiang@redhat.com> | ||
26 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
27 | |||
28 | Upstream-Status: Backport [325a9d1 tools.c: do not use keywords 'nullptr' as a variable in code] | ||
29 | --- | ||
30 | tools.c | 6 +++--- | ||
31 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
32 | |||
33 | diff --git a/tools.c b/tools.c | ||
34 | index 85d8b6f..c9305be 100644 | ||
35 | --- a/tools.c | ||
36 | +++ b/tools.c | ||
37 | @@ -6248,7 +6248,7 @@ lowest_bit_long(ulong val) | ||
38 | void | ||
39 | drop_core(char *s) | ||
40 | { | ||
41 | - volatile int *nullptr; | ||
42 | + volatile int *ptr; | ||
43 | int i ATTRIBUTE_UNUSED; | ||
44 | |||
45 | if (s && ascii_string(s)) | ||
46 | @@ -6256,9 +6256,9 @@ drop_core(char *s) | ||
47 | |||
48 | kill((pid_t)pc->program_pid, 3); | ||
49 | |||
50 | - nullptr = NULL; | ||
51 | + ptr = NULL; | ||
52 | while (TRUE) | ||
53 | - i = *nullptr; | ||
54 | + i = *ptr; | ||
55 | } | ||
56 | |||
57 | |||
58 | -- | ||
59 | 2.34.1 | ||
60 | |||
diff --git a/meta-oe/recipes-kernel/crash/crash/0005-Fix-build-failure-on-32bit-machine-i686.patch b/meta-oe/recipes-kernel/crash/crash/0005-Fix-build-failure-on-32bit-machine-i686.patch new file mode 100644 index 0000000000..e4796b9ced --- /dev/null +++ b/meta-oe/recipes-kernel/crash/crash/0005-Fix-build-failure-on-32bit-machine-i686.patch | |||
@@ -0,0 +1,83 @@ | |||
1 | From 2724bb1d0260f3886f8a3d533838caf80c7e61e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lianbo Jiang <lijiang@redhat.com> | ||
3 | Date: Fri, 24 Jan 2025 17:56:23 +0800 | ||
4 | Subject: [PATCH 10/10] Fix build failure on 32bit machine(i686) | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | This issue was caused by commit 0f39e33d3504 with the following | ||
10 | compilation error: | ||
11 | |||
12 | frame.c: In function ‘CORE_ADDR frame_unwind_pc(frame_info*)’: | ||
13 | frame.c:982:35: error: cannot convert ‘CORE_ADDR*’ {aka ‘long long unsigned int*’} to ‘ulong*’ {aka ‘long unsigned int*’} | ||
14 | 982 | crash_decode_ptrauth_pc(&pc); | ||
15 | | ^~~ | ||
16 | | | | ||
17 | | CORE_ADDR* {aka long long unsigned int*} | ||
18 | frame.c:948:48: note: initializing argument 1 of ‘void crash_decode_ptrauth_pc(ulong*)’ | ||
19 | 948 | extern "C" void crash_decode_ptrauth_pc(ulong* pc); | ||
20 | | ~~~~~~~^~ | ||
21 | |||
22 | Upstream-Status: Backport [https://github.com/crash-utility/crash/commit/2724bb1d0260f3886f8a3d533838caf80c7e61e5] | ||
23 | Fixes: 0f39e33d3504 ("arm64: add pac mask to better support gdb stack unwind") | ||
24 | Reported-by: Guanyou.Chen <chenguanyou@xiaomi.com> | ||
25 | Signed-off-by: Lianbo Jiang <lijiang@redhat.com> | ||
26 | --- | ||
27 | gdb-10.2.patch | 6 +++--- | ||
28 | gdb_interface.c | 4 ++-- | ||
29 | 2 files changed, 5 insertions(+), 5 deletions(-) | ||
30 | |||
31 | diff --git a/gdb-10.2.patch b/gdb-10.2.patch | ||
32 | index 8f5d7db22840..d22f2d6d75bc 100644 | ||
33 | --- a/gdb-10.2.patch | ||
34 | +++ b/gdb-10.2.patch | ||
35 | @@ -55,7 +55,7 @@ exit 0 | ||
36 | # your system doesn't have fcntl.h in /usr/include (which is where it | ||
37 | # should be according to Posix). | ||
38 | -DEFS = @DEFS@ | ||
39 | -+DEFS = -DCRASH_MERGE @DEFS@ | ||
40 | ++DEFS = -DCRASH_MERGE -D${CRASH_TARGET} @DEFS@ | ||
41 | GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \ | ||
42 | -DLOCALEDIR="\"$(localedir)\"" $(DEFS) | ||
43 | |||
44 | @@ -16222,7 +16222,7 @@ exit 0 | ||
45 | return NULL; | ||
46 | } | ||
47 | |||
48 | -+#ifdef CRASH_MERGE | ||
49 | ++#if defined(CRASH_MERGE) && defined(ARM64) | ||
50 | +extern "C" void crash_decode_ptrauth_pc(ulong* pc); | ||
51 | +#endif | ||
52 | + | ||
53 | @@ -16233,7 +16233,7 @@ exit 0 | ||
54 | try | ||
55 | { | ||
56 | pc = gdbarch_unwind_pc (prev_gdbarch, this_frame); | ||
57 | -+#ifdef CRASH_MERGE | ||
58 | ++#if defined(CRASH_MERGE) && defined(ARM64) | ||
59 | + crash_decode_ptrauth_pc(&pc); | ||
60 | +#endif | ||
61 | pc_p = true; | ||
62 | diff --git a/gdb_interface.c b/gdb_interface.c | ||
63 | index e108d097ee5f..c2e99f5c156a 100644 | ||
64 | --- a/gdb_interface.c | ||
65 | +++ b/gdb_interface.c | ||
66 | @@ -1084,12 +1084,12 @@ int crash_get_current_task_reg (int regno, const char *regname, | ||
67 | } | ||
68 | |||
69 | /* arm64 kernel lr maybe has patuh */ | ||
70 | +#ifdef ARM64 | ||
71 | void crash_decode_ptrauth_pc(ulong *pc); | ||
72 | void crash_decode_ptrauth_pc(ulong *pc) | ||
73 | { | ||
74 | -#ifdef ARM64 | ||
75 | struct machine_specific *ms = machdep->machspec; | ||
76 | if (is_kernel_text(*pc | ms->CONFIG_ARM64_KERNELPACMASK)) | ||
77 | *pc |= ms->CONFIG_ARM64_KERNELPACMASK; | ||
78 | -#endif /* !ARM64 */ | ||
79 | } | ||
80 | +#endif /* !ARM64 */ | ||
81 | -- | ||
82 | 2.47.1 | ||
83 | |||
diff --git a/meta-oe/recipes-kernel/crash/crash_8.0.4.bb b/meta-oe/recipes-kernel/crash/crash_8.0.6.bb index 1af90978e0..1af90978e0 100644 --- a/meta-oe/recipes-kernel/crash/crash_8.0.4.bb +++ b/meta-oe/recipes-kernel/crash/crash_8.0.6.bb | |||
diff --git a/meta-oe/recipes-kernel/drgn/python3-drgn_0.0.32.bb b/meta-oe/recipes-kernel/drgn/python3-drgn_0.0.32.bb new file mode 100644 index 0000000000..31674ffec0 --- /dev/null +++ b/meta-oe/recipes-kernel/drgn/python3-drgn_0.0.32.bb | |||
@@ -0,0 +1,79 @@ | |||
1 | SUMMARY = "drgn (pronounced dragon) is a debugger with an emphasis on \ | ||
2 | programmability. drgn exposes the types and variables in a program for easy, \ | ||
3 | expressive scripting in Python." | ||
4 | HOMEPAGE = "https://github.com/osandov/drgn" | ||
5 | LICENSE = " LGPL-2.1-or-later" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=7c83d30e99508d6b790eacdd3abab846" | ||
7 | |||
8 | SRC_URI = "git://github.com/osandov/drgn.git;protocol=https;branch=main;tag=v${PV}" | ||
9 | SRCREV = "348d6efc5c18e0ae4ef2f3aea50a8edf17cb1fe9" | ||
10 | |||
11 | |||
12 | DEPENDS = "\ | ||
13 | autoconf-native \ | ||
14 | automake-native \ | ||
15 | libtool-native \ | ||
16 | elfutils \ | ||
17 | " | ||
18 | |||
19 | DEPENDS:append:toolchain-clang:class-target = "\ | ||
20 | openmp \ | ||
21 | " | ||
22 | |||
23 | OPENMP_LIB = "libgomp" | ||
24 | OPENMP_LIB:toolchain-clang:class-target = "openmp" | ||
25 | |||
26 | RDEPENDS:${PN} = "\ | ||
27 | python3-crypt \ | ||
28 | python3-io \ | ||
29 | python3-logging \ | ||
30 | python3-math \ | ||
31 | python3-pickle \ | ||
32 | python3-stringold \ | ||
33 | python3-compression \ | ||
34 | " | ||
35 | |||
36 | RDEPENDS:${PN}:append:class-target = "\ | ||
37 | libdw \ | ||
38 | libelf \ | ||
39 | ${OPENMP_LIB} \ | ||
40 | " | ||
41 | |||
42 | RDEPENDS:${PN}:append:class-native = "\ | ||
43 | elfutils-native \ | ||
44 | " | ||
45 | |||
46 | RDEPENDS:${PN}:append:class-nativesdk = "\ | ||
47 | nativesdk-elfutils \ | ||
48 | " | ||
49 | |||
50 | OPENMP_LIB_NAME = "gomp" | ||
51 | OPENMP_LIB_NAME:toolchain-clang:class-target = "omp" | ||
52 | |||
53 | export CONFIGURE_FLAGS = "\ | ||
54 | --build=${BUILD_SYS}, \ | ||
55 | --host=${HOST_SYS}, \ | ||
56 | --target=${TARGET_SYS}, \ | ||
57 | --prefix=${prefix}, \ | ||
58 | --exec_prefix=${exec_prefix}, \ | ||
59 | --bindir=${bindir}, \ | ||
60 | --sbindir=${sbindir}, \ | ||
61 | --libexecdir=${libexecdir}, \ | ||
62 | --datadir=${datadir}, \ | ||
63 | --sysconfdir=${sysconfdir}, \ | ||
64 | --sharedstatedir=${sharedstatedir}, \ | ||
65 | --localstatedir=${localstatedir}, \ | ||
66 | --libdir=${libdir}, \ | ||
67 | --includedir=${includedir}, \ | ||
68 | --oldincludedir=${includedir}, \ | ||
69 | --infodir=${infodir}, \ | ||
70 | --mandir=${mandir}, \ | ||
71 | --enable-openmp=${OPENMP_LIB_NAME} \ | ||
72 | " | ||
73 | |||
74 | export PYTHON_CPPFLAGS = "-I${STAGING_INCDIR}/${PYTHON_DIR}" | ||
75 | |||
76 | inherit python3native pkgconfig setuptools3 | ||
77 | |||
78 | BBCLASSEXTEND = "native nativesdk" | ||
79 | |||
diff --git a/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb b/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb index 23ea0d8aae..3b5866180d 100644 --- a/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb +++ b/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb | |||
@@ -13,7 +13,7 @@ COMPATIBLE_HOST:libc-musl = 'null' | |||
13 | 13 | ||
14 | DEPENDS = "libnl" | 14 | DEPENDS = "libnl" |
15 | 15 | ||
16 | do_populate_lic[depends] += "virtual/kernel:do_patch" | 16 | do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" |
17 | 17 | ||
18 | B = "${WORKDIR}/${BPN}-${PV}" | 18 | B = "${WORKDIR}/${BPN}-${PV}" |
19 | 19 | ||
diff --git a/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.19.bb b/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.19.bb index 7a15d16bc3..b5b8075fd7 100644 --- a/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.19.bb +++ b/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.19.bb | |||
@@ -21,18 +21,20 @@ LICENSE = "BSD-3-Clause" | |||
21 | LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184" | 21 | LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184" |
22 | 22 | ||
23 | DEPENDS = "openssl readline ncurses" | 23 | DEPENDS = "openssl readline ncurses" |
24 | SRCREV = "ab5ce5baff097ebb6e2a17a171858be213ee68d3" | 24 | SRCREV = "bf774149ae7f74c12164a5b021b23520c5ca4016" |
25 | SRC_URI = "git://codeberg.org/ipmitool/ipmitool;protocol=https;branch=master \ | 25 | SRC_URI = "git://codeberg.org/ipmitool/ipmitool;protocol=https;branch=master \ |
26 | ${IANA_ENTERPRISE_NUMBERS} \ | 26 | ${IANA_ENTERPRISE_NUMBERS} \ |
27 | file://0001-csv-revision-Drop-the-git-revision-info.patch \ | 27 | file://0001-csv-revision-Drop-the-git-revision-info.patch \ |
28 | " | 28 | " |
29 | |||
30 | UPSTREAM_CHECK_GITTAGREGEX = "IPMITOOL_(?P<pver>\d+(_\d+)+)" | ||
31 | |||
29 | IANA_ENTERPRISE_NUMBERS ?= "" | 32 | IANA_ENTERPRISE_NUMBERS ?= "" |
30 | 33 | ||
31 | # Add these via bbappend if this database is needed by the system | 34 | # Add these via bbappend if this database is needed by the system |
32 | #IANA_ENTERPRISE_NUMBERS = "http://www.iana.org/assignments/enterprise-numbers.txt;name=iana-enterprise-numbers;downloadfilename=iana-enterprise-numbers" | 35 | #IANA_ENTERPRISE_NUMBERS = "http://www.iana.org/assignments/enterprise-numbers.txt;name=iana-enterprise-numbers;downloadfilename=iana-enterprise-numbers" |
33 | #SRC_URI[iana-enterprise-numbers.sha256sum] = "cdd97fc08325667434b805eb589104ae63f7a9eb720ecea73cb55110b383934c" | 36 | #SRC_URI[iana-enterprise-numbers.sha256sum] = "cdd97fc08325667434b805eb589104ae63f7a9eb720ecea73cb55110b383934c" |
34 | 37 | ||
35 | S = "${WORKDIR}/git" | ||
36 | 38 | ||
37 | inherit autotools pkgconfig | 39 | inherit autotools pkgconfig |
38 | 40 | ||
@@ -57,3 +59,6 @@ EXTRA_OECONF = "--disable-dependency-tracking --enable-file-security --disable-i | |||
57 | --disable-registry-download \ | 59 | --disable-registry-download \ |
58 | " | 60 | " |
59 | 61 | ||
62 | # http://errors.yoctoproject.org/Errors/Details/766896/ | ||
63 | # git/lib/ipmi_fru.c:1556:41: error: initialization of 'struct fru_multirec_mgmt *' from incompatible pointer type 'struct fru_multirect_mgmt *' [-Wincompatible-pointer-types] | ||
64 | CFLAGS += "-Wno-error=incompatible-pointer-types" | ||
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 3f57ef3bfd..14aa5d0c0c 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | |||
@@ -2,16 +2,19 @@ SUMMARY = "Kernel selftest for Linux" | |||
2 | DESCRIPTION = "Kernel selftest for Linux" | 2 | DESCRIPTION = "Kernel selftest for Linux" |
3 | LICENSE = "GPL-2.0-only" | 3 | LICENSE = "GPL-2.0-only" |
4 | 4 | ||
5 | LIC_FILES_CHKSUM = "file://${UNPACKDIR}/COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" |
6 | 6 | ||
7 | DEPENDS = "rsync-native llvm-native" | 7 | DEPENDS = "rsync-native llvm-native" |
8 | 8 | ||
9 | S = "${UNPACKDIR}" | ||
10 | |||
9 | # for musl libc | 11 | # for musl libc |
10 | SRC_URI:append:libc-musl = "\ | 12 | SRC_URI:append:libc-musl = "\ |
11 | file://userfaultfd.patch \ | 13 | file://userfaultfd.patch \ |
12 | " | 14 | " |
13 | SRC_URI += "file://run-ptest \ | 15 | SRC_URI += "file://run-ptest \ |
14 | file://COPYING \ | 16 | file://COPYING \ |
17 | file://0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch \ | ||
15 | " | 18 | " |
16 | 19 | ||
17 | # now we just test bpf and vm | 20 | # now we just test bpf and vm |
@@ -42,8 +45,6 @@ do_compile[depends] += "virtual/kernel:do_install" | |||
42 | 45 | ||
43 | inherit linux-kernel-base module-base kernel-arch ptest siteinfo | 46 | inherit linux-kernel-base module-base kernel-arch ptest siteinfo |
44 | 47 | ||
45 | S = "${WORKDIR}/${BP}" | ||
46 | |||
47 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" | 48 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" |
48 | 49 | ||
49 | TEST_LIST = "\ | 50 | TEST_LIST = "\ |
@@ -55,7 +56,7 @@ TEST_LIST = "\ | |||
55 | EXTRA_OEMAKE = '\ | 56 | EXTRA_OEMAKE = '\ |
56 | CROSS_COMPILE=${TARGET_PREFIX} \ | 57 | CROSS_COMPILE=${TARGET_PREFIX} \ |
57 | ARCH=${ARCH} \ | 58 | ARCH=${ARCH} \ |
58 | CC="${CC}" \ | 59 | CC="${CC} ${DEBUG_PREFIX_MAP}" \ |
59 | AR="${AR}" \ | 60 | AR="${AR}" \ |
60 | LD="${LD}" \ | 61 | LD="${LD}" \ |
61 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ | 62 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ |
@@ -96,33 +97,17 @@ either install it and add it to HOSTTOOLS, or add clang-native from meta-clang t | |||
96 | sed -i -e '/mrecord-mcount/d' ${S}/Makefile | 97 | sed -i -e '/mrecord-mcount/d' ${S}/Makefile |
97 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile | 98 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile |
98 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.* | 99 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.* |
99 | for i in ${TEST_LIST} | 100 | oe_runmake -C ${S}/tools/testing/selftests TARGETS="${TEST_LIST}" |
100 | do | ||
101 | oe_runmake -C ${S}/tools/testing/selftests/${i} | ||
102 | done | ||
103 | } | 101 | } |
104 | 102 | ||
105 | do_install() { | 103 | do_install() { |
106 | for i in ${TEST_LIST} | 104 | oe_runmake -C ${S}/tools/testing/selftests INSTALL_PATH=${D}/usr/kernel-selftest TARGETS="${TEST_LIST}" install |
107 | do | ||
108 | oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install | ||
109 | # Install kselftest-list.txt that required by kselftest runner. | ||
110 | oe_runmake -s --no-print-directory COLLECTION=${i} -C ${S}/tools/testing/selftests/${i} emit_tests \ | ||
111 | >> ${D}/usr/kernel-selftest/kselftest-list.txt | ||
112 | done | ||
113 | # Install kselftest runner. | ||
114 | install -m 0755 ${S}/tools/testing/selftests/run_kselftest.sh ${D}/usr/kernel-selftest/ | ||
115 | cp -R --no-dereference --preserve=mode,links -v ${S}/tools/testing/selftests/kselftest ${D}/usr/kernel-selftest/ | ||
116 | if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then | 105 | if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then |
117 | sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py | 106 | sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py |
118 | fi | 107 | fi |
119 | chown root:root -R ${D}/usr/kernel-selftest | 108 | chown root:root -R ${D}/usr/kernel-selftest |
120 | } | 109 | } |
121 | 110 | ||
122 | do_configure() { | ||
123 | install -D -m 0644 ${UNPACKDIR}/COPYING ${S}/COPYING | ||
124 | } | ||
125 | |||
126 | do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" | 111 | do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" |
127 | python copy_kselftest_source_from_kernel() { | 112 | python copy_kselftest_source_from_kernel() { |
128 | sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split() | 113 | sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split() |
@@ -149,15 +134,23 @@ remove_unrelated() { | |||
149 | fi | 134 | fi |
150 | } | 135 | } |
151 | 136 | ||
137 | do_configure[dirs] = "${S}" | ||
138 | |||
152 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 139 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
153 | 140 | ||
154 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" | 141 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
155 | FILES:${PN} += "/usr/kernel-selftest" | 142 | FILES:${PN} += "/usr/kernel-selftest" |
156 | 143 | ||
157 | RDEPENDS:${PN} += "python3 perl perl-module-io-handle" | 144 | RDEPENDS:${PN} += "python3 perl perl-module-io-handle" |
158 | 145 | ||
159 | INSANE_SKIP:${PN} += "libdir" | 146 | INSANE_SKIP:${PN} += "libdir" |
160 | 147 | ||
148 | # A few of the selftests set compile flags that trip up the "ldflags" and | ||
149 | # "already-stripped" QA checks. As this is mainly a testing package and | ||
150 | # not really meant for user level execution, disable these two checks. | ||
151 | INSANE_SKIP:${PN} += "ldflags" | ||
152 | INSANE_SKIP:${PN} += "already-stripped" | ||
153 | |||
161 | SECURITY_CFLAGS = "" | 154 | SECURITY_CFLAGS = "" |
162 | COMPATIBLE_HOST:libc-musl = 'null' | 155 | COMPATIBLE_HOST:libc-musl = 'null' |
163 | 156 | ||
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch new file mode 100644 index 0000000000..bf5525c361 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 34021e84d03e2becb88e6c28e8e4867e82a81da5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 17 Sep 2024 17:40:03 -0700 | ||
4 | Subject: [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches | ||
5 | |||
6 | Newer 32-bit architectures e.g. riscv32 are using 64-bit time_t | ||
7 | from get go, they have not wired __NR_clock_adjtime at all | ||
8 | valid-adjtimex testcase fails to compile on such architectures. | ||
9 | if this condition is found then use 64-bit adjtime syscall | ||
10 | |||
11 | Upstream-Status: Submitted [https://patchwork.kernel.org/project/linux-kselftest/patch/20240918004731.3295870-1-raj.khem@gmail.com/] | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Cc: John Stultz <jstultz@google.com> | ||
14 | Cc: Shuah Khan <shuah@kernel.org> | ||
15 | --- | ||
16 | tools/testing/selftests/timers/valid-adjtimex.c | 4 ++++ | ||
17 | 1 file changed, 4 insertions(+) | ||
18 | |||
19 | diff --git a/tools/testing/selftests/timers/valid-adjtimex.c b/tools/testing/selftests/timers/valid-adjtimex.c | ||
20 | index d500884801d8..ff4ff8b1d127 100644 | ||
21 | --- a/tools/testing/selftests/timers/valid-adjtimex.c | ||
22 | +++ b/tools/testing/selftests/timers/valid-adjtimex.c | ||
23 | @@ -39,7 +39,11 @@ | ||
24 | #include <sys/syscall.h> | ||
25 | int clock_adjtime(clockid_t id, struct timex *tx) | ||
26 | { | ||
27 | +#if !defined(__NR_clock_adjtime) && defined(__NR_clock_adjtime64) | ||
28 | + return syscall(__NR_clock_adjtime64, id, tx); | ||
29 | +#else | ||
30 | return syscall(__NR_clock_adjtime, id, tx); | ||
31 | +#endif | ||
32 | } | ||
33 | |||
34 | |||
diff --git a/meta-oe/recipes-kernel/kpatch/kpatch.inc b/meta-oe/recipes-kernel/kpatch/kpatch.inc index 4d187200ec..b8ef092262 100644 --- a/meta-oe/recipes-kernel/kpatch/kpatch.inc +++ b/meta-oe/recipes-kernel/kpatch/kpatch.inc | |||
@@ -22,7 +22,6 @@ EXTRA_OEMAKE = " \ | |||
22 | CC='${CC}' \ | 22 | CC='${CC}' \ |
23 | " | 23 | " |
24 | 24 | ||
25 | S = "${WORKDIR}/git" | ||
26 | 25 | ||
27 | do_install () { | 26 | do_install () { |
28 | oe_runmake install | 27 | oe_runmake install |
diff --git a/meta-oe/recipes-kernel/kpatch/kpatch_git.bb b/meta-oe/recipes-kernel/kpatch/kpatch_git.bb index ba3983e6ff..6521830b7a 100644 --- a/meta-oe/recipes-kernel/kpatch/kpatch_git.bb +++ b/meta-oe/recipes-kernel/kpatch/kpatch_git.bb | |||
@@ -6,6 +6,5 @@ SRCREV = "0c3c21930895f6582a5c9d9d797f7e11ff41ffb2" | |||
6 | 6 | ||
7 | PV = "0.9.1" | 7 | PV = "0.9.1" |
8 | 8 | ||
9 | S = "${WORKDIR}/git" | ||
10 | 9 | ||
11 | BBCLASSEXTEND = "native nativesdk" | 10 | BBCLASSEXTEND = "native nativesdk" |
diff --git a/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0001-tlshd-Define-ALLPERMS-if-it-doesn-t-exist-to-fix-mus.patch b/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0001-tlshd-Define-ALLPERMS-if-it-doesn-t-exist-to-fix-mus.patch new file mode 100644 index 0000000000..954b1393db --- /dev/null +++ b/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0001-tlshd-Define-ALLPERMS-if-it-doesn-t-exist-to-fix-mus.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From ca95e956307672484e8c018263600749aa9c4f4d Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Wed, 9 Apr 2025 11:14:52 +1000 | ||
4 | Subject: [PATCH] tlshd: Define ALLPERMS if it doesn't exist to fix musl build | ||
5 | |||
6 | ALLPERMS exists in glibc, but not on musl, so we manually define | ||
7 | it if it doesn't exist. This fixes building on musl systems. | ||
8 | |||
9 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
10 | Upstream-Status: Submitted [https://github.com/oracle/ktls-utils/pull/88] | ||
11 | --- | ||
12 | src/tlshd/config.c | 8 ++++++++ | ||
13 | 1 file changed, 8 insertions(+) | ||
14 | |||
15 | diff --git a/src/tlshd/config.c b/src/tlshd/config.c | ||
16 | index 38948e8..e653bd8 100644 | ||
17 | --- a/src/tlshd/config.c | ||
18 | +++ b/src/tlshd/config.c | ||
19 | @@ -46,6 +46,14 @@ | ||
20 | |||
21 | static GKeyFile *tlshd_configuration; | ||
22 | |||
23 | +/** | ||
24 | + * ALLPERMS exists in glibc, but not on musl, so we | ||
25 | + * manually define it if it doesn't exist | ||
26 | + */ | ||
27 | +#ifndef ALLPERMS | ||
28 | +#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) | ||
29 | +#endif | ||
30 | + | ||
31 | /** | ||
32 | * tlshd_config_init - Read tlshd's config file | ||
33 | * @pathname: Pathname to config file | ||
34 | -- | ||
35 | 2.49.0 | ||
36 | |||
diff --git a/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0002-tlshd-configure.ac-Use-AC_CHECK_HEADER-instead-of-AC.patch b/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0002-tlshd-configure.ac-Use-AC_CHECK_HEADER-instead-of-AC.patch new file mode 100644 index 0000000000..6aabb77ee8 --- /dev/null +++ b/meta-oe/recipes-kernel/ktls-utils/ktls-utils/0002-tlshd-configure.ac-Use-AC_CHECK_HEADER-instead-of-AC.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From d170b04dcb8b2b28e370d8b18ffa1f593e8eec11 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Thu, 10 Apr 2025 13:15:16 +1000 | ||
4 | Subject: [PATCH] tlshd: configure.ac: Use AC_CHECK_HEADER instead of | ||
5 | AC_CHECK_FILE | ||
6 | |||
7 | AC_CHECK_FILE doesn't work when cross-compiling [1], which breaks a lot of | ||
8 | use cases (like OpenEmbedded for one). Autoconf supports AC_CHECK_HEADER | ||
9 | which can be used instead and is more robust [2] so let's use that | ||
10 | instead. | ||
11 | |||
12 | 1: https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Files.html | ||
13 | 2: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Generic-Headers.html | ||
14 | |||
15 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
16 | Upstream-Status: Submitted [https://github.com/oracle/ktls-utils/pull/90] | ||
17 | --- | ||
18 | configure.ac | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/configure.ac b/configure.ac | ||
22 | index 2c77fb1..c790d71 100644 | ||
23 | --- a/configure.ac | ||
24 | +++ b/configure.ac | ||
25 | @@ -63,7 +63,7 @@ PKG_CHECK_MODULES([LIBNL_GENL3], libnl-genl-3.0 >= 3.1) | ||
26 | AC_SUBST([LIBNL_GENL3_CFLAGS]) | ||
27 | AC_SUBST([LIBNL_GENL3_LIBS]) | ||
28 | |||
29 | -AC_CHECK_FILE([/usr/include/linux/quic.h], | ||
30 | +AC_CHECK_HEADER([linux/quic.h], | ||
31 | [AC_CHECK_LIB([gnutls], [gnutls_handshake_set_secret_function], | ||
32 | [AC_DEFINE([HAVE_GNUTLS_QUIC], [1], [Define to 1 if QUIC is found.])])]) | ||
33 | |||
34 | -- | ||
35 | 2.49.0 | ||
36 | |||
diff --git a/meta-oe/recipes-kernel/ktls-utils/ktls-utils_1.0.0.bb b/meta-oe/recipes-kernel/ktls-utils/ktls-utils_1.0.0.bb new file mode 100644 index 0000000000..1a90dcf998 --- /dev/null +++ b/meta-oe/recipes-kernel/ktls-utils/ktls-utils_1.0.0.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | SUMMARY = "TLS handshake utilities for in-kernel TLS consumers" | ||
2 | DESCRIPTION = "In-kernel TLS consumers need a mechanism to perform TLS \ | ||
3 | handshakes on a connected socket to negotiate TLS session parameters that \ | ||
4 | can then be programmed into the kernel's TLS record protocol engine." | ||
5 | DEPENDS = "gnutls keyutils glib-2.0 libnl" | ||
6 | RDEPENDS:${PN} += " gnutls" | ||
7 | LICENSE = "GPL-2.0-only" | ||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=d568123389d9a12625cca2b089b1728b" | ||
9 | |||
10 | SRCREV = "c787cd26330af457e1ca9cf43232db2c71c03154" | ||
11 | SRC_URI = " \ | ||
12 | git://github.com/oracle/ktls-utils.git;nobranch=1;protocol=https \ | ||
13 | file://0001-tlshd-Define-ALLPERMS-if-it-doesn-t-exist-to-fix-mus.patch \ | ||
14 | file://0002-tlshd-configure.ac-Use-AC_CHECK_HEADER-instead-of-AC.patch \ | ||
15 | " | ||
16 | |||
17 | |||
18 | inherit autotools-brokensep pkgconfig systemd | ||
19 | |||
20 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
21 | |||
22 | PACKAGECONFIG[systemd] = "--with-systemd,,systemd" | ||
23 | |||
24 | SYSTEMD_SERVICE:${PN} = "tlshd.service" | ||
diff --git a/meta-oe/recipes-kernel/libbpf/files/0001-libbpf-check-for-empty-BTF-data-section-in-btf_parse.patch b/meta-oe/recipes-kernel/libbpf/files/0001-libbpf-check-for-empty-BTF-data-section-in-btf_parse.patch new file mode 100644 index 0000000000..873995b644 --- /dev/null +++ b/meta-oe/recipes-kernel/libbpf/files/0001-libbpf-check-for-empty-BTF-data-section-in-btf_parse.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From ff2eb6e134ebfc225b97b46182af3cc58ed481f6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Thu, 10 Apr 2025 11:50:04 +0800 | ||
4 | Subject: [PATCH] libbpf: check for empty BTF data section in btf_parse_elf | ||
5 | |||
6 | A valid ELF file may contain a SHT_NOBITS .BTF section. This case is | ||
7 | not handled correctly in btf_parse_elf, which leads to a segfault. | ||
8 | |||
9 | Add a null check for a buffer returned by elf_getdata() before | ||
10 | proceeding with its processing. | ||
11 | |||
12 | Bug report: https://github.com/libbpf/libbpf/issues/894 | ||
13 | |||
14 | Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> | ||
15 | Acked-by: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com> | ||
16 | |||
17 | Upstream-Status: Backport [https://github.com/kernel-patches/bpf-rc/commit/b02b669fd9398d246c8c9ae901c0d8f5bb36a588] | ||
18 | |||
19 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
20 | --- | ||
21 | btf.c | 6 ++++++ | ||
22 | 1 file changed, 6 insertions(+) | ||
23 | |||
24 | diff --git a/btf.c b/btf.c | ||
25 | index e9673c0e..21d38dcf 100644 | ||
26 | --- a/btf.c | ||
27 | +++ b/btf.c | ||
28 | @@ -1199,6 +1199,12 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf, | ||
29 | goto done; | ||
30 | } | ||
31 | |||
32 | + if (!secs.btf_data->d_buf) { | ||
33 | + pr_warn("BTF data is empty in %s\n", path); | ||
34 | + err = -ENODATA; | ||
35 | + goto done; | ||
36 | + } | ||
37 | + | ||
38 | if (secs.btf_base_data) { | ||
39 | dist_base_btf = btf_new(secs.btf_base_data->d_buf, secs.btf_base_data->d_size, | ||
40 | NULL); | ||
41 | -- | ||
42 | 2.34.1 | ||
43 | |||
diff --git a/meta-oe/recipes-kernel/libbpf/files/CVE-2025-29481.patch b/meta-oe/recipes-kernel/libbpf/files/CVE-2025-29481.patch new file mode 100644 index 0000000000..ebfcb94a2f --- /dev/null +++ b/meta-oe/recipes-kernel/libbpf/files/CVE-2025-29481.patch | |||
@@ -0,0 +1,102 @@ | |||
1 | From 806b4e0a9f658d831119cece11a082ba1578b800 Mon Sep 17 00:00:00 2001 | ||
2 | From: Viktor Malik <vmalik@redhat.com> | ||
3 | Date: Tue, 15 Apr 2025 17:50:14 +0200 | ||
4 | Subject: [PATCH] libbpf: Fix buffer overflow in bpf_object__init_prog | ||
5 | |||
6 | As shown in [1], it is possible to corrupt a BPF ELF file such that | ||
7 | arbitrary BPF instructions are loaded by libbpf. This can be done by | ||
8 | setting a symbol (BPF program) section offset to a large (unsigned) | ||
9 | number such that <section start + symbol offset> overflows and points | ||
10 | before the section data in the memory. | ||
11 | |||
12 | Consider the situation below where: | ||
13 | - prog_start = sec_start + symbol_offset <-- size_t overflow here | ||
14 | - prog_end = prog_start + prog_size | ||
15 | |||
16 | prog_start sec_start prog_end sec_end | ||
17 | | | | | | ||
18 | v v v v | ||
19 | .....................|################################|............ | ||
20 | |||
21 | The report in [1] also provides a corrupted BPF ELF which can be used as | ||
22 | a reproducer: | ||
23 | |||
24 | $ readelf -S crash | ||
25 | Section Headers: | ||
26 | [Nr] Name Type Address Offset | ||
27 | Size EntSize Flags Link Info Align | ||
28 | ... | ||
29 | [ 2] uretprobe.mu[...] PROGBITS 0000000000000000 00000040 | ||
30 | 0000000000000068 0000000000000000 AX 0 0 8 | ||
31 | |||
32 | $ readelf -s crash | ||
33 | Symbol table '.symtab' contains 8 entries: | ||
34 | Num: Value Size Type Bind Vis Ndx Name | ||
35 | ... | ||
36 | 6: ffffffffffffffb8 104 FUNC GLOBAL DEFAULT 2 handle_tp | ||
37 | |||
38 | Here, the handle_tp prog has section offset ffffffffffffffb8, i.e. will | ||
39 | point before the actual memory where section 2 is allocated. | ||
40 | |||
41 | This is also reported by AddressSanitizer: | ||
42 | |||
43 | ================================================================= | ||
44 | ==1232==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7c7302fe0000 at pc 0x7fc3046e4b77 bp 0x7ffe64677cd0 sp 0x7ffe64677490 | ||
45 | READ of size 104 at 0x7c7302fe0000 thread T0 | ||
46 | #0 0x7fc3046e4b76 in memcpy (/lib64/libasan.so.8+0xe4b76) | ||
47 | #1 0x00000040df3e in bpf_object__init_prog /src/libbpf/src/libbpf.c:856 | ||
48 | #2 0x00000040df3e in bpf_object__add_programs /src/libbpf/src/libbpf.c:928 | ||
49 | #3 0x00000040df3e in bpf_object__elf_collect /src/libbpf/src/libbpf.c:3930 | ||
50 | #4 0x00000040df3e in bpf_object_open /src/libbpf/src/libbpf.c:8067 | ||
51 | #5 0x00000040f176 in bpf_object__open_file /src/libbpf/src/libbpf.c:8090 | ||
52 | #6 0x000000400c16 in main /poc/poc.c:8 | ||
53 | #7 0x7fc3043d25b4 in __libc_start_call_main (/lib64/libc.so.6+0x35b4) | ||
54 | #8 0x7fc3043d2667 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x3667) | ||
55 | #9 0x000000400b34 in _start (/poc/poc+0x400b34) | ||
56 | |||
57 | 0x7c7302fe0000 is located 64 bytes before 104-byte region [0x7c7302fe0040,0x7c7302fe00a8) | ||
58 | allocated by thread T0 here: | ||
59 | #0 0x7fc3046e716b in malloc (/lib64/libasan.so.8+0xe716b) | ||
60 | #1 0x7fc3045ee600 in __libelf_set_rawdata_wrlock (/lib64/libelf.so.1+0xb600) | ||
61 | #2 0x7fc3045ef018 in __elf_getdata_rdlock (/lib64/libelf.so.1+0xc018) | ||
62 | #3 0x00000040642f in elf_sec_data /src/libbpf/src/libbpf.c:3740 | ||
63 | |||
64 | The problem here is that currently, libbpf only checks that the program | ||
65 | end is within the section bounds. There used to be a check | ||
66 | `while (sec_off < sec_sz)` in bpf_object__add_programs, however, it was | ||
67 | removed by commit 6245947c1b3c ("libbpf: Allow gaps in BPF program | ||
68 | sections to support overriden weak functions"). | ||
69 | |||
70 | Add a check for detecting the overflow of `sec_off + prog_sz` to | ||
71 | bpf_object__init_prog to fix this issue. | ||
72 | |||
73 | [1] https://github.com/lmarch2/poc/blob/main/libbpf/libbpf.md | ||
74 | |||
75 | Fixes: 6245947c1b3c ("libbpf: Allow gaps in BPF program sections to support overriden weak functions") | ||
76 | Reported-by: lmarch2 <2524158037@qq.com> | ||
77 | Signed-off-by: Viktor Malik <vmalik@redhat.com> | ||
78 | Signed-off-by: Andrii Nakryiko <andrii@kernel.org> | ||
79 | Reviewed-by: Shung-Hsi Yu <shung-hsi.yu@suse.com> | ||
80 | Link: https://github.com/lmarch2/poc/blob/main/libbpf/libbpf.md | ||
81 | Link: https://lore.kernel.org/bpf/20250415155014.397603-1-vmalik@redhat.com | ||
82 | |||
83 | CVE: CVE-2025-29481 | ||
84 | Upstream-Status: Backport [https://github.com/libbpf/libbpf/commit/806b4e0a9f658d831119cece11a082ba1578b800] | ||
85 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
86 | --- | ||
87 | src/libbpf.c | 2 +- | ||
88 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
89 | |||
90 | diff --git a/src/libbpf.c b/src/libbpf.c | ||
91 | index b2591f5..56250b5 100644 | ||
92 | --- a/src/libbpf.c | ||
93 | +++ b/src/libbpf.c | ||
94 | @@ -889,7 +889,7 @@ bpf_object__add_programs(struct bpf_object *obj, Elf_Data *sec_data, | ||
95 | return -LIBBPF_ERRNO__FORMAT; | ||
96 | } | ||
97 | |||
98 | - if (sec_off + prog_sz > sec_sz) { | ||
99 | + if (sec_off + prog_sz > sec_sz || sec_off + prog_sz < sec_off) { | ||
100 | pr_warn("sec '%s': program at offset %zu crosses section boundary\n", | ||
101 | sec_name, sec_off); | ||
102 | return -LIBBPF_ERRNO__FORMAT; | ||
diff --git a/meta-oe/recipes-kernel/libbpf/libbpf_1.4.2.bb b/meta-oe/recipes-kernel/libbpf/libbpf_1.5.0.bb index 928482ba36..36312c386b 100644 --- a/meta-oe/recipes-kernel/libbpf/libbpf_1.4.2.bb +++ b/meta-oe/recipes-kernel/libbpf/libbpf_1.5.0.bb | |||
@@ -8,13 +8,16 @@ LIC_FILES_CHKSUM = "file://../LICENSE.LGPL-2.1;md5=b370887980db5dd40659b50909238 | |||
8 | 8 | ||
9 | DEPENDS = "zlib elfutils" | 9 | DEPENDS = "zlib elfutils" |
10 | 10 | ||
11 | SRC_URI = "git://github.com/libbpf/libbpf.git;protocol=https;branch=libbpf-1.4.2" | 11 | SRC_URI = "git://github.com/libbpf/libbpf.git;protocol=https;branch=master \ |
12 | SRCREV = "1b357586a7a62db7fe27af4ebe4bdefe6986cfd6" | 12 | file://0001-libbpf-check-for-empty-BTF-data-section-in-btf_parse.patch \ |
13 | file://CVE-2025-29481.patch;striplevel=2 \ | ||
14 | " | ||
15 | SRCREV = "09b9e83102eb8ab9e540d36b4559c55f3bcdb95d" | ||
13 | 16 | ||
14 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
15 | COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|riscv64|powerpc|powerpc64|mips64).*-linux" | 18 | COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|riscv64|powerpc|powerpc64|mips64).*-linux" |
16 | 19 | ||
17 | S = "${WORKDIR}/git/src" | 20 | S = "${UNPACKDIR}/${BP}/src" |
18 | 21 | ||
19 | EXTRA_OEMAKE += "DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir}" | 22 | EXTRA_OEMAKE += "DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir}" |
20 | EXTRA_OEMAKE:append:class-native = " UAPIDIR=${includedir}" | 23 | EXTRA_OEMAKE:append:class-native = " UAPIDIR=${includedir}" |
diff --git a/meta-oe/recipes-kernel/libpfm/libpfm4_4.13.0.bb b/meta-oe/recipes-kernel/libpfm/libpfm4_4.13.0.bb index be0659ad2a..f87502930e 100644 --- a/meta-oe/recipes-kernel/libpfm/libpfm4_4.13.0.bb +++ b/meta-oe/recipes-kernel/libpfm/libpfm4_4.13.0.bb | |||
@@ -26,7 +26,7 @@ EXTRA_OEMAKE:append:powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\"" | |||
26 | EXTRA_OEMAKE:append:powerpc64le = " ARCH=\"powerpc\" BITMODE=\"64\"" | 26 | EXTRA_OEMAKE:append:powerpc64le = " ARCH=\"powerpc\" BITMODE=\"64\"" |
27 | EXTRA_OEMAKE:append:aarch64 = " ARCH=\"arm64\"" | 27 | EXTRA_OEMAKE:append:aarch64 = " ARCH=\"arm64\"" |
28 | 28 | ||
29 | S = "${WORKDIR}/libpfm-${PV}" | 29 | S = "${UNPACKDIR}/libpfm-${PV}" |
30 | 30 | ||
31 | do_install () { | 31 | do_install () { |
32 | oe_runmake install | 32 | oe_runmake install |
diff --git a/meta-oe/recipes-kernel/libtracefs/libtracefs_1.8.0.bb b/meta-oe/recipes-kernel/libtracefs/libtracefs_1.8.1.bb index c90ac19fa7..6b9e8b9b38 100644 --- a/meta-oe/recipes-kernel/libtracefs/libtracefs_1.8.0.bb +++ b/meta-oe/recipes-kernel/libtracefs/libtracefs_1.8.1.bb | |||
@@ -9,11 +9,10 @@ LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 | |||
9 | SECTION = "libs" | 9 | SECTION = "libs" |
10 | DEPENDS = "libtraceevent bison-native flex-native" | 10 | DEPENDS = "libtraceevent bison-native flex-native" |
11 | 11 | ||
12 | SRCREV = "67f3b2ab9f836e6c9c70c94db7aac3251119a263" | 12 | SRCREV = "417c2e3aa21af670cc5c13db633dd35292f2d0fa" |
13 | SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git;branch=${BPN};protocol=https \ | 13 | SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git;branch=${BPN};protocol=https \ |
14 | file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch \ | 14 | file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch \ |
15 | " | 15 | " |
16 | S = "${WORKDIR}/git" | ||
17 | 16 | ||
18 | inherit pkgconfig | 17 | inherit pkgconfig |
19 | 18 | ||
diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch deleted file mode 100644 index 96a996f616..0000000000 --- a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | From 6d16911316cb576db0239f607e60918a222e4436 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Sun, 24 Apr 2022 17:25:33 +0800 | ||
4 | Subject: [PATCH] makedumpfile: replace hardcode CFLAGS | ||
5 | |||
6 | * Create alias for target such as powerpc as powerpc32 | ||
7 | * Remove hardcode CFLAGS | ||
8 | * Add CFLAGS_COMMON to instead of CFLAGS so can flexibly | ||
9 | customize CFLAGS and not hardcode the CFLAGS as previously | ||
10 | * Forcibly to link dynamic library as the poky build | ||
11 | system doesn't build static library by default | ||
12 | |||
13 | Upstream-Status: Inappropriate [oe specific] | ||
14 | |||
15 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
16 | |||
17 | [2021-11-18] Patch updated to use CFLAGS_COMMON for zstd | ||
18 | Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> | ||
19 | |||
20 | Rebase to 1.7.1 | ||
21 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
22 | --- | ||
23 | Makefile | 40 +++++++++++++++++++++------------------- | ||
24 | 1 file changed, 21 insertions(+), 19 deletions(-) | ||
25 | |||
26 | diff --git a/Makefile b/Makefile | ||
27 | index 71d8548..22acdd5 100644 | ||
28 | --- a/Makefile | ||
29 | +++ b/Makefile | ||
30 | @@ -8,12 +8,6 @@ ifeq ($(strip $CC),) | ||
31 | CC = gcc | ||
32 | endif | ||
33 | |||
34 | -CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ | ||
35 | - -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE | ||
36 | -CFLAGS := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"' | ||
37 | -CFLAGS_ARCH := $(CFLAGS_BASE) | ||
38 | -# LDFLAGS = -L/usr/local/lib -I/usr/local/include | ||
39 | - | ||
40 | HOST_ARCH := $(shell uname -m) | ||
41 | # Use TARGET as the target architecture if specified. | ||
42 | # Defaults to uname -m | ||
43 | @@ -24,26 +18,34 @@ endif | ||
44 | ARCH := $(shell echo ${TARGET} | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \ | ||
45 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
46 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
47 | - -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/) | ||
48 | + -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/ \ | ||
49 | + -e s/_powerpc_/_powerpc32_/) | ||
50 | |||
51 | CROSS := | ||
52 | ifneq ($(TARGET), $(HOST_ARCH)) | ||
53 | CROSS := -U__$(HOST_ARCH)__ | ||
54 | endif | ||
55 | |||
56 | -CFLAGS += -D__$(ARCH)__ $(CROSS) | ||
57 | CFLAGS_ARCH += -D__$(ARCH)__ $(CROSS) | ||
58 | |||
59 | -ifeq ($(ARCH), powerpc64) | ||
60 | -CFLAGS += -m64 | ||
61 | +ifeq ($(ARCH), __powerpc64__) | ||
62 | CFLAGS_ARCH += -m64 | ||
63 | endif | ||
64 | |||
65 | -ifeq ($(ARCH), powerpc32) | ||
66 | -CFLAGS += -m32 | ||
67 | +ifeq ($(ARCH), __powerpc32__) | ||
68 | CFLAGS_ARCH += -m32 | ||
69 | endif | ||
70 | |||
71 | +CFLAGS_ARCH += $(CFLAGS) \ | ||
72 | + -D_FILE_OFFSET_BITS=64 \ | ||
73 | + -D_LARGEFILE_SOURCE \ | ||
74 | + -D_LARGEFILE64_SOURCE | ||
75 | + | ||
76 | +CFLAGS_COMMON = $(CFLAGS_ARCH) \ | ||
77 | + -DVERSION='"$(VERSION)"' \ | ||
78 | + -DRELEASE_DATE='"$(DATE)"' | ||
79 | + | ||
80 | + | ||
81 | SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h | ||
82 | SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c tools.c printk.c detect_cycle.c | ||
83 | OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART)) | ||
84 | @@ -52,12 +54,12 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) | ||
85 | |||
86 | LIBS = -ldw -lbz2 -ldl -lelf -lz | ||
87 | ifneq ($(LINKTYPE), dynamic) | ||
88 | -LIBS := -static $(LIBS) -llzma | ||
89 | +LIBS := $(LIBS) -llzma | ||
90 | endif | ||
91 | |||
92 | ifeq ($(USELZO), on) | ||
93 | LIBS := -llzo2 $(LIBS) | ||
94 | -CFLAGS += -DUSELZO | ||
95 | +CFLAGS_COMMON += -DUSELZO | ||
96 | endif | ||
97 | |||
98 | ifeq ($(USESNAPPY), on) | ||
99 | @@ -65,12 +67,12 @@ LIBS := -lsnappy $(LIBS) | ||
100 | ifneq ($(LINKTYPE), dynamic) | ||
101 | LIBS := $(LIBS) -lstdc++ | ||
102 | endif | ||
103 | -CFLAGS += -DUSESNAPPY | ||
104 | +CFLAGS_COMMON += -DUSESNAPPY | ||
105 | endif | ||
106 | |||
107 | ifeq ($(USEZSTD), on) | ||
108 | LIBS := -lzstd $(LIBS) | ||
109 | -CFLAGS += -DUSEZSTD | ||
110 | +CFLAGS_COMMON += -DUSEZSTD | ||
111 | endif | ||
112 | |||
113 | ifeq ($(DEBUG), on) | ||
114 | @@ -104,14 +106,14 @@ LIBS := $(LIBS) $(call try-run,\ | ||
115 | all: makedumpfile | ||
116 | |||
117 | $(OBJ_PART): $(SRC_PART) | ||
118 | - $(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
119 | + $(CC) $(CFLAGS_COMMON) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
120 | |||
121 | $(OBJ_ARCH): $(SRC_ARCH) | ||
122 | @mkdir -p $(@D) | ||
123 | $(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
124 | |||
125 | makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) | ||
126 | - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS) | ||
127 | + $(CC) $(CFLAGS_COMMON) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS) | ||
128 | @sed -e "s/@DATE@/$(DATE)/" \ | ||
129 | -e "s/@VERSION@/$(VERSION)/" \ | ||
130 | $(VPATH)makedumpfile.8.in > $(VPATH)makedumpfile.8 | ||
131 | @@ -120,7 +122,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) | ||
132 | $(VPATH)makedumpfile.conf.5.in > $(VPATH)makedumpfile.conf.5 | ||
133 | |||
134 | eppic_makedumpfile.so: extension_eppic.c | ||
135 | - $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo | ||
136 | + $(CC) $(CFLAGS_COMMON) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo | ||
137 | |||
138 | clean: | ||
139 | rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8 makedumpfile.conf.5 | ||
diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb deleted file mode 100644 index 85b44c4941..0000000000 --- a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | SUMMARY = "VMcore extraction tool" | ||
2 | DESCRIPTION = "\ | ||
3 | This program is used to extract a subset of the memory available either \ | ||
4 | via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \ | ||
5 | images without extra uneeded information (zero pages, userspace programs, \ | ||
6 | etc). \ | ||
7 | " | ||
8 | HOMEPAGE = "https://github.com/makedumpfile/makedumpfile" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
11 | LICENSE = "GPL-2.0-only" | ||
12 | |||
13 | SRCBRANCH ?= "master" | ||
14 | SRCREV = "c266469347d49287be38059d45e7aaa454db9cb2" | ||
15 | |||
16 | DEPENDS = "bzip2 zlib elfutils xz" | ||
17 | RDEPENDS:${PN}-tools = "perl ${PN}" | ||
18 | |||
19 | # mips/rv32 would not compile. | ||
20 | COMPATIBLE_HOST:mipsarcho32 = "null" | ||
21 | COMPATIBLE_HOST:riscv32 = "null" | ||
22 | |||
23 | PACKAGES =+ "${PN}-tools" | ||
24 | FILES:${PN}-tools = "${bindir}/*.pl" | ||
25 | |||
26 | SRC_URI = "\ | ||
27 | git://github.com/makedumpfile/makedumpfile;branch=${SRCBRANCH};protocol=https \ | ||
28 | file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ | ||
29 | " | ||
30 | |||
31 | S = "${WORKDIR}/git" | ||
32 | |||
33 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" | ||
34 | |||
35 | SECTION = "base" | ||
36 | |||
37 | # If we do not specify TARGET, makedumpfile will build for the host but use the | ||
38 | # target gcc. | ||
39 | # | ||
40 | |||
41 | MAKEDUMPFILE_TARGET ?= "${TARGET_ARCH}" | ||
42 | MAKEDUMPFILE_TARGET:powerpc = "ppc" | ||
43 | |||
44 | EXTRA_OEMAKE = "\ | ||
45 | LINKTYPE=static \ | ||
46 | TARGET=${MAKEDUMPFILE_TARGET} \ | ||
47 | ${PACKAGECONFIG_CONFARGS} \ | ||
48 | " | ||
49 | |||
50 | PACKAGECONFIG ??= "" | ||
51 | PACKAGECONFIG[lzo] = "USELZO=on,USELZO=off,lzo" | ||
52 | PACKAGECONFIG[snappy] = "USESNAPPY=on,USESNAPPY=off,snappy" | ||
53 | PACKAGECONFIG[zstd] = "USEZSTD=on,USEZSTD=off,zstd" | ||
54 | |||
55 | do_install () { | ||
56 | mkdir -p ${D}/usr/bin | ||
57 | install -m 755 ${S}/makedumpfile ${D}/usr/bin | ||
58 | install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin | ||
59 | |||
60 | mkdir -p ${D}/etc/ | ||
61 | install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample | ||
62 | } | ||
diff --git a/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.7.bb b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.7.bb index 90e847c137..4073381899 100644 --- a/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.7.bb +++ b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.7.bb | |||
@@ -18,7 +18,6 @@ SRC_URI = "git://github.com/diamon/minicoredumper;protocol=https;branch=master \ | |||
18 | file://0001-corestripper-Fix-uninitialized-warning.patch \ | 18 | file://0001-corestripper-Fix-uninitialized-warning.patch \ |
19 | " | 19 | " |
20 | 20 | ||
21 | S = "${WORKDIR}/git" | ||
22 | 21 | ||
23 | SYSTEMD_SERVICE:${PN} = "minicoredumper.service" | 22 | SYSTEMD_SERVICE:${PN} = "minicoredumper.service" |
24 | SYSTEMD_AUTO_ENABLE = "enable" | 23 | SYSTEMD_AUTO_ENABLE = "enable" |
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch index 56981d96fa..e28903d6ba 100644 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch +++ b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 50cea8fd3c07ab27da6edce865a49339f16f3b57 Mon Sep 17 00:00:00 2001 | 1 | From 468850b5d39435025633df14dda3d48651d9ec29 Mon Sep 17 00:00:00 2001 |
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> |
3 | Date: Tue, 18 Jun 2019 17:10:15 +0800 | 3 | Date: Tue, 18 Jun 2019 17:10:15 +0800 |
4 | Subject: [PATCH] Makefile: fix multilib build failure | 4 | Subject: [PATCH] Makefile: fix multilib build failure |
@@ -6,20 +6,26 @@ Subject: [PATCH] Makefile: fix multilib build failure | |||
6 | Upstream-Status: Inappropriate [oe specific] | 6 | Upstream-Status: Inappropriate [oe specific] |
7 | 7 | ||
8 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | 8 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> |
9 | |||
10 | Refresh to 5.13 | ||
11 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
9 | --- | 12 | --- |
10 | Makefile | 50 +++++++++++++++++++++++++++----------------------- | 13 | Makefile | 16 ++++++++++------ |
11 | 1 file changed, 27 insertions(+), 23 deletions(-) | 14 | 1 file changed, 10 insertions(+), 6 deletions(-) |
12 | 15 | ||
13 | diff --git a/Makefile b/Makefile | 16 | diff --git a/Makefile b/Makefile |
14 | index 8455415..4aa0786 100644 | 17 | index 337c53e..58e3779 100644 |
15 | --- a/Makefile | 18 | --- a/Makefile |
16 | +++ b/Makefile | 19 | +++ b/Makefile |
17 | @@ -1,30 +1,34 @@ | 20 | @@ -25,6 +25,7 @@ BINDIR ?= /usr/bin |
18 | # SPDX-License-Identifier: GPL-2.0 | 21 | MANDIR ?= /usr/share/man |
19 | PREFIX ?= /usr | 22 | SHRDIR ?= /usr/share/pm-graph |
20 | DESTDIR ?= | 23 | LIBDIR ?= /usr/lib |
21 | +BASELIB ?= | 24 | +BASELIB ?= |
22 | 25 | ||
26 | # Toolchain: what tools do we use, and what options do they need: | ||
27 | INSTALL = /usr/bin/install | ||
28 | @@ -33,6 +34,9 @@ INSTALL_DATA = ${INSTALL} -m 644 | ||
23 | all: | 29 | all: |
24 | @echo "Nothing to build" | 30 | @echo "Nothing to build" |
25 | 31 | ||
@@ -27,63 +33,34 @@ index 8455415..4aa0786 100644 | |||
27 | + @echo "Nothing to clean" | 33 | + @echo "Nothing to clean" |
28 | + | 34 | + |
29 | install : uninstall | 35 | install : uninstall |
30 | - install -d $(DESTDIR)$(PREFIX)/lib/pm-graph | 36 | $(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph |
31 | - install sleepgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph | 37 | $(INSTALL) sleepgraph.py $(DESTDIR)$(LIBDIR)/pm-graph |
32 | - install bootgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph | 38 | @@ -54,10 +58,10 @@ install : uninstall |
33 | - install -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config | 39 | $(INSTALL) -d $(DESTDIR)$(SHRDIR) |
34 | - install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
35 | - install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
36 | - install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
37 | - install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
38 | - install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
39 | - install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
40 | - install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
41 | - install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
42 | - install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
43 | - install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
44 | - install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config | ||
45 | + install -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph | ||
46 | + install sleepgraph.py $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph | ||
47 | + install bootgraph.py $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph | ||
48 | + install -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
49 | + install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
50 | + install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
51 | + install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
52 | + install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
53 | + install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
54 | + install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
55 | + install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
56 | + install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
57 | + install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
58 | + install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
59 | + install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config | ||
60 | 40 | ||
61 | install -d $(DESTDIR)$(PREFIX)/bin | 41 | $(INSTALL) -d $(DESTDIR)$(BINDIR) |
62 | - ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph | 42 | - ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(BINDIR)/bootgraph |
63 | - ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph | 43 | - ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(BINDIR)/sleepgraph |
64 | + ln -s ../$(BASELIB)/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph | 44 | - ln -s ../lib/pm-graph/netfix.py $(DESTDIR)$(BINDIR)/netfix |
65 | + ln -s ../$(BASELIB)/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph | 45 | - $(DESTDIR)$(BINDIR)/netfix defconfig > $(DESTDIR)$(SHRDIR)/netfix.cfg |
46 | + ln -s ../$(BASELIB)/pm-graph/bootgraph.py $(DESTDIR)$(BINDIR)/bootgraph | ||
47 | + ln -s ../$(BASELIB)/pm-graph/sleepgraph.py $(DESTDIR)$(BINDIR)/sleepgraph | ||
48 | + ln -s ../$(BASELIB)/pm-graph/netfix.py $(DESTDIR)$(BINDIR)/netfix | ||
49 | + #$(DESTDIR)$(BINDIR)/netfix defconfig > $(DESTDIR)$(SHRDIR)/netfix.cfg | ||
66 | 50 | ||
67 | install -d $(DESTDIR)$(PREFIX)/share/man/man8 | 51 | $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8 |
68 | install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8 | 52 | $(INSTALL) bootgraph.8 $(DESTDIR)$(MANDIR)/man8 |
69 | @@ -37,11 +41,11 @@ uninstall : | 53 | @@ -90,8 +94,8 @@ hwcheck-install : |
70 | rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph | 54 | rm -f $(DESTDIR)$(LIBDIR)/pm-graph/hwcheck.py |
71 | rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph | 55 | $(INSTALL) tools/hwcheck.py $(DESTDIR)$(LIBDIR)/pm-graph |
56 | $(INSTALL) -d $(DESTDIR)$(BINDIR) | ||
57 | - ln -s ../lib/pm-graph/hwcheck.py $(DESTDIR)$(BINDIR)/hwcheck | ||
58 | - $(DESTDIR)$(BINDIR)/hwcheck cronon | ||
59 | + ln -s ../$(BASELIB)/pm-graph/hwcheck.py $(DESTDIR)$(BINDIR)/hwcheck | ||
60 | + #$(DESTDIR)$(BINDIR)/hwcheck cronon | ||
72 | 61 | ||
73 | - rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/config/* | 62 | hwcheck-uninstall : |
74 | - if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config ] ; then \ | 63 | if [ -e $(DESTDIR)$(BINDIR)/hwcheck ] ; then \ |
75 | - rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/config; \ | ||
76 | + rm -f $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config/* | ||
77 | + if [ -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ] ; then \ | ||
78 | + rmdir $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config; \ | ||
79 | fi; | ||
80 | - rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/* | ||
81 | - if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \ | ||
82 | - rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \ | ||
83 | + rm -f $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/* | ||
84 | + if [ -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph ] ; then \ | ||
85 | + rmdir $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph; \ | ||
86 | fi; | ||
87 | -- | 64 | -- |
88 | 2.17.1 | 65 | 2.25.1 |
89 | 66 | ||
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph-add-support-for-RT-kernel-ftrace-flags.patch b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph-add-support-for-RT-kernel-ftrace-flags.patch deleted file mode 100644 index f7f8bc0687..0000000000 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph-add-support-for-RT-kernel-ftrace-flags.patch +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | From 47a1db21f6c5d17c94c58c3fe0dcce35c623dbf4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Liwei Song <liwei.song@windriver.com> | ||
3 | Date: Tue, 23 Jun 2020 04:47:20 +0000 | ||
4 | Subject: [PATCH] sleepgraph: add support for RT kernel ftrace flags | ||
5 | |||
6 | with PREEMPT_RT enabled in kernel, ftrace have a different | ||
7 | flags format: | ||
8 | |||
9 | _-----=> irqs-off | ||
10 | / _----=> need-resched | ||
11 | | / _----=> need-resched | ||
12 | || / _---=> hardirq/softirq | ||
13 | ||| / _--=> preempt-depth | ||
14 | ||||/ delay | ||
15 | TASK-PID CPU# ||||| TIMESTAMP FUNCTION | ||
16 | | | | ||||| | | | ||
17 | |||
18 | add support for this. | ||
19 | |||
20 | Upstream-Status: Submitted [https://github.com/intel/pm-graph/pull/18] | ||
21 | |||
22 | Signed-off-by: Liwei Song <liwei.song@windriver.com> | ||
23 | --- | ||
24 | sleepgraph.py | 2 +- | ||
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/sleepgraph.py b/sleepgraph.py | ||
28 | index cfed8e09e0e6..561f165cf9be 100755 | ||
29 | --- a/sleepgraph.py | ||
30 | +++ b/sleepgraph.py | ||
31 | @@ -2689,7 +2689,7 @@ class TestProps: | ||
32 | '[ +!#\*@$]*(?P<dur>[0-9\.]*) .*\| (?P<msg>.*)' | ||
33 | ftrace_line_fmt_nop = \ | ||
34 | ' *(?P<proc>.*)-(?P<pid>[0-9]*) *\[(?P<cpu>[0-9]*)\] *'+\ | ||
35 | - '(?P<flags>.{4}) *(?P<time>[0-9\.]*): *'+\ | ||
36 | + '(?P<flags>.{4,7}) *(?P<time>[0-9\.]*): *'+\ | ||
37 | '(?P<msg>.*)' | ||
38 | def __init__(self): | ||
39 | self.stamp = '' | ||
40 | -- | ||
41 | 2.24.1 | ||
42 | |||
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch deleted file mode 100644 index fc5991d464..0000000000 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | From 9bbc991a927722439cad38c892fc9f57207089d3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Liwei Song <liwei.song@windriver.com> | ||
3 | Date: Mon, 24 May 2021 08:27:28 +0000 | ||
4 | Subject: [PATCH] sleepgraph.py: parse unfished cpu exec line | ||
5 | |||
6 | exist the below case in ftrace file: | ||
7 | sleepgraph-6508 [003] .... 18197.824037: tracing_mark_write: ps - xxx..., lock_torture_wr-94 169,lock_torture_wr-95 143,lock_tort | ||
8 | sleepgraph-6508 [003] .... 18197.824043: tracing_mark_write: ure_wr-96 189,lock_torture_wr-97 174,lock_torture_wr-98 160,lock_torture_st-99 1 | ||
9 | |||
10 | lock_torture_wr-96 was split to different line due to limited buffer | ||
11 | size(1k) set in kernel, check this case and re-parse the unfinished | ||
12 | line. | ||
13 | |||
14 | Upstream-Status: Submitted [https://github.com/intel/pm-graph/pull/20] | ||
15 | |||
16 | Signed-off-by: Liwei Song <liwei.song@windriver.com> | ||
17 | --- | ||
18 | sleepgraph.py | 17 +++++++++++++++-- | ||
19 | 1 file changed, 15 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/sleepgraph.py b/sleepgraph.py | ||
22 | index e340d5b3f03b..38b4439db8eb 100755 | ||
23 | --- a/sleepgraph.py | ||
24 | +++ b/sleepgraph.py | ||
25 | @@ -3365,8 +3365,21 @@ def parseTraceLog(live=False): | ||
26 | val = ps.split() | ||
27 | if not val: | ||
28 | continue | ||
29 | - name = val[0].replace('--', '-') | ||
30 | - proclist[name] = int(val[1]) | ||
31 | + if not len(val) < 2: | ||
32 | + name = val[0].replace('--', '-') | ||
33 | + proclist[name] = int(val[1]) | ||
34 | + else: | ||
35 | + proclist = dict() | ||
36 | + nextline = next(tf) | ||
37 | + mcont = re.match(tp.ftrace_line_fmt, nextline) | ||
38 | + n = m.group('ps') + mcont.group('msg').split(': ')[1] | ||
39 | + for pscont in n.split(','): | ||
40 | + val = pscont.split() | ||
41 | + if not val: | ||
42 | + continue | ||
43 | + if not len(val) < 2: | ||
44 | + name = val[0].replace('--', '-') | ||
45 | + proclist[name] = int(val[1]) | ||
46 | data.pstl[t.time] = proclist | ||
47 | continue | ||
48 | # find the end of resume | ||
49 | -- | ||
50 | 2.29.2 | ||
51 | |||
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch deleted file mode 100644 index 25c87093f6..0000000000 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 22ce65d997f99606a3bb9d2a660ead42eecc234a Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Wed, 11 Sep 2019 11:31:07 +0800 | ||
4 | Subject: [PATCH] sleepgraph.py: use python3 | ||
5 | |||
6 | Already compatible with Python 3. | ||
7 | Same goes for bootgraph.py | ||
8 | |||
9 | Upstream-Status: Inappropriate [oe specific] | ||
10 | |||
11 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
12 | --- | ||
13 | bootgraph.py | 2 +- | ||
14 | sleepgraph.py | 2 +- | ||
15 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/bootgraph.py b/bootgraph.py | ||
18 | index d3b99a1..efb5714 100755 | ||
19 | --- a/bootgraph.py | ||
20 | +++ b/bootgraph.py | ||
21 | @@ -1,4 +1,4 @@ | ||
22 | -#!/usr/bin/python | ||
23 | +#!/usr/bin/python3 | ||
24 | # SPDX-License-Identifier: GPL-2.0-only | ||
25 | # | ||
26 | # Tool for analyzing boot timing | ||
27 | diff --git a/sleepgraph.py b/sleepgraph.py | ||
28 | index 1794c79..cfed8e0 100755 | ||
29 | --- a/sleepgraph.py | ||
30 | +++ b/sleepgraph.py | ||
31 | @@ -1,4 +1,4 @@ | ||
32 | -#!/usr/bin/python | ||
33 | +#!/usr/bin/python3 | ||
34 | # SPDX-License-Identifier: GPL-2.0-only | ||
35 | # | ||
36 | # Tool for analyzing suspend/resume timing | ||
37 | -- | ||
38 | 2.17.1 | ||
39 | |||
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb b/meta-oe/recipes-kernel/pm-graph/pm-graph_5.13.bb index 6e52a58de5..219629d4d7 100644 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb +++ b/meta-oe/recipes-kernel/pm-graph/pm-graph_5.13.bb | |||
@@ -5,14 +5,10 @@ HOMEPAGE = "https://01.org/pm-graph" | |||
5 | LICENSE = "GPL-2.0-only" | 5 | LICENSE = "GPL-2.0-only" |
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" |
7 | 7 | ||
8 | SRCREV = "cf59527dc24fdd2f314ae4dcaeb3d68a117988f6" | 8 | SRCREV = "0987732b013936ad771334f51cba31c453c8a9c9" |
9 | SRC_URI = "git://github.com/intel/pm-graph.git;branch=master;protocol=https \ | 9 | SRC_URI = "git://github.com/intel/pm-graph.git;branch=master;protocol=https \ |
10 | file://0001-Makefile-fix-multilib-build-failure.patch \ | 10 | file://0001-Makefile-fix-multilib-build-failure.patch \ |
11 | file://0001-sleepgraph.py-use-python3.patch \ | ||
12 | file://0001-sleepgraph-add-support-for-RT-kernel-ftrace-flags.patch \ | ||
13 | file://0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch \ | ||
14 | " | 11 | " |
15 | S = "${WORKDIR}/git" | ||
16 | 12 | ||
17 | # Apart from the listed RDEPENDS, analyze-suspend depends on some features | 13 | # Apart from the listed RDEPENDS, analyze-suspend depends on some features |
18 | # provided by the kernel. These options are: | 14 | # provided by the kernel. These options are: |
@@ -22,12 +18,14 @@ S = "${WORKDIR}/git" | |||
22 | # - CONFIG_FUNCTION_TRACER=y | 18 | # - CONFIG_FUNCTION_TRACER=y |
23 | # - CONFIG_FUNCTION_GRAPH_TRACER=y | 19 | # - CONFIG_FUNCTION_GRAPH_TRACER=y |
24 | 20 | ||
25 | COMPATIBLE_HOST='(i.86|x86_64).*' | 21 | COMPATIBLE_HOST = '(i.86|x86_64).*' |
26 | EXTRA_OEMAKE = "PREFIX=${prefix} DESTDIR=${D} BASELIB=${baselib}" | 22 | EXTRA_OEMAKE = "PREFIX=${prefix} DESTDIR=${D} LIBDIR=${libdir} BASELIB=${baselib}" |
27 | 23 | ||
28 | do_install() { | 24 | do_install() { |
29 | oe_runmake install | 25 | oe_runmake install |
30 | install -Dm 0755 ${S}/analyze_suspend.py ${D}${bindir}/analyze_suspend.py | 26 | install -Dm 0755 ${S}/analyze_suspend.py ${D}${bindir}/analyze_suspend.py |
27 | |||
28 | rm -rf ${D}${libdir}/pm-graph/__pycache__ | ||
31 | } | 29 | } |
32 | 30 | ||
33 | RDEPENDS:${PN} += "python3-core python3-threading python3-datetime python3-compression" | 31 | RDEPENDS:${PN} += "python3-core python3-threading python3-datetime python3-compression" |
diff --git a/meta-oe/recipes-kernel/spidev-test/spidev-test.bb b/meta-oe/recipes-kernel/spidev-test/spidev-test.bb index 2e8c5cbb8d..7b87dd28df 100644 --- a/meta-oe/recipes-kernel/spidev-test/spidev-test.bb +++ b/meta-oe/recipes-kernel/spidev-test/spidev-test.bb | |||
@@ -6,7 +6,7 @@ PROVIDES = "virtual/spidev-test" | |||
6 | 6 | ||
7 | inherit bash-completion kernelsrc kernel-arch | 7 | inherit bash-completion kernelsrc kernel-arch |
8 | 8 | ||
9 | do_populate_lic[depends] += "virtual/kernel:do_patch" | 9 | do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" |
10 | 10 | ||
11 | EXTRA_OEMAKE = "-C ${S}/tools/spi O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" | 11 | EXTRA_OEMAKE = "-C ${S}/tools/spi O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" |
12 | 12 | ||
diff --git a/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb b/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb index 11c4037b23..6782dec228 100644 --- a/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb +++ b/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb | |||
@@ -12,7 +12,6 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;b | |||
12 | file://0001-Do-not-emit-useless-rpath.patch" | 12 | file://0001-Do-not-emit-useless-rpath.patch" |
13 | SRCREV = "18233e4c32857cb7ddd4960beeec8360ed834fc5" | 13 | SRCREV = "18233e4c32857cb7ddd4960beeec8360ed834fc5" |
14 | 14 | ||
15 | S = "${WORKDIR}/git" | ||
16 | 15 | ||
17 | DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native swig-native bison-native flex-native" | 16 | DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native swig-native bison-native flex-native" |
18 | 17 | ||
diff --git a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/meta-oe/recipes-kernel/turbostat/turbostat.bb index 4770fae50e..f65699865e 100644 --- a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb +++ b/meta-oe/recipes-kernel/turbostat/turbostat.bb | |||
@@ -16,12 +16,14 @@ LIC_FILES_CHKSUM = "file://${UNPACKDIR}/COPYING;md5=bbea815ee2795b2f4230826c0c6b | |||
16 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' | 16 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' |
17 | COMPATIBLE_HOST:libc-musl = "null" | 17 | COMPATIBLE_HOST:libc-musl = "null" |
18 | 18 | ||
19 | KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" | ||
20 | inherit linux-kernel-base | ||
21 | |||
19 | SRC_URI += "\ | 22 | SRC_URI += "\ |
20 | file://COPYING \ | 23 | file://COPYING \ |
21 | " | 24 | " |
22 | 25 | ||
23 | S = "${WORKDIR}/sources" | 26 | S = "${UNPACKDIR}" |
24 | UNPACKDIR = "${S}" | ||
25 | 27 | ||
26 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 28 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
27 | DEPENDS = "libcap" | 29 | DEPENDS = "libcap" |
@@ -33,7 +35,7 @@ do_populate_lic[depends] = "${PN}:do_configure" | |||
33 | 35 | ||
34 | 36 | ||
35 | EXTRA_OEMAKE = '\ | 37 | EXTRA_OEMAKE = '\ |
36 | CC="${CC}" 'CFLAGS=-Wall ${LDFLAGS}' \ | 38 | CC="${CC}" 'CFLAGS=-Wall ${LDFLAGS}' \ |
37 | ' | 39 | ' |
38 | 40 | ||
39 | # If we build under STAGING_KERNEL_DIR, source will not be put | 41 | # If we build under STAGING_KERNEL_DIR, source will not be put |
@@ -52,12 +54,21 @@ do_configure:prepend() { | |||
52 | cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S} | 54 | cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S} |
53 | cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S} | 55 | cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S} |
54 | fi | 56 | fi |
57 | if [ -f "${STAGING_KERNEL_DIR}/tools/include/linux/build_bug.h" ]; then | ||
58 | cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/build_bug.h ${S} | ||
59 | fi | ||
60 | cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler.h ${S} | ||
61 | cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler_types.h ${S} | ||
62 | cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler-gcc.h ${S} | ||
55 | cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} | 63 | cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} |
56 | } | 64 | } |
57 | 65 | ||
58 | 66 | ||
59 | do_compile() { | 67 | do_compile() { |
60 | sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h | 68 | sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h |
69 | sed -i 's#<linux/compiler.h>#"compiler.h"#' build_bug.h | ||
70 | sed -i 's#<linux/compiler_types.h>#"compiler_types.h"#' compiler.h | ||
71 | sed -i 's#<linux/compiler-gcc.h>#"compiler-gcc.h"#' compiler_types.h | ||
61 | 'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true | 72 | 'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true |
62 | if [ -n $TMPCHECK ]; then | 73 | if [ -n $TMPCHECK ]; then |
63 | sed -i 's#<vdso/const.h>#"const.h"#' bits.h | 74 | sed -i 's#<vdso/const.h>#"const.h"#' bits.h |
@@ -66,8 +77,15 @@ do_compile() { | |||
66 | sed -i 's#<linux/const.h>#"const.h"#' bits.h | 77 | sed -i 's#<linux/const.h>#"const.h"#' bits.h |
67 | sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h | 78 | sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h |
68 | fi | 79 | fi |
80 | echo '#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))' >> msr-index.h | ||
81 | echo "#define BIT(x) (1 << (x))" > bits.h | ||
82 | echo "#define BIT_ULL(nr) (1ULL << (nr))" >> bits.h | ||
83 | echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> bits.h | ||
84 | echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> bits.h | ||
85 | |||
69 | sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c | 86 | sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c |
70 | sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c | 87 | sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c |
88 | sed -i 's#BUILD_BUG_HEADER#"build_bug.h"#' turbostat.c | ||
71 | sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile | 89 | sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile |
72 | oe_runmake STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR} | 90 | oe_runmake STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR} |
73 | } | 91 | } |
@@ -75,3 +93,7 @@ do_compile() { | |||
75 | do_install() { | 93 | do_install() { |
76 | oe_runmake DESTDIR="${D}" install | 94 | oe_runmake DESTDIR="${D}" install |
77 | } | 95 | } |
96 | |||
97 | python do_package:prepend() { | ||
98 | d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) | ||
99 | } | ||
diff --git a/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb b/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb index e7e4ca50af..aae17a9fd7 100644 --- a/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb +++ b/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb | |||
@@ -28,7 +28,7 @@ do_configure[depends] += "virtual/kernel:do_shared_workdir" | |||
28 | 28 | ||
29 | # We need to set S, for not being set to STAGING_KERNEL_DIR, and by that | 29 | # We need to set S, for not being set to STAGING_KERNEL_DIR, and by that |
30 | # be wiped when we prune dest below. We just set it to usbip-tools-1.0 | 30 | # be wiped when we prune dest below. We just set it to usbip-tools-1.0 |
31 | S = "${WORKDIR}/${BP}" | 31 | S = "${UNPACKDIR}/${BP}" |
32 | 32 | ||
33 | # Copy the source files from KERNEL/tools/usb/usbip to ${S} | 33 | # Copy the source files from KERNEL/tools/usb/usbip to ${S} |
34 | do_configure[prefuncs] += "copy_usbip_source_from_kernel" | 34 | do_configure[prefuncs] += "copy_usbip_source_from_kernel" |