Files
tqma6-yocto-mirror/sources/poky/meta/recipes-kernel/kexec/kexec-tools/0001-x86-linux-setup.c-Use-POSIX-basename-API.patch
Siggi (OpenClaw Agent) 16accb6b24 Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
2026-03-01 21:14:11 +00:00

55 lines
2.0 KiB
Diff

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