mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-21 01:31:26 +00:00
Make kexec work with musl-libc.
Remove unused tools (crash kernel and vmcore). Replace "%Lx" scanf formatting with "%"SCNxPTR in /proc/iommem reading code. This might be a musl bug since it works with glibc sscanf.
This commit is contained in:
parent
84064debbe
commit
e68f09bbfd
67
patches/kexec-2.0.12.patch
Normal file
67
patches/kexec-2.0.12.patch
Normal file
@ -0,0 +1,67 @@
|
||||
diff -u --recursive clean/kexec-tools-2.0.12/kexec/arch/i386/kexec-x86-common.c build/kexec-tools-2.0.12/kexec/arch/i386/kexec-x86-common.c
|
||||
--- clean/kexec-tools-2.0.12/kexec/arch/i386/kexec-x86-common.c 2015-11-29 18:52:07.000000000 -0500
|
||||
+++ kexec-tools-2.0.12/kexec/arch/i386/kexec-x86-common.c 2017-01-04 13:46:53.684313636 -0500
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
+#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -74,20 +75,20 @@
|
||||
return -1;
|
||||
}
|
||||
while(fgets(line, sizeof(line), fp) != 0) {
|
||||
- unsigned long long start, end;
|
||||
+ uintptr_t start, end;
|
||||
char *str;
|
||||
int type;
|
||||
int consumed;
|
||||
int count;
|
||||
if (memory_ranges >= MAX_MEMORY_RANGES)
|
||||
break;
|
||||
- count = sscanf(line, "%Lx-%Lx : %n",
|
||||
+ count = sscanf(line, "%"SCNxPTR"-%"SCNxPTR" : %n",
|
||||
&start, &end, &consumed);
|
||||
if (count != 2)
|
||||
continue;
|
||||
str = line + consumed;
|
||||
|
||||
- dbgprintf("%016Lx-%016Lx : %s", start, end, str);
|
||||
+ dbgprintf("%016"PRIxPTR"-%016"PRIxPTR" : %s", start, end, str);
|
||||
|
||||
if (memcmp(str, "System RAM\n", 11) == 0) {
|
||||
type = RANGE_RAM;
|
||||
@@ -114,7 +115,7 @@
|
||||
memory_range[memory_ranges].end = end;
|
||||
memory_range[memory_ranges].type = type;
|
||||
|
||||
- dbgprintf("%016Lx-%016Lx : %x\n", start, end, type);
|
||||
+ dbgprintf("%016"PRIxPTR"-%016"PRIxPTR" : %x\n", start, end, type);
|
||||
|
||||
memory_ranges++;
|
||||
}
|
||||
diff -u --recursive clean/kexec-tools-2.0.12/Makefile.in build/kexec-tools-2.0.12/Makefile.in
|
||||
--- clean/kexec-tools-2.0.12/Makefile.in 2014-10-14 00:58:06.000000000 -0400
|
||||
+++ kexec-tools-2.0.12/Makefile.in 2017-01-04 10:08:51.584425301 -0500
|
||||
@@ -158,16 +158,16 @@
|
||||
|
||||
# kdump (read a crashdump from memory)
|
||||
#
|
||||
-include $(srcdir)/kdump/Makefile
|
||||
+#include $(srcdir)/kdump/Makefile
|
||||
|
||||
# vmcore-dmesg (read dmesg from a vmcore)
|
||||
#
|
||||
-include $(srcdir)/vmcore-dmesg/Makefile
|
||||
+#include $(srcdir)/vmcore-dmesg/Makefile
|
||||
|
||||
#
|
||||
# kexec_test (test program)
|
||||
#
|
||||
-include $(srcdir)/kexec_test/Makefile
|
||||
+#include $(srcdir)/kexec_test/Makefile
|
||||
|
||||
SPEC=$(PACKAGE_NAME).spec
|
||||
GENERATED_SRCS:= $(SPEC)
|
Loading…
x
Reference in New Issue
Block a user