mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-20 01:06:18 +00:00
kexec: update to 2.0.20
Fix issue with kexec failing to load the target kernel when building with musl-cross-make
This commit is contained in:
parent
8e4b10922b
commit
23d0126407
@ -1,10 +1,10 @@
|
||||
modules-$(CONFIG_KEXEC) += kexec
|
||||
|
||||
kexec_version := 2.0.16
|
||||
kexec_version := 2.0.20
|
||||
kexec_dir := kexec-tools-$(kexec_version)
|
||||
kexec_tar := kexec-tools-$(kexec_version).tar.gz
|
||||
kexec_url := https://kernel.org/pub/linux/utils/kernel/kexec/$(kexec_tar)
|
||||
kexec_hash := cf17fc99bf77c9b39f06ee88ac0e86d0349c4a0c3f8214a3cc78eece872f6f3a
|
||||
kexec_hash := cb16d79818e0c9de3bb3e33ede5677c34a1d28c646379c7ab44e0faa3eb57a16
|
||||
|
||||
kexec_configure := ./configure \
|
||||
$(CROSS_TOOLS) \
|
||||
|
@ -1,89 +0,0 @@
|
||||
diff -u --recursive clean/kexec-tools-2.0.16/Makefile.in kexec-tools-2.0.16/Makefile.in
|
||||
--- clean/kexec-tools-2.0.16/Makefile.in 2016-12-09 04:42:06.000000000 -0500
|
||||
+++ kexec-tools-2.0.16/Makefile.in 2018-02-28 05:39:20.461000000 -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)
|
||||
diff -u --recursive clean/kexec-tools-2.0.16/include/config.h kexec-tools-2.0.16/include/config.h
|
||||
--- clean/kexec-tools-2.0.16/include/config.h 2017-11-20 04:17:12.000000000 -0500
|
||||
+++ kexec-tools-2.0.16/include/config.h 2018-02-28 05:39:22.420000000 -0500
|
||||
@@ -17,7 +17,7 @@
|
||||
/* #undef HAVE_LIBXENCTRL */
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
-/* #undef HAVE_LIBZ */
|
||||
+#define HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
diff -u --recursive clean/kexec-tools-2.0.16/kexec/kexec.c kexec-tools-2.0.16/kexec/kexec.c
|
||||
--- clean/kexec-tools-2.0.16/kexec/kexec.c 2017-03-02 04:45:46.000000000 -0500
|
||||
+++ kexec-tools-2.0.16/kexec/kexec.c 2018-02-28 10:40:01.662000000 -0500
|
||||
@@ -794,6 +794,27 @@
|
||||
if (sort_segments(&info) < 0) {
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+#if 1
|
||||
+ // force segment 0 to have memsz == bufsz
|
||||
+ // so that it won't overwrite EBDA
|
||||
+ if (info.segment[0].mem == 0)
|
||||
+ {
|
||||
+ if (kexec_debug)
|
||||
+ printf("hack ebda into segment 0!\n");
|
||||
+
|
||||
+ uint8_t * ebda = calloc(1, info.segment[0].memsz);
|
||||
+ memcpy(ebda, info.segment[0].buf, info.segment[0].bufsz);
|
||||
+ info.segment[0].bufsz = info.segment[0].memsz;
|
||||
+ info.segment[0].buf = ebda;
|
||||
+
|
||||
+ // install some default EBDA values that are off scale,
|
||||
+ // which will force Xen to use the multiboot info
|
||||
+ *(uint16_t*)(ebda + 0x40e) = 0xFFFF; // segment
|
||||
+ *(uint16_t*)(ebda + 0x413) = 0xFFFF; // size
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
/* if purgatory is loaded update it */
|
||||
update_purgatory(&info);
|
||||
if (entry)
|
||||
diff -u --recursive clean/kexec-tools-2.0.16/purgatory/Makefile kexec-tools-2.0.16/purgatory/Makefile
|
||||
--- clean/kexec-tools-2.0.16/purgatory/Makefile 2017-01-31 06:23:48.000000000 -0500
|
||||
+++ kexec-tools-2.0.16/purgatory/Makefile 2018-02-28 05:39:20.461000000 -0500
|
||||
@@ -44,7 +44,6 @@
|
||||
mkdir -p $(@D)
|
||||
$(COMPILE.c) -o $@ $^
|
||||
|
||||
-$(PURGATORY): CC=$(TARGET_CC)
|
||||
$(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
|
||||
$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
|
||||
-Os -fno-builtin -ffreestanding \
|
||||
diff -u --recursive clean/kexec-tools-2.0.16/util/Makefile kexec-tools-2.0.16/util/Makefile
|
||||
--- clean/kexec-tools-2.0.16/util/Makefile 2010-07-29 05:22:16.000000000 -0400
|
||||
+++ kexec-tools-2.0.16/util/Makefile 2018-02-28 05:39:20.461000000 -0500
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
$(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
|
||||
@$(MKDIR) -p $(@D)
|
||||
- $(LINK.o) $(CFLAGS) -o $@ $^
|
||||
+ $(BUILD_CC) $(BUILD_CFLAGS) -o $@ $^
|
||||
|
||||
$(BIN_TO_HEX): CC=$(BUILD_CC)
|
||||
$(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)
|
76
patches/kexec-2.0.20.patch
Normal file
76
patches/kexec-2.0.20.patch
Normal file
@ -0,0 +1,76 @@
|
||||
diff --git ./Makefile.in ./Makefile.in
|
||||
index fb01134..bf1973e 100644
|
||||
--- ./Makefile.in
|
||||
+++ ./Makefile.in
|
||||
@@ -157,12 +157,12 @@ include $(srcdir)/kexec/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)
|
||||
diff --git ./kexec/kexec.c ./kexec/kexec.c
|
||||
index bc6ab3d..b82725b 100644
|
||||
--- ./kexec/kexec.c
|
||||
+++ ./kexec/kexec.c
|
||||
@@ -805,6 +805,27 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
|
||||
if (sort_segments(&info) < 0) {
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+#if 1
|
||||
+ // force segment 0 to have memsz == bufsz
|
||||
+ // so that it won't overwrite EBDA
|
||||
+ if (info.segment[0].mem == 0)
|
||||
+ {
|
||||
+ if (kexec_debug)
|
||||
+ printf("hack ebda into segment 0!\n");
|
||||
+
|
||||
+ uint8_t * ebda = calloc(1, info.segment[0].memsz);
|
||||
+ memcpy(ebda, info.segment[0].buf, info.segment[0].bufsz);
|
||||
+ info.segment[0].bufsz = info.segment[0].memsz;
|
||||
+ info.segment[0].buf = ebda;
|
||||
+
|
||||
+ // install some default EBDA values that are off scale,
|
||||
+ // which will force Xen to use the multiboot info
|
||||
+ *(uint16_t*)(ebda + 0x40e) = 0xFFFF; // segment
|
||||
+ *(uint16_t*)(ebda + 0x413) = 0xFFFF; // size
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
/* if purgatory is loaded update it */
|
||||
update_purgatory(&info);
|
||||
if (entry)
|
||||
diff --git ./purgatory/Makefile ./purgatory/Makefile
|
||||
index 2dd6c47..2de8f07 100644
|
||||
--- ./purgatory/Makefile
|
||||
+++ ./purgatory/Makefile
|
||||
@@ -44,7 +44,6 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
|
||||
mkdir -p $(@D)
|
||||
$(COMPILE.c) -o $@ $^
|
||||
|
||||
-$(PURGATORY): CC=$(TARGET_CC)
|
||||
$(PURGATORY): CFLAGS=$(PURGATORY_EXTRA_CFLAGS) \
|
||||
$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
|
||||
-Os -fno-builtin -ffreestanding \
|
||||
diff --git ./util/Makefile ./util/Makefile
|
||||
index 948ee63..833a897 100644
|
||||
--- ./util/Makefile
|
||||
+++ ./util/Makefile
|
||||
@@ -2,7 +2,7 @@ BIN_TO_HEX:= bin/bin-to-hex
|
||||
|
||||
$(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
|
||||
@$(MKDIR) -p $(@D)
|
||||
- $(LINK.o) $(CFLAGS) -o $@ $^
|
||||
+ $(BUILD_CC) $(BUILD_CFLAGS) -o $@ $^
|
||||
|
||||
$(BIN_TO_HEX): CC=$(BUILD_CC)
|
||||
$(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)
|
Loading…
x
Reference in New Issue
Block a user