summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch
diff options
context:
space:
mode:
authorWang Mingyu <wangmy@fujitsu.com>2024-07-29 09:09:40 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-03 07:47:35 +0100
commit10398200c80dbc0431291660205d9524064f4f3e (patch)
treea0fc00409c48c9ee77869a66cf5ed85faa566486 /meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch
parent67c0075955e1e1212da9db9a0e386915a41fa59b (diff)
downloadpoky-10398200c80dbc0431291660205d9524064f4f3e.tar.gz
kexec-tools: upgrade 2.0.28 -> 2.0.29
0001-x86-linux-setup.c-Use-POSIX-basename-API.patch 0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch Fix-building-on-x86_64-with-binutils-2.41.patch removed since they're included in 2.0.29 License-Update: "GNU Library General" changedto "GNU Lesser General" file format changed (From OE-Core rev: 74b382e2d43a2bc355e2f2b2591c6ce9cadd56a3) Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch')
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch54
1 files changed, 0 insertions, 54 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch
deleted file mode 100644
index e223f45998..0000000000
--- a/meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1From 32c8ffa7ace6f1b7e63f9ddffab00b00c36a7b57 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 15 May 2024 21:18:08 -0700
4Subject: [PATCH] x86-linux-setup.c: Use POSIX basename API
5
6Musl C library only supports POSIX basename function. while glibc has
7both GNU extention as well as POSIX basename implemented. Switch to
8using posix version, so it can work across musl and glibc
9
10basename prototype has been removed from string.h from latest musl [1]
11compilers e.g. clang-18/GCC-14 flags the absense of prototype as error.
12therefore include libgen.h for providing it.
13
14[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
15
16Upstream-Status: Submitted [https://lists.infradead.org/pipermail/kexec/2024-May/030034.html]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 kexec/arch/i386/x86-linux-setup.c | 9 ++++++---
20 1 file changed, 6 insertions(+), 3 deletions(-)
21
22diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
23index 9a281dc..73251b9 100644
24--- a/kexec/arch/i386/x86-linux-setup.c
25+++ b/kexec/arch/i386/x86-linux-setup.c
26@@ -14,6 +14,7 @@
27 *
28 */
29 #define _GNU_SOURCE
30+#include <libgen.h>
31 #include <stdint.h>
32 #include <stdio.h>
33 #include <string.h>
34@@ -329,12 +330,14 @@ static int add_edd_entry(struct x86_linux_param_header *real_mode,
35 memset(edd_info, 0, sizeof(struct edd_info));
36
37 /* extract the device number */
38- if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
39+ char* sysfs_name_copy = strdup(sysfs_name);
40+ if (sscanf(basename(sysfs_name_copy), "int13_dev%hhx", &devnum) != 1) {
41 fprintf(stderr, "Invalid format of int13_dev dir "
42- "entry: %s\n", basename(sysfs_name));
43+ "entry: %s\n", basename(sysfs_name_copy));
44+ free(sysfs_name_copy);
45 return -1;
46 }
47-
48+ free(sysfs_name_copy);
49 /* if there's a MBR signature, then add it */
50 if (file_scanf(sysfs_name, "mbr_signature", "0x%x", &mbr_sig) == 1) {
51 real_mode->edd_mbr_sig_buffer[*current_mbr] = mbr_sig;
52--
532.45.1
54