From 3e7c766f84a6cf840eb5dd56331d73b032b3d3ee742736dd75a35fe43227912e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 14:13:50 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main kexec-tools revision 50db5a46eaadf5ecb7b573355aa00474 --- .gitattributes | 23 + ...b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch | 112 ++ kexec-dont-use-kexec_file_load-on-xen.patch | 59 + kexec-load.service | 12 + kexec-tools-2.0.27.tar.sign | Bin 0 -> 566 bytes kexec-tools-2.0.27.tar.xz | 3 + kexec-tools-SYS_getrandom.patch | 64 + kexec-tools-disable-test.patch | 26 + kexec-tools-riscv64.patch | 1512 ++++++++++++++++ kexec-tools-rpmlintrc | 16 + kexec-tools-vmcoreinfo-in-xen.patch | 79 + kexec-tools.changes | 1546 +++++++++++++++++ kexec-tools.keyring | 76 + kexec-tools.spec | 128 ++ 14 files changed, 3656 insertions(+) create mode 100644 .gitattributes create mode 100644 6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch create mode 100644 kexec-dont-use-kexec_file_load-on-xen.patch create mode 100644 kexec-load.service create mode 100644 kexec-tools-2.0.27.tar.sign create mode 100644 kexec-tools-2.0.27.tar.xz create mode 100644 kexec-tools-SYS_getrandom.patch create mode 100644 kexec-tools-disable-test.patch create mode 100644 kexec-tools-riscv64.patch create mode 100644 kexec-tools-rpmlintrc create mode 100644 kexec-tools-vmcoreinfo-in-xen.patch create mode 100644 kexec-tools.changes create mode 100644 kexec-tools.keyring create mode 100644 kexec-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch b/6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch new file mode 100644 index 0000000..b2f2e98 --- /dev/null +++ b/6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch @@ -0,0 +1,112 @@ +From 6419b008fde783fd0cc2cc266bd1c9cf35e99a0e Mon Sep 17 00:00:00 2001 +From: Julien Olivain +Date: Sat, 23 Sep 2023 18:46:06 +0200 +Subject: kexec: provide a memfd_create() wrapper if not present in libc + +Commit 714fa115 "kexec/arm64: Simplify the code for zImage" introduced +a use of the memfd_create() system call, included in version +kexec-tools v2.0.27. + +This system call was introduced in kernel commit [1], first included +in kernel v3.17 (released on 2014-10-05). + +The memfd_create() glibc wrapper function was added much later in +commit [2], first included in glibc version 2.27 (released on +2018-02-01). + +This direct use memfd_create() introduced a requirement on +Kernel >= 3.17 and glibc >= 2.27. + +There is old toolchains like [3] for example (which ships gcc 7.3.1, +glibc 2.25 and includes kernel v4.10 headers), that can still be used +to build newer kernels. Even if such toolchains can be seen as +outdated, they are is still claimed as supported by recent kernel. +For example, Kernel v6.5.5 has a requirement on gcc version 5.1 and +greater. See [4]. + +Moreover, kexec-tools <= 2.0.26 could be compiled using recent +toolchains with alternative libc (e.g. uclibc-ng, musl) which are not +providing the memfd_create() wrapper. + +When compiling kexec-tools v2.0.27 with a toolchain not providing the +memfd_create() syscall wrapper, the compilation fail with message: + + kexec/kexec.c: In function 'copybuf_memfd': + kexec/kexec.c:645:7: warning: implicit declaration of function 'memfd_create'; did you mean 'SYS_memfd_create'? [-Wimplicit-function-declaration] + fd = memfd_create("kernel", MFD_ALLOW_SEALING); + ^~~~~~~~~~~~ + SYS_memfd_create + kexec/kexec.c:645:30: error: 'MFD_ALLOW_SEALING' undeclared (first use in this function); did you mean '_PC_ALLOC_SIZE_MIN'? + fd = memfd_create("kernel", MFD_ALLOW_SEALING); + ^~~~~~~~~~~~~~~~~ + _PC_ALLOC_SIZE_MIN + +In order to let kexec-tools compile in a wider range of configurations, +this commit adds a memfd_create() function check in autoconf configure +script, and adds a system call wrapper which will be used if the +function is not available. With this commit, the environment +requirement is relaxed to only kernel >= v3.17. + +Note: this issue was found in kexec-tools integration in Buildroot [5] +using the command "utils/test-pkg -a -p kexec", which tests many +toolchain/arch combinations. + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9183df25fe7b194563db3fec6dc3202a5855839c +[2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=59d2cbb1fe4b8601d5cbd359c3806973eab6c62d +[3] https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz +[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/process/changes.rst?h=v6.5.5#n32 +[5] https://buildroot.org/ + +Signed-off-by: Julien Olivain +Signed-off-by: Simon Horman +--- + configure.ac | 3 +++ + kexec/kexec.c | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 352eefee..602de79b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -208,6 +208,9 @@ if test "$ac_cv_lib_xenctrl_xc_kexec_load" = yes ; then + AC_MSG_NOTICE([The kexec_status call is not available])) + fi + ++dnl Check if libc has the memfd_create() syscall wrapper ++AC_CHECK_FUNCS([memfd_create]) ++ + dnl ---Sanity checks + if test "$CC" = "no"; then AC_MSG_ERROR([cc not found]); fi + if test "$CPP" = "no"; then AC_MSG_ERROR([cpp not found]); fi +diff --git a/kexec/kexec.c b/kexec/kexec.c +index fdb4c984..08edfca2 100644 +--- a/kexec/kexec.c ++++ b/kexec/kexec.c +@@ -31,6 +31,10 @@ + #include + #include + #include ++#ifndef HAVE_MEMFD_CREATE ++#include ++#include ++#endif + #include + #include + #include +@@ -640,6 +644,13 @@ char *slurp_decompress_file(const char *filename, off_t *r_size) + return kernel_buf; + } + ++#ifndef HAVE_MEMFD_CREATE ++static int memfd_create(const char *name, unsigned int flags) ++{ ++ return syscall(SYS_memfd_create, name, flags); ++} ++#endif ++ + static int copybuf_memfd(const char *kernel_buf, size_t size) + { + int fd, count; +-- +cgit + diff --git a/kexec-dont-use-kexec_file_load-on-xen.patch b/kexec-dont-use-kexec_file_load-on-xen.patch new file mode 100644 index 0000000..5c18f79 --- /dev/null +++ b/kexec-dont-use-kexec_file_load-on-xen.patch @@ -0,0 +1,59 @@ +From: Jiri Bohac +Subject: [PATCH] kexec: dont use kexec_file_load on XEN +Patch-mainline: 94fbe64fb22d61726ca0c0996987574b6c783c19 +References: bsc#1218590 + +Since commit 29fe5067ed07 ("kexec: make -a the default") +kexec tries the kexec_file_load syscall first and only falls back to kexec_load on +selected error codes. + +This effectively breaks kexec on XEN, unless -c is pecified to force the kexec_load +syscall. + +The XEN-specific functions (xen_kexec_load / xen_kexec_unload) are only called +from my_load / k_unload, i.e. the kexec_load code path. + +With -p (panic kernel) kexec_file_load on XEN fails with -EADDRNOTAVAIL (crash +kernel reservation is ignored by the kernel on XEN), which is not in the list +of return codes that cause the fallback to kexec_file. + +Without -p kexec_file_load actualy leads to a kernel oops on v6.4.0 +(needs to be dubugged separately). + +Signed-off-by: Jiri Bohac +Fixes: 29fe5067ed07 ("kexec: make -a the default") +--- + kexec/kexec.8 | 1 + + kexec/kexec.c | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/kexec/kexec.8 b/kexec/kexec.8 +index b969cea..9e995fe 100644 +--- a/kexec/kexec.8 ++++ b/kexec/kexec.8 +@@ -162,6 +162,7 @@ Specify that the new kernel is of this + .TP + .BI \-s\ (\-\-kexec-file-syscall) + Specify that the new KEXEC_FILE_LOAD syscall should be used exclusively. ++Ignored on XEN. + .TP + .BI \-c\ (\-\-kexec-syscall) + Specify that the old KEXEC_LOAD syscall should be used exclusively. +diff --git a/kexec/kexec.c b/kexec/kexec.c +index 08edfca..9d0ec46 100644 +--- a/kexec/kexec.c ++++ b/kexec/kexec.c +@@ -1685,6 +1685,10 @@ int main(int argc, char *argv[]) + } + } + } ++ if (xen_present()) { ++ do_kexec_file_syscall = 0; ++ do_kexec_fallback = 0; ++ } + if (do_kexec_file_syscall) { + if (do_load_jump_back_helper && !do_kexec_fallback) + die("--load-jump-back-helper not supported with kexec_file_load\n"); +-- +2.43.0 + diff --git a/kexec-load.service b/kexec-load.service new file mode 100644 index 0000000..e6667c7 --- /dev/null +++ b/kexec-load.service @@ -0,0 +1,12 @@ +[Unit] +Description=load default kernel into the current kernel +Documentation=man:kexec(8) +DefaultDependencies=no +Before=shutdown.target umount.target final.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/kexec-bootloader + +[Install] +WantedBy=kexec.target diff --git a/kexec-tools-2.0.27.tar.sign b/kexec-tools-2.0.27.tar.sign new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..097cd18d65c90245dd288295b43da8e48ba8a28dac6d23b3f0f5be24f1ce28a5 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SW*e79j-UeA%J(tiu0G{&I!a&tz$8H&4C=0%Yt`eEcs@##=YZMi8AV}?k=)cQ zegdHZPE^Lf_^j<{CxhJU$wi62xKt98L?{sJdH?Y&As3*3lsAKxc~Vrt=tl*NJthrM zcEWR_i=XnQZB!)dBD)MSP_ZafS|K)5P2cJFj-ow(EY?eh^FdQ-_7cPY^TA#Oq!a?? z`r6Uh3rQ^+7Hi&9hwCr)&J_uq{iTTQgLEVt9;ST|7$+DK{U2<`Z)z=@UoK6_zlWC; zKb>7h$E^qn*a7C7%Q$ya-93=UPq)WoR9Tg>x)+Fy^^ro~cQBkzk1u3Zpmbq_F$-hM zyN8Pb;=nfpUSY2|gU~Kf2|OJ3s$+f~A+|!Z6lguBOLCcKjS}@G0*TqsdK+!)0TWzS EZh##JGXMYp literal 0 HcmV?d00001 diff --git a/kexec-tools-2.0.27.tar.xz b/kexec-tools-2.0.27.tar.xz new file mode 100644 index 0000000..ee552a7 --- /dev/null +++ b/kexec-tools-2.0.27.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38d78bcfa33a88928324b57dc81f50c1dfc279eede45e80957ca18f4e84b8187 +size 308540 diff --git a/kexec-tools-SYS_getrandom.patch b/kexec-tools-SYS_getrandom.patch new file mode 100644 index 0000000..8e831b2 --- /dev/null +++ b/kexec-tools-SYS_getrandom.patch @@ -0,0 +1,64 @@ +From: Petr Tesarik +Subject: Define SYS_getrandom if needed +Upstream: never, build fix for SLE12 + +SLE12 did not provide a definition for SYS_getrandom. + +Signed-off-by: Petr Tesarik +--- + configure.ac | 1 + + kexec/arch/arm64/kexec-arm64.c | 5 +++++ + kexec/arch/i386/x86-linux-setup.c | 11 ++++++++++- + 3 files changed, 16 insertions(+), 1 deletion(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -203,6 +203,7 @@ if test "$with_xen" = dl ; then + AC_MSG_NOTICE([Xen support disabled]))]) + fi + ++AC_CHECK_HEADERS([sys/random.h]) + dnl Check for the Xen kexec_status hypercall - reachable from --with-xen=yes|dl + if test "$ac_cv_lib_xenctrl_xc_kexec_load" = yes ; then + AC_CHECK_LIB(xenctrl, xc_kexec_status, +--- a/kexec/arch/arm64/kexec-arm64.c ++++ b/kexec/arch/arm64/kexec-arm64.c +@@ -34,6 +34,11 @@ + #include "mem_regions.h" + #include "arch/options.h" + ++#ifndef __NR_getrandom ++#define __NR_getrandom 278 ++__SYSCALL(__NR_getrandom, sys_getrandom) ++#endif ++ + #define ROOT_NODE_ADDR_CELLS_DEFAULT 1 + #define ROOT_NODE_SIZE_CELLS_DEFAULT 1 + +--- a/kexec/arch/i386/x86-linux-setup.c ++++ b/kexec/arch/i386/x86-linux-setup.c +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -38,6 +37,16 @@ + #include "x86-linux-setup.h" + #include "../../kexec/kexec-syscall.h" + ++#ifdef HAVE_SYS_RANDOM_H ++#include ++#else ++#include ++static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) ++{ ++ return syscall(SYS_getrandom, buf, buflen, flags); ++} ++#endif ++ + #ifndef VIDEO_CAPABILITY_64BIT_BASE + #define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */ + #endif diff --git a/kexec-tools-disable-test.patch b/kexec-tools-disable-test.patch new file mode 100644 index 0000000..23a3699 --- /dev/null +++ b/kexec-tools-disable-test.patch @@ -0,0 +1,26 @@ +From: Tony Jones +Subject: Disable kexec_test + +Disable kexec_test. It is not required in released product (matching latest +Fedora). Also one less file for usr_merge + +--- + Makefile.in | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/Makefile.in ++++ b/Makefile.in +@@ -173,8 +173,11 @@ PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_N + PGSRCS:=$(foreach s, $(GENERATED_SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s)) + + MAN_PAGES:=$(KEXEC_MANPAGE) $(VMCORE_DMESG_MANPAGE) +-BINARIES_i386:=$(KEXEC_TEST) +-BINARIES_x86_64:=$(KEXEC_TEST) ++# Dont' build kexec_test ++#BINARIES_i386:=$(KEXEC_TEST) ++#BINARIES_x86_64:=$(KEXEC_TEST) ++BINARIES_i386:= ++BINARIES_x86_64:= + BINARIES:=$(KEXEC) $(VMCORE_DMESG) $(BINARIES_$(ARCH)) + + UNINSTALL_KDUMP = $(sbindir)/kdump diff --git a/kexec-tools-riscv64.patch b/kexec-tools-riscv64.patch new file mode 100644 index 0000000..d232420 --- /dev/null +++ b/kexec-tools-riscv64.patch @@ -0,0 +1,1512 @@ +From 379d8f3ef3219bd400c7893d0a262b079c1de408 Mon Sep 17 00:00:00 2001 +From: Nick Kossifidis +Date: Tue, 5 Oct 2021 15:01:19 +0300 +Subject: [PATCH] RISC-V: Add support for riscv kexec/kdump on kexec-tools + +This patch adds support for loading the ELF kernel image. It parses +the current/provided device tree to determine the system's memory +layout, and /proc/iomem for the various kernel segments. + +Tested on Qemu's rv64 virt machine. + +Signed-off-by: Nick Kossifidis +--- + configure.ac | 3 + + include/elf.h | 3 +- + kexec/Makefile | 1 + + kexec/arch/riscv/Makefile | 35 ++ + kexec/arch/riscv/crashdump-riscv.c | 140 ++++++++ + kexec/arch/riscv/include/arch/options.h | 43 +++ + kexec/arch/riscv/kexec-elf-riscv.c | 255 ++++++++++++++ + kexec/arch/riscv/kexec-riscv.c | 364 +++++++++++++++++++ + kexec/arch/riscv/kexec-riscv.h | 32 ++ + kexec/dt-ops.c | 442 +++++++++++++++++++++++- + kexec/dt-ops.h | 7 + + kexec/kexec-syscall.h | 4 + + purgatory/Makefile | 1 + + purgatory/arch/riscv/Makefile | 7 + + 14 files changed, 1335 insertions(+), 2 deletions(-) + create mode 100644 kexec/arch/riscv/Makefile + create mode 100644 kexec/arch/riscv/crashdump-riscv.c + create mode 100644 kexec/arch/riscv/include/arch/options.h + create mode 100644 kexec/arch/riscv/kexec-elf-riscv.c + create mode 100644 kexec/arch/riscv/kexec-riscv.c + create mode 100644 kexec/arch/riscv/kexec-riscv.h + create mode 100644 purgatory/arch/riscv/Makefile + +diff --git a/configure.ac b/configure.ac +index 51439f1..6ee6c30 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -58,6 +58,9 @@ case $target_cpu in + loongarch*) + ARCH="loongarch" + ;; ++ riscv32|riscv64 ) ++ ARCH="riscv" ++ ;; + * ) + AC_MSG_ERROR([unsupported architecture $target_cpu]) + ;; +diff --git a/include/elf.h b/include/elf.h +index b7677a2..123f167 100644 +--- a/include/elf.h ++++ b/include/elf.h +@@ -259,6 +259,7 @@ typedef struct + #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ + #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ + #define EM_AARCH64 183 /* ARM AARCH64 */ ++#define EM_RISCV 243 /* RISC-V */ + #define EM_LOONGARCH 258 /* Loongson Loongarch*/ + #define EM_NUM 184 + +diff --git a/kexec/Makefile b/kexec/Makefile +index e69e309..ca17831 100644 +--- a/kexec/Makefile ++++ b/kexec/Makefile +@@ -88,6 +88,7 @@ include $(srcdir)/kexec/arch/mips/Makefile + include $(srcdir)/kexec/arch/cris/Makefile + include $(srcdir)/kexec/arch/ppc/Makefile + include $(srcdir)/kexec/arch/ppc64/Makefile ++include $(srcdir)/kexec/arch/riscv/Makefile + include $(srcdir)/kexec/arch/s390/Makefile + include $(srcdir)/kexec/arch/sh/Makefile + include $(srcdir)/kexec/arch/x86_64/Makefile +diff --git a/kexec/arch/riscv/Makefile b/kexec/arch/riscv/Makefile +new file mode 100644 +index 0000000..f26cc90 +--- /dev/null ++++ b/kexec/arch/riscv/Makefile +@@ -0,0 +1,35 @@ ++# ++# kexec riscv ++# ++riscv_KEXEC_SRCS = kexec/arch/riscv/kexec-riscv.c ++riscv_KEXEC_SRCS += kexec/arch/riscv/kexec-elf-riscv.c ++riscv_KEXEC_SRCS += kexec/arch/riscv/crashdump-riscv.c ++ ++riscv_MEM_REGIONS = kexec/mem_regions.c ++ ++riscv_DT_OPS += kexec/dt-ops.c ++ ++riscv_ARCH_REUSE_INITRD = ++ ++riscv_CPPFLAGS += -I $(srcdir)/kexec/ ++ ++dist += kexec/arch/riscv/Makefile $(riscv_KEXEC_SRCS) \ ++ kexec/arch/riscv/kexec-riscv.h \ ++ kexec/arch/riscv/include/arch/options.h ++ ++ifdef HAVE_LIBFDT ++ ++LIBS += -lfdt ++ ++else ++ ++include $(srcdir)/kexec/libfdt/Makefile.libfdt ++ ++libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%) ++ ++riscv_CPPFLAGS += -I$(srcdir)/kexec/libfdt ++ ++riscv_KEXEC_SRCS += $(libfdt_SRCS) ++ ++endif ++ +diff --git a/kexec/arch/riscv/crashdump-riscv.c b/kexec/arch/riscv/crashdump-riscv.c +new file mode 100644 +index 0000000..7fc041e +--- /dev/null ++++ b/kexec/arch/riscv/crashdump-riscv.c +@@ -0,0 +1,140 @@ ++#include ++#include ++#include ++ ++#include "kexec.h" ++#include "crashdump.h" ++#include "kexec-elf.h" ++#include "mem_regions.h" ++ ++static struct crash_elf_info elf_info = { ++#if __riscv_xlen == 64 ++ .class = ELFCLASS64, ++#else ++ .class = ELFCLASS32, ++#endif ++ .data = ELFDATA2LSB, ++ .machine = EM_RISCV, ++}; ++ ++static struct memory_ranges crash_mem_ranges = {0}; ++struct memory_range elfcorehdr_mem = {0}; ++ ++static unsigned long long get_page_offset(struct kexec_info *info) ++{ ++ unsigned long long vaddr_off = 0; ++ unsigned long long page_size = sysconf(_SC_PAGESIZE); ++ unsigned long long init_start = get_kernel_sym("_sinittext"); ++ ++ /* ++ * Begining of init section is aligned to page size ++ */ ++ vaddr_off = init_start - page_size; ++ ++ return vaddr_off; ++} ++ ++int load_elfcorehdr(struct kexec_info *info) ++{ ++ struct memory_range crashkern_range = {0}; ++ struct memory_range *ranges = NULL; ++ unsigned long start = 0; ++ unsigned long end = 0; ++ unsigned long buf_size = 0; ++ unsigned long elfcorehdr_addr = 0; ++ void* buf = NULL; ++ int i = 0; ++ int ret = 0; ++ ++ ret = parse_iomem_single("Kernel code\n", &start, NULL); ++ if (ret) { ++ fprintf(stderr, "Cannot determine kernel physical base addr\n"); ++ return -EINVAL; ++ } ++ elf_info.kern_paddr_start = start; ++ ++ ret = parse_iomem_single("Kernel bss\n", NULL, &end); ++ if (ret) { ++ fprintf(stderr, "Cannot determine kernel physical bss addr\n"); ++ return -EINVAL; ++ } ++ elf_info.kern_paddr_start = start; ++ elf_info.kern_size = end - start; ++ ++ elf_info.kern_vaddr_start = get_kernel_sym("_text"); ++ if (!elf_info.kern_vaddr_start) { ++ elf_info.kern_vaddr_start = UINT64_MAX; ++ } ++ ++ elf_info.page_offset = get_page_offset(info); ++ dbgprintf("page_offset: %016llx\n", elf_info.page_offset); ++ ++ ret = parse_iomem_single("Crash kernel\n", &start, &end); ++ if (ret) { ++ fprintf(stderr, "Cannot determine kernel physical bss addr\n"); ++ return -EINVAL; ++ } ++ crashkern_range.start = start; ++ crashkern_range.end = end; ++ crashkern_range.type = RANGE_RESERVED; ++ ++ ranges = info->memory_range; ++ for (i = 0; i < info->memory_ranges; i++) { ++ ret = mem_regions_alloc_and_add(&crash_mem_ranges, ++ ranges[i].start, ++ ranges[i].end - ranges[i].start, ++ ranges[i].type); ++ if (ret ) { ++ fprintf(stderr, "Could not create crash_mem_ranges\n"); ++ return ret; ++ } ++ } ++ ++ ret = mem_regions_alloc_and_exclude(&crash_mem_ranges, ++ &crashkern_range); ++ if (ret) { ++ fprintf(stderr, "Could not exclude crashkern_range\n"); ++ return ret; ++ } ++ ++#if __riscv_xlen == 64 ++ crash_create_elf64_headers(info, &elf_info, crash_mem_ranges.ranges, ++ crash_mem_ranges.size, &buf, &buf_size, ++ ELF_CORE_HEADER_ALIGN); ++ ++#else ++ crash_create_elf32_headers(info, &elf_info, crash_mem_ranges.ranges, ++ crash_mem_ranges.size, &buf, &buf_size, ++ ELF_CORE_HEADER_ALIGN); ++#endif ++ ++ ++ elfcorehdr_addr = add_buffer_phys_virt(info, buf, buf_size, ++ buf_size, 0, ++ crashkern_range.start, ++ crashkern_range.end, ++ -1, 0); ++ ++ elfcorehdr_mem.start = elfcorehdr_addr; ++ elfcorehdr_mem.end = elfcorehdr_addr + buf_size - 1; ++ ++ dbgprintf("%s: elfcorehdr 0x%llx-0x%llx\n", __func__, ++ elfcorehdr_mem.start, elfcorehdr_mem.end); ++ ++ return 0; ++} ++ ++int is_crashkernel_mem_reserved(void) ++{ ++ uint64_t start = 0; ++ uint64_t end = 0; ++ ++ return parse_iomem_single("Crash kernel\n", &start, &end) == 0 ? ++ (start != end) : 0; ++} ++ ++int get_crash_kernel_load_range(uint64_t *start, uint64_t *end) ++{ ++ return parse_iomem_single("Crash kernel\n", start, end); ++} ++ +diff --git a/kexec/arch/riscv/include/arch/options.h b/kexec/arch/riscv/include/arch/options.h +new file mode 100644 +index 0000000..7c24184 +--- /dev/null ++++ b/kexec/arch/riscv/include/arch/options.h +@@ -0,0 +1,43 @@ ++#ifndef KEXEC_ARCH_RISCV_OPTIONS_H ++#define KEXEC_ARCH_RISCV_OPTIONS_H ++ ++#define OPT_APPEND ((OPT_MAX)+0) ++#define OPT_DTB ((OPT_MAX)+1) ++#define OPT_INITRD ((OPT_MAX)+2) ++#define OPT_CMDLINE ((OPT_MAX)+3) ++#define OPT_REUSE_CMDLINE ((OPT_MAX)+4) ++#define OPT_ARCH_MAX ((OPT_MAX)+5) ++ ++/* Options relevant to the architecture (excluding loader-specific ones), ++ * in this case none: ++ */ ++#define KEXEC_ARCH_OPTIONS \ ++ KEXEC_OPTIONS \ ++ { "append", 1, 0, OPT_APPEND}, \ ++ { "dtb", 1, 0, OPT_DTB }, \ ++ { "initrd", 1, 0, OPT_INITRD }, \ ++ { "command-line", 1, 0, OPT_CMDLINE}, \ ++ { "reuse-cmdline", 0, NULL, OPT_REUSE_CMDLINE }, \ ++ ++ ++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" ++ ++/* The following two #defines list ALL of the options added by all of the ++ * architecture's loaders. ++ * o main() uses this complete list to scan for its options, ignoring ++ * arch-specific/loader-specific ones. ++ * o Then, arch_process_options() uses this complete list to scan for its ++ * options, ignoring general/loader-specific ones. ++ * o Then, the file_type[n].load re-scans for options, using ++ * KEXEC_ARCH_OPTIONS plus its loader-specific options subset. ++ * Any unrecognised options cause an error here. ++ * ++ * This is done so that main()'s/arch_process_options()'s getopt_long() calls ++ * don't choose a kernel filename from random arguments to options they don't ++ * recognise -- as they now recognise (if not act upon) all possible options. ++ */ ++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS ++ ++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ++ ++#endif /* KEXEC_ARCH_RISCV_OPTIONS_H */ +diff --git a/kexec/arch/riscv/kexec-elf-riscv.c b/kexec/arch/riscv/kexec-elf-riscv.c +new file mode 100644 +index 0000000..f3c011c +--- /dev/null ++++ b/kexec/arch/riscv/kexec-elf-riscv.c +@@ -0,0 +1,255 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright (C) 2019 FORTH-ICS/CARV ++ * Nick Kossifidis ++ */ ++ ++#include "kexec.h" ++#include "dt-ops.h" /* For dtb_set/clear_initrd() */ ++#include /* For ELF header handling */ ++#include /* For EFBIG/EINVAL */ ++#include /* For getpagesize() */ ++#include "kexec-syscall.h" /* For KEXEC_ON_CRASH */ ++#include "kexec-riscv.h" ++ ++ ++/*********\ ++* HELPERS * ++\*********/ ++ ++/* ++ * Go through the available physical memory regions and ++ * find one that can hold an image of the specified size. ++ * Note: This is called after get_memory_ranges so ++ * info->memory_range[] should be populated. Also note that ++ * memory ranges are sorted, so we'll return the first region ++ * that's big enough for holding the image. ++ */ ++static int elf_riscv_find_pbase(struct kexec_info *info, off_t *addr, ++ off_t size) ++{ ++ int i = 0; ++ off_t start = 0; ++ off_t end = 0; ++ int ret = 0; ++ ++ /* ++ * If this image is for a crash kernel, use the region ++ * the primary kernel has already reserved for us. ++ */ ++ if (info->kexec_flags & KEXEC_ON_CRASH) { ++ ret = get_crash_kernel_load_range((uint64_t *) &start, ++ (uint64_t *) &end); ++ if (!ret) { ++ /* ++ * Kernel should be aligned to the nearest ++ * hugepage (2MB for RV64, 4MB for RV32). ++ */ ++#if __riscv_xlen == 64 ++ start = _ALIGN_UP(start, 0x200000); ++#else ++ start = _ALIGN_UP(start, 0x400000); ++#endif ++ if (end > start && ((end - start) >= size)) { ++ *addr = start; ++ return 0; ++ } ++ ++ return -EFBIG; ++ } else ++ return ENOCRASHKERNEL; ++ } ++ ++ for (i = 0; i < info->memory_ranges; i++) { ++ if (info->memory_range[i].type != RANGE_RAM) ++ continue; ++ ++ start = info->memory_range[i].start; ++ end = info->memory_range[i].end; ++ ++#if __riscv_xlen == 64 ++ start = _ALIGN_UP(start, 0x200000); ++#else ++ start = _ALIGN_UP(start, 0x400000); ++#endif ++ ++ if (end > start && ((end - start) >= size)) { ++ *addr = start; ++ return 0; ++ } ++ } ++ ++ return -EFBIG; ++} ++ ++/**************\ ++* ENTRY POINTS * ++\**************/ ++ ++int elf_riscv_probe(const char *buf, off_t len) ++{ ++ struct mem_ehdr ehdr = {0}; ++ int ret = 0; ++ ++ ret = build_elf_exec_info(buf, len, &ehdr, 0); ++ if (ret < 0) ++ goto cleanup; ++ ++ if (ehdr.e_machine != EM_RISCV) { ++ fprintf(stderr, "Not for this architecture.\n"); ++ ret = -EINVAL; ++ goto cleanup; ++ } ++ ++ ret = 0; ++ ++ cleanup: ++ free_elf_info(&ehdr); ++ return ret; ++} ++ ++void elf_riscv_usage(void) ++{ ++} ++ ++int elf_riscv_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info) ++{ ++ struct mem_ehdr ehdr = {0}; ++ struct mem_phdr *phdr = NULL; ++ off_t new_base_addr = 0; ++ off_t kernel_size = 0; ++ off_t page_size = getpagesize(); ++ off_t max_addr = 0; ++ off_t old_base_addr = 0; ++ off_t old_start_addr = 0; ++ int i = 0; ++ int ret = 0; ++ ++ if (info->file_mode) { ++ fprintf(stderr, "kexec_file not supported on this " ++ "architecture\n"); ++ return -EINVAL; ++ } ++ ++ /* Parse the ELF file */ ++ ret = build_elf_exec_info(buf, len, &ehdr, 0); ++ if (ret < 0) { ++ fprintf(stderr, "ELF exec parse failed\n"); ++ return -EINVAL; ++ } ++ ++ max_addr = elf_max_addr(&ehdr); ++ old_base_addr = max_addr; ++ old_start_addr = max_addr; ++ ++ /* ++ * Get the memory footprint, base physical ++ * and start address of the ELF image ++ */ ++ for (i = 0; i < ehdr.e_phnum; i++) { ++ phdr = &ehdr.e_phdr[i]; ++ if (phdr->p_type != PT_LOAD) ++ continue; ++ ++ /* ++ * Note: According to ELF spec the loadable regions ++ * are sorted on p_vaddr, not p_paddr. ++ */ ++ if (old_base_addr > phdr->p_paddr) ++ old_base_addr = phdr->p_paddr; ++ ++ if (phdr->p_vaddr == ehdr.e_entry || ++ phdr->p_paddr == ehdr.e_entry) ++ old_start_addr = phdr->p_paddr; ++ ++ kernel_size += _ALIGN_UP(phdr->p_memsz, page_size); ++ } ++ ++ if (old_base_addr == max_addr || kernel_size == 0) { ++ fprintf(stderr, "No loadable segments present on the " ++ "provided ELF image\n"); ++ return -EINVAL; ++ } ++ ++ if (old_start_addr == max_addr) { ++ fprintf(stderr, "Could not find the entry point address of " ++ "provided ELF image\n"); ++ return -EINVAL; ++ } ++ ++ dbgprintf("Got ELF with total memsz %luKB\n" ++ "Base paddr: 0x%lX, start_addr: 0x%lX\n", ++ kernel_size / 1024, old_base_addr, old_start_addr); ++ ++ /* Get a continuous physical region that can hold the kernel */ ++ ret = elf_riscv_find_pbase(info, &new_base_addr, kernel_size); ++ if (ret < 0) { ++ fprintf(stderr, "Could not find a memory region for the " ++ "provided ELF image\n"); ++ return ret; ++ } ++ ++ dbgprintf("New base paddr for the ELF: 0x%lX\n", new_base_addr); ++ ++ /* Re-set the base physical address of the ELF */ ++ for (i = 0; i < ehdr.e_phnum; i++) { ++ phdr = &ehdr.e_phdr[i]; ++ if (phdr->p_type != PT_LOAD) ++ continue; ++ ++ phdr->p_paddr -= old_base_addr; ++ phdr->p_paddr += new_base_addr; ++ } ++ ++ /* Re-set the entry point address */ ++ ehdr.e_entry = (old_start_addr - old_base_addr) + new_base_addr; ++ info->entry = (void *) ehdr.e_entry; ++ dbgprintf("New entry point for the ELF: 0x%llX\n", ehdr.e_entry); ++ ++ ++ /* Load the ELF executable */ ++ ret = elf_exec_load(&ehdr, info); ++ if (ret < 0) { ++ fprintf(stderr, "ELF exec load failed\n"); ++ return ret; ++ } ++ ++ ret = load_extra_segments(info, new_base_addr, ++ kernel_size, max_addr); ++ return ret; ++} ++ ++ ++/*******\ ++* STUBS * ++\*******/ ++ ++int machine_verify_elf_rel(struct mem_ehdr *ehdr) ++{ ++ if (ehdr->ei_data != ELFDATA2LSB) ++ return 0; ++#if __riscv_xlen == 64 ++ if (ehdr->ei_class != ELFCLASS64) ++#else ++ if (ehdr->ei_class != ELFCLASS32) ++#endif ++ return 0; ++ if (ehdr->e_machine != EM_RISCV) ++ return 0; ++ return 1; ++} ++ ++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), ++ struct mem_sym *UNUSED(sym), ++ unsigned long r_type, ++ void *UNUSED(location), ++ unsigned long UNUSED(address), ++ unsigned long UNUSED(value)) ++{ ++ switch (r_type) { ++ default: ++ die("Unknown rela relocation: %lu\n", r_type); ++ break; ++ } ++} +diff --git a/kexec/arch/riscv/kexec-riscv.c b/kexec/arch/riscv/kexec-riscv.c +new file mode 100644 +index 0000000..d05c47d +--- /dev/null ++++ b/kexec/arch/riscv/kexec-riscv.c +@@ -0,0 +1,364 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright (C) 2019 FORTH-ICS/CARV ++ * Nick Kossifidis ++ */ ++ ++#include "kexec-syscall.h" /* For KEXEC_ARCH_RISCV */ ++#include "kexec.h" /* For OPT_MAX and concat_cmdline() */ ++#include "mem_regions.h" /* For mem_regions_sort() */ ++#include "dt-ops.h" /* For dtb_set_bootargs() */ ++#include /* For KEXEC_ARCH_OPTIONS */ ++#include /* For struct option */ ++#include /* For stat() and struct stat */ ++#include /* For free() */ ++#include /* For EINVAL */ ++#include /* For DeviceTree handling */ ++#include "kexec-riscv.h" ++ ++const struct arch_map_entry arches[] = { ++ { "riscv32", KEXEC_ARCH_RISCV }, ++ { "riscv64", KEXEC_ARCH_RISCV }, ++ { NULL, 0 }, ++}; ++ ++ ++struct file_type file_type[] = { ++ {"elf-riscv", elf_riscv_probe, elf_riscv_load, elf_riscv_usage}, ++}; ++int file_types = sizeof(file_type) / sizeof(file_type[0]); ++ ++static const char riscv_opts_usage[] = ++" --append=STRING Append STRING to the kernel command line.\n" ++" --dtb=FILE Use FILE as the device tree blob.\n" ++" --initrd=FILE Use FILE as the kernel initial ramdisk.\n" ++" --cmdline=STRING Use STRING as the kernel's command line.\n" ++" --reuse-cmdline Use kernel command line from running system.\n"; ++ ++static struct riscv_opts arch_options = {0}; ++static struct fdt_image provided_fdt = {0}; ++static struct memory_ranges sysmem_ranges = {0}; ++ ++/****************\ ++* COMMON HELPERS * ++\****************/ ++ ++int load_extra_segments(struct kexec_info *info, uint64_t kernel_base, ++ uint64_t kernel_size, uint64_t max_addr) ++{ ++ struct fdt_image *fdt = arch_options.fdt; ++ char *initrd_buf = NULL; ++ off_t initrd_size = 0; ++ uint64_t initrd_base = 0; ++ uint64_t start = 0; ++ uint64_t end = 0; ++ uint64_t min_usable = kernel_base + kernel_size; ++ uint64_t max_usable = max_addr; ++ int ret = 0; ++ ++ /* Prepare the device tree */ ++ if (info->kexec_flags & KEXEC_ON_CRASH) { ++ ret = load_elfcorehdr(info); ++ if (ret) { ++ fprintf(stderr, "Couldn't create elfcorehdr\n"); ++ return ret; ++ } ++ ++ ret = dtb_add_range_property(&fdt->buf, &fdt->size, ++ elfcorehdr_mem.start, elfcorehdr_mem.end, ++ "chosen", "linux,elfcorehdr"); ++ if (ret) { ++ fprintf(stderr, "Couldn't add elfcorehdr to fdt\n"); ++ return ret; ++ } ++ ++ ret = get_crash_kernel_load_range(&start, &end); ++ if (ret) { ++ fprintf(stderr, "Couldn't get crashkenel region\n"); ++ return ret; ++ } ++ ++ ret = dtb_add_range_property(&fdt->buf, &fdt->size, start, end, ++ "memory", "linux,usable-memory"); ++ if (ret) { ++ fprintf(stderr, "Couldn't add usable-memory to fdt\n"); ++ return ret; ++ } ++ ++ max_usable = end; ++ } else { ++ /* ++ * Make sure we remove elfcorehdr and usable-memory ++ * when switching from crash kernel to a normal one. ++ */ ++ dtb_delete_property(fdt->buf, "chosen", "linux,elfcorehdr"); ++ dtb_delete_property(fdt->buf, "memory", "linux,usable-memory"); ++ } ++ ++ /* Do we need to include an initrd image ? */ ++ if (!arch_options.initrd_path && !arch_options.initrd_end) ++ dtb_clear_initrd(&fdt->buf, &fdt->size); ++ else if (arch_options.initrd_path) { ++ if (arch_options.initrd_end) ++ fprintf(stderr, "Warning: An initrd image was provided" ++ ", will ignore reuseinitrd\n"); ++ ++ initrd_buf = slurp_file(arch_options.initrd_path, ++ &initrd_size); ++ if (!initrd_buf) { ++ fprintf(stderr, "Couldn't read provided initrd\n"); ++ return -EINVAL; ++ } ++ ++ initrd_base = add_buffer_phys_virt(info, initrd_buf, ++ initrd_size, ++ initrd_size, 0, ++ min_usable, ++ max_usable, -1, 0); ++ ++ dtb_set_initrd(&fdt->buf, &fdt->size, initrd_base, ++ initrd_base + initrd_size); ++ ++ dbgprintf("Base addr for initrd image: 0x%lX\n", initrd_base); ++ min_usable = initrd_base; ++ } ++ ++ /* Add device tree */ ++ add_buffer_phys_virt(info, fdt->buf, fdt->size, fdt->size, 0, ++ min_usable, max_usable, -1, 0); ++ ++ return 0; ++} ++ ++ ++/**************\ ++* ENTRY POINTS * ++\**************/ ++ ++void arch_usage(void) ++{ ++ printf(riscv_opts_usage); ++} ++ ++int arch_process_options(int argc, char **argv) ++{ ++ static const struct option options[] = { ++ KEXEC_ARCH_OPTIONS ++ { 0 }, ++ }; ++ static const char short_options[] = KEXEC_ARCH_OPT_STR; ++ struct stat st = {0}; ++ char *append = NULL; ++ char *cmdline = NULL; ++ void *tmp = NULL; ++ off_t tmp_size = 0; ++ int opt = 0; ++ int ret = 0; ++ ++ while ((opt = getopt_long(argc, argv, short_options, ++ options, 0)) != -1) { ++ switch (opt) { ++ case OPT_APPEND: ++ append = optarg; ++ break; ++ case OPT_CMDLINE: ++ if (cmdline) ++ fprintf(stderr, ++ "Warning: Kernel's cmdline " ++ "set twice !\n"); ++ cmdline = optarg; ++ break; ++ case OPT_REUSE_CMDLINE: ++ if (cmdline) ++ fprintf(stderr, ++ "Warning: Kernel's cmdline " ++ "set twice !\n"); ++ cmdline = get_command_line(); ++ break; ++ case OPT_DTB: ++ ret = stat(optarg, &st); ++ if (ret) { ++ fprintf(stderr, ++ "Could not find the provided dtb !\n"); ++ return -EINVAL; ++ } ++ arch_options.fdt_path = optarg; ++ break; ++ case OPT_INITRD: ++ ret = stat(optarg, &st); ++ if (ret) { ++ fprintf(stderr, ++ "Could not find the provided " ++ "initrd image !\n"); ++ return -EINVAL; ++ } ++ arch_options.initrd_path = optarg; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ /* Handle Kernel's command line */ ++ if (append && !cmdline) ++ fprintf(stderr, "Warning: No cmdline provided, " ++ "using append string as cmdline\n"); ++ if (!append && !cmdline) ++ fprintf(stderr, "Warning: No cmdline or append string " ++ "provided\n"); ++ ++ if (append || cmdline) ++ /* ++ * Note that this also handles the case where "cmdline" ++ * or "append" is NULL. ++ */ ++ arch_options.cmdline = concat_cmdline(cmdline, append); ++ ++ /* Handle FDT image */ ++ if (!arch_options.fdt_path) { ++ ret = stat("/sys/firmware/fdt", &st); ++ if (ret) { ++ fprintf(stderr, "No dtb provided and " ++ "/sys/firmware/fdt is not present\n"); ++ return -EINVAL; ++ } ++ fprintf(stderr, "Warning: No dtb provided, " ++ "using /sys/firmware/fdt\n"); ++ arch_options.fdt_path = "/sys/firmware/fdt"; ++ } ++ ++ tmp = slurp_file(arch_options.fdt_path, &tmp_size); ++ if (!tmp) { ++ fprintf(stderr, "Couldn't read provided fdt\n"); ++ return -EINVAL; ++ } ++ ++ ret = fdt_check_header(tmp); ++ if (ret) { ++ fprintf(stderr, "Got an ivalid fdt image !\n"); ++ free(tmp); ++ return -EINVAL; ++ } ++ provided_fdt.buf = tmp; ++ provided_fdt.size = tmp_size; ++ ++ if (arch_options.cmdline) { ++ ret = dtb_set_bootargs(&provided_fdt.buf, &provided_fdt.size, ++ arch_options.cmdline); ++ if (ret < 0) { ++ fprintf(stderr, "Could not set bootargs on " ++ "the fdt image\n"); ++ return ret; ++ } ++ } ++ ++ arch_options.fdt = &provided_fdt; ++ ++ return 0; ++} ++ ++/* ++ * This one is called after arch_process_options so we already ++ * have an fdt image in place. ++ */ ++void arch_reuse_initrd(void) ++{ ++ const uint32_t *prop32 = NULL; ++ uint32_t addr_cells = 0; ++ const void *prop = 0; ++ int prop_size = 0; ++ uint64_t initrd_start = 0; ++ uint64_t initrd_end = 0; ++ int chosen_offset = 0; ++ struct fdt_image *fdt = &provided_fdt; ++ ++ chosen_offset = fdt_subnode_offset(fdt->buf, 0, "chosen"); ++ if (chosen_offset < 0) { ++ fprintf(stderr, "No /chosen node found on fdt image " ++ "unable to reuse initrd\n"); ++ return; ++ } ++ ++ prop32 = fdt_getprop(fdt->buf, 0, "#address-cells", NULL); ++ if (!prop32) { ++ fprintf(stderr, "No #address-cells property on root node\n"); ++ return; ++ } ++ addr_cells = be32_to_cpu(*prop32); ++ ++ prop = fdt_getprop(fdt->buf, chosen_offset, ++ "linux,initrd-start", &prop_size); ++ if (!prop) { ++ fprintf(stderr, "Could not get linux,initrd-start\n"); ++ return; ++ } ++ dtb_extract_int_property(&initrd_start, prop, addr_cells); ++ ++ prop = fdt_getprop(fdt->buf, chosen_offset, ++ "linux,initrd-end", &prop_size); ++ if (!prop) { ++ fprintf(stderr, "Could not get linux,initrd-end\n"); ++ return; ++ } ++ dtb_extract_int_property(&initrd_end, prop, addr_cells); ++ ++ arch_options.initrd_start = initrd_start; ++ arch_options.initrd_end = initrd_end; ++ dbgprintf("initrd_start: 0x%lX, initrd_end: 0x%lX\n", ++ initrd_start, initrd_end); ++ ++} ++ ++int get_memory_ranges(struct memory_range **range, int *num_ranges, ++ unsigned long kexec_flags) ++{ ++ const struct fdt_image *fdt = &provided_fdt; ++ struct memory_ranges *extra_ranges = NULL; ++ int i = 0; ++ int ret = 0; ++ ++ if (arch_options.initrd_start && arch_options.initrd_end) { ++ int initrd_size = arch_options.initrd_end - arch_options.initrd_start; ++ dbgprintf("Marking current intird image as reserved\n"); ++ ret = mem_regions_alloc_and_add(extra_ranges, ++ arch_options.initrd_start, ++ initrd_size, ++ RANGE_RESERVED); ++ if (ret) ++ return ret; ++ } ++ ++ ret = dtb_get_memory_ranges(fdt->buf, &sysmem_ranges, extra_ranges); ++ if (ret) { ++ fprintf(stderr, "Could not get memory ranges from device tree (%i) !\n", ret); ++ return ret; ++ } ++ ++ *range = sysmem_ranges.ranges; ++ *num_ranges = sysmem_ranges.size; ++ ++ dbgprintf("Memory regions:\n"); ++ for (i = 0; i < sysmem_ranges.size; i++) { ++ dbgprintf("\t0x%llx - 0x%llx : %s (%i)\n", ++ sysmem_ranges.ranges[i].start, ++ sysmem_ranges.ranges[i].end, ++ sysmem_ranges.ranges[i].type == RANGE_RESERVED ? ++ "RANGE_RESERVED" : "RANGE_RAM", ++ sysmem_ranges.ranges[i].type); ++ } ++ ++ return 0; ++} ++ ++/*******\ ++* STUBS * ++\*******/ ++ ++int arch_compat_trampoline(struct kexec_info *UNUSED(info)) ++{ ++ return 0; ++} ++ ++void arch_update_purgatory(struct kexec_info *UNUSED(info)) ++{ ++} +diff --git a/kexec/arch/riscv/kexec-riscv.h b/kexec/arch/riscv/kexec-riscv.h +new file mode 100644 +index 0000000..c4323a6 +--- /dev/null ++++ b/kexec/arch/riscv/kexec-riscv.h +@@ -0,0 +1,32 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright (C) 2019 FORTH-ICS/CARV ++ * Nick Kossifidis ++ */ ++ ++struct fdt_image { ++ char *buf; ++ off_t size; ++}; ++ ++struct riscv_opts { ++ char *cmdline; ++ char *fdt_path; ++ char *initrd_path; ++ uint64_t initrd_start; ++ uint64_t initrd_end; ++ struct fdt_image *fdt; ++}; ++ ++/* crashdump-riscv.c */ ++extern struct memory_range elfcorehdr_mem; ++int load_elfcorehdr(struct kexec_info *info); ++ ++/* kexec-riscv.c */ ++int load_extra_segments(struct kexec_info *info, uint64_t kernel_base, ++ uint64_t kernel_size, uint64_t max_addr); ++ ++int elf_riscv_probe(const char *buf, off_t len); ++void elf_riscv_usage(void); ++int elf_riscv_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info); +diff --git a/kexec/dt-ops.c b/kexec/dt-ops.c +index 0a96b75..3e285ab 100644 +--- a/kexec/dt-ops.c ++++ b/kexec/dt-ops.c +@@ -4,9 +4,11 @@ + #include + #include + #include ++#include + + #include "kexec.h" + #include "dt-ops.h" ++#include "mem_regions.h" + + static const char n_chosen[] = "chosen"; + +@@ -95,7 +97,7 @@ int dtb_set_property(char **dtb, off_t *dtb_size, const char *node, + + strcpy(new_node, "/"); + strcat(new_node, node); +- ++ + nodeoffset = fdt_path_offset(new_dtb, new_node); + + if (nodeoffset == -FDT_ERR_NOTFOUND) { +@@ -174,3 +176,441 @@ int dtb_delete_property(char *dtb, const char *node, const char *prop) + free(new_node); + return result; + } ++ ++static int dtb_get_num_cells(char *dtb, int nodeoffset, uint32_t *addr_cells, ++ uint32_t *size_cells, bool recursive) ++{ ++ const uint32_t *prop32 = NULL; ++ int curr_offset = nodeoffset; ++ int prop_len = 0; ++ *addr_cells = 0; ++ *size_cells = 0; ++ ++ do { ++ prop32 = fdt_getprop(dtb, curr_offset, "#address-cells", &prop_len); ++ curr_offset = fdt_parent_offset(dtb, curr_offset); ++ } while (!prop32 && prop_len == -FDT_ERR_NOTFOUND && recursive); ++ ++ if (!prop32) { ++ dbgprintf("Could not get #address-cells property for %s (%s)\n", ++ fdt_get_name(dtb, nodeoffset, NULL), fdt_strerror(nodeoffset)); ++ return -EINVAL; ++ } ++ *addr_cells = fdt32_to_cpu(*prop32); ++ ++ curr_offset = nodeoffset; ++ do { ++ prop32 = fdt_getprop(dtb, curr_offset, "#size-cells", &prop_len); ++ curr_offset = fdt_parent_offset(dtb, curr_offset); ++ } while (!prop32 && prop_len == -FDT_ERR_NOTFOUND && recursive); ++ ++ if (!prop32) { ++ dbgprintf("Could not get #size-cells property for %s (%s)\n", ++ fdt_get_name(dtb, nodeoffset, NULL), fdt_strerror(nodeoffset)); ++ return -EINVAL; ++ } ++ *size_cells = fdt32_to_cpu(*prop32); ++ ++ dbgprintf("%s: #address-cells:%d #size-cells:%d\n", ++ fdt_get_name(dtb, nodeoffset, NULL), *addr_cells, *size_cells); ++ ++ return 0; ++} ++ ++void dtb_extract_int_property(uint64_t *val, const void *buf, uint32_t cells) ++{ ++ const uint32_t *prop32 = NULL; ++ const uint64_t *prop64 = NULL; ++ ++ if (cells == 1) { ++ prop32 = (const uint32_t *) buf; ++ *val = (uint64_t) be32_to_cpu(*prop32); ++ } else { ++ /* Skip any leading cells */ ++ prop64 = (const uint64_t *) (uint32_t *)buf + cells - 2; ++ *val = (uint64_t) be64_to_cpu(*prop64); ++ } ++} ++ ++void dtb_fill_int_property(void *buf, uint64_t val, uint32_t cells) ++{ ++ uint32_t prop32 = 0; ++ uint64_t prop64 = 0; ++ ++ if (cells == 1) { ++ prop32 = cpu_to_fdt32((uint32_t) val); ++ memcpy(buf, &prop32, sizeof(uint32_t)); ++ } else { ++ prop64 = cpu_to_fdt64(val); ++ /* Skip any leading cells */ ++ memcpy((uint64_t *)(uint32_t *)buf + cells - 2, ++ &prop64, sizeof(uint64_t)); ++ } ++} ++ ++int dtb_add_range_property(char **dtb, off_t *dtb_size, uint64_t start, uint64_t end, ++ const char *parent, const char *name) ++{ ++ uint32_t addr_cells = 0; ++ uint32_t size_cells = 0; ++ char *nodepath = NULL; ++ void *prop = NULL; ++ int nodeoffset = 0; ++ int prop_size = 0; ++ int ret = 0; ++ ++ nodepath = malloc(strlen("/") + strlen(parent) + 1); ++ if (!nodepath) { ++ dbgprintf("%s: malloc failed\n", __func__); ++ return -ENOMEM; ++ } ++ ++ strcpy(nodepath, "/"); ++ strcat(nodepath, parent); ++ ++ nodeoffset = fdt_path_offset(*dtb, nodepath); ++ if (nodeoffset < 0) { ++ dbgprintf("%s: fdt_path_offset(%s) failed: %s\n", __func__, ++ nodepath, fdt_strerror(nodeoffset)); ++ free(nodepath); ++ return nodeoffset; ++ } ++ free(nodepath); ++ ++ ret = dtb_get_num_cells(*dtb, nodeoffset, &addr_cells, &size_cells, true); ++ if (ret < 0) ++ return ret; ++ ++ /* Can the range fit with the given address/size cells ? */ ++ if ((addr_cells == 1) && (start >= (1ULL << 32))) ++ return -EINVAL; ++ ++ if ((size_cells == 1) && ((end - start + 1) >= (1ULL << 32))) ++ return -EINVAL; ++ ++ prop_size = sizeof(uint32_t) * (addr_cells + size_cells); ++ prop = malloc(prop_size); ++ ++ dtb_fill_int_property(prop, start, addr_cells); ++ dtb_fill_int_property((void *)((uint32_t *)prop + addr_cells), ++ end - start + 1, size_cells); ++ ++ /* Add by node path name */ ++ return dtb_set_property(dtb, dtb_size, parent, name, prop, prop_size); ++} ++ ++/************************\ ++* MEMORY RANGES HANDLING * ++\************************/ ++ ++static int dtb_add_memory_range(struct memory_ranges *mem_ranges, uint64_t start, ++ uint64_t end, unsigned type) ++{ ++ struct memory_range this_region = {0}; ++ struct memory_range *ranges = mem_ranges->ranges; ++ int i = 0; ++ int ret = 0; ++ ++ if (start == end) { ++ dbgprintf("Ignoring empty region\n"); ++ return -EINVAL; ++ } ++ ++ /* Check if we are adding an existing region */ ++ for (i = 0; i < mem_ranges->size; i++) { ++ if (start == ranges[i].start && end == ranges[i].end) { ++ dbgprintf("Duplicate: 0x%lx - 0x%lx\n", start, end); ++ ++ if (type == ranges[i].type) ++ return 0; ++ else if (type == RANGE_RESERVED) { ++ ranges[i].type = RANGE_RESERVED; ++ return 0; ++ } ++ ++ dbgprintf("Conflicting types for region: 0x%lx - 0x%lx\n", ++ start, end); ++ return -EINVAL; ++ } ++ } ++ ++ /* ++ * Reserved regions may be part of an existing /memory ++ * region and shouldn't overlap according to spec, so ++ * since we add /memory regions first, we can exclude ++ * reserved regions here from the existing /memory regions ++ * included in ranges[], so that we don't have the same ++ * region twice. ++ */ ++ if (type == RANGE_RESERVED) { ++ this_region.start = start; ++ this_region.end = end - 1; ++ this_region.type = type; ++ ret = mem_regions_exclude(mem_ranges, &this_region); ++ if (ret) ++ return ret; ++ } ++ ++ ret = mem_regions_alloc_and_add(mem_ranges, start, ++ end - start, type); ++ ++ return ret; ++} ++ ++static int dtb_add_memory_region(char *dtb, int nodeoffset, ++ struct memory_ranges *mem_ranges, int type) ++{ ++ uint32_t root_addr_cells = 0; ++ uint32_t root_size_cells = 0; ++ uint64_t addr = 0; ++ uint64_t size = 0; ++ const char *reg = NULL; ++ int prop_size = 0; ++ int offset = 0; ++ int entry_size = 0; ++ int num_entries = 0; ++ int ret = 0; ++ ++ /* ++ * Get address-cells and size-cells properties (according to ++ * binding spec these are the same as in the root node) ++ */ ++ ret = dtb_get_num_cells(dtb, 0, &root_addr_cells, &root_size_cells, false); ++ if (ret < 0) { ++ dbgprintf("No address/size cells on root node !\n"); ++ return ret; ++ } ++ ++ /* ++ * Parse the reg array, acording to device tree spec it includes ++ * an arbitary number of
pairs ++ */ ++ entry_size = (root_addr_cells + root_size_cells) * sizeof(uint32_t); ++ reg = fdt_getprop(dtb, nodeoffset, "reg", &prop_size); ++ if (!reg) { ++ dbgprintf("Warning: Malformed memory region with no reg property (%s) !\n", ++ fdt_get_name(dtb, nodeoffset, NULL)); ++ return -EINVAL; ++ } ++ ++ num_entries = prop_size / entry_size; ++ dbgprintf("Got region with %i entries: %s\n", num_entries, ++ fdt_get_name(dtb, nodeoffset, NULL)); ++ ++ for (num_entries--; num_entries >= 0; num_entries--) { ++ offset = num_entries * entry_size; ++ ++ dtb_extract_int_property(&addr, reg + offset, ++ root_addr_cells); ++ offset += root_addr_cells * sizeof(uint32_t); ++ ++ dtb_extract_int_property(&size, reg + offset, ++ root_size_cells); ++ ++ ret = dtb_add_memory_range(mem_ranges, addr, ++ addr + size, type); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int dtb_parse_memory_reservations_table(char *dtb, struct memory_ranges *mem_ranges) ++{ ++ int total_memrsrv = 0; ++ uint64_t addr = 0; ++ uint64_t size = 0; ++ int ret = 0; ++ int i = 0; ++ ++ total_memrsrv = fdt_num_mem_rsv(dtb); ++ for (i = 0; i < total_memrsrv; i++) { ++ ret = fdt_get_mem_rsv(dtb, i, &addr, &size); ++ if (ret) ++ continue; ++ ret = dtb_add_memory_range(mem_ranges, addr, addr + size - 1, ++ RANGE_RESERVED); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int dtb_get_reserved_memory_node(char *dtb) ++{ ++ uint32_t root_addr_cells = 0; ++ uint32_t root_size_cells = 0; ++ uint32_t addr_cells = 0; ++ uint32_t size_cells = 0; ++ int prop_size = 0; ++ int nodeoffset = 0; ++ int ret = 0; ++ ++ /* Get address / size cells from root node */ ++ ret = dtb_get_num_cells(dtb, 0, &root_addr_cells, &root_size_cells, false); ++ if (ret < 0) { ++ dbgprintf("No address/size cells on root node !\n"); ++ return ret; ++ } ++ ++ /* This calls fdt_next_node internaly */ ++ nodeoffset = fdt_subnode_offset(dtb, 0, "reserved-memory"); ++ if (nodeoffset == -FDT_ERR_NOTFOUND) { ++ return nodeoffset; ++ } else if (nodeoffset < 0) { ++ dbgprintf("Error while looking for reserved-memory: %s\n", ++ fdt_strerror(nodeoffset)); ++ return nodeoffset; ++ } ++ ++ /* Look for the ranges property */ ++ fdt_getprop(dtb, nodeoffset, "ranges", &prop_size); ++ if (prop_size < 0) { ++ fprintf(stderr, "Malformed reserved-memory node (no ranges property) !\n"); ++ return -EINVAL; ++ } ++ ++ /* Verify address-cells / size-cells */ ++ ret = dtb_get_num_cells(dtb, nodeoffset, &addr_cells, &size_cells, false); ++ if (ret < 0) { ++ dbgprintf("No address/size cells property on reserved-memory node\n"); ++ return ret; ++ } ++ ++ if (addr_cells != root_addr_cells) { ++ fprintf(stderr, "Invalid #address-cells property on reserved-memory node\n"); ++ return -EINVAL; ++ } ++ ++ if (size_cells != root_size_cells) { ++ fprintf(stderr, "Invalid #size-cells property on reserved-memory node\n"); ++ return -EINVAL; ++ ++ } ++ ++ return nodeoffset; ++} ++ ++static int dtb_parse_reserved_memory_node(char *dtb, struct memory_ranges *mem_ranges) ++{ ++ int nodeoffset = 0; ++ int node_depth = 0; ++ int parent_depth = 0; ++ int ret = 0; ++ ++ nodeoffset = dtb_get_reserved_memory_node(dtb); ++ if (nodeoffset == -FDT_ERR_NOTFOUND) ++ return 0; ++ else if (nodeoffset < 0) ++ return nodeoffset; ++ ++ /* Got the parent node, check for sub-nodes */ ++ ++ /* fdt_next_node() increases or decreases depth */ ++ node_depth = parent_depth; ++ nodeoffset = fdt_next_node(dtb, nodeoffset, &node_depth); ++ if (ret < 0) { ++ dbgprintf("Unable to get next node: %s\n", ++ fdt_strerror(ret)); ++ return -EINVAL; ++ } ++ ++ while (node_depth != parent_depth) { ++ ++ ret = dtb_add_memory_region(dtb, nodeoffset, ++ mem_ranges, RANGE_RESERVED); ++ if (ret) ++ return ret; ++ ++ nodeoffset = fdt_next_node(dtb, nodeoffset, &node_depth); ++ if (ret < 0) { ++ dbgprintf("Unable to get next node: %s\n", ++ fdt_strerror(ret)); ++ return -EINVAL; ++ } ++ } ++ ++ return 0; ++} ++ ++static int dtb_parse_memory_nodes(char *dtb, struct memory_ranges *mem_ranges) ++{ ++ int nodeoffset = 0; ++ int num_regions = 0; ++ const char* dev_type = 0; ++ int prop_size = 0; ++ int ret = 0; ++ ++ for (; ; num_regions++) { ++ nodeoffset = fdt_subnode_offset(dtb, nodeoffset, ++ "memory"); ++ if (nodeoffset < 0) ++ break; ++ ++ dbgprintf("Got memory node at depth: %i\n", fdt_node_depth(dtb, nodeoffset)); ++ ++ /* Look for the device_type property */ ++ dev_type = fdt_getprop(dtb, nodeoffset, "device_type", &prop_size); ++ if (prop_size < 0) { ++ fprintf(stderr, "Malformed /memory node (no device-type property) !\n"); ++ return -EINVAL; ++ } ++ ++ if (strncmp(dev_type, "memory", prop_size)) { ++ dbgprintf("Got unknown dev_type property: %s\n", dev_type); ++ continue; ++ } ++ ++ ret = dtb_add_memory_region(dtb, nodeoffset, mem_ranges, RANGE_RAM); ++ if (ret) ++ return ret; ++ } ++ ++ if (!num_regions) { ++ dbgprintf("Malformed dtb, no /memory nodes present !\n"); ++ return -EINVAL; ++ } ++ ++ dbgprintf("Got %i /memory nodes\n", num_regions); ++ ++ return 0; ++} ++ ++int dtb_get_memory_ranges(char *dtb, struct memory_ranges *mem_ranges, struct memory_ranges *extra_ranges) ++{ ++ int i = 0; ++ int ret = 0; ++ ++ /* Fill mem_ranges[] by parsing the device tree */ ++ ret = dtb_parse_memory_nodes(dtb, mem_ranges); ++ if (ret) ++ return ret; ++ ++ ret = dtb_parse_memory_reservations_table(dtb, mem_ranges); ++ if (ret) ++ return ret; ++ ++ ret = dtb_parse_reserved_memory_node(dtb, mem_ranges); ++ if (ret) ++ return ret; ++ ++ /* Append any extra ranges provided by the caller (e.g. initrd) */ ++ for (i = 0; extra_ranges != NULL && i < extra_ranges->size; i++) { ++ dbgprintf("Adding extra range: 0x%llx - 0x%llx (%s)\n", ++ extra_ranges->ranges[i].start, ++ extra_ranges->ranges[i].end, ++ extra_ranges->ranges[i].type == RANGE_RESERVED ? ++ "RANGE_RESERVED" : "RANGE_RAM"); ++ ++ ret = dtb_add_memory_range(mem_ranges, extra_ranges->ranges[i].start, ++ extra_ranges->ranges[i].end, extra_ranges->ranges[i].type); ++ if (ret) ++ return ret; ++ } ++ ++ mem_regions_sort(mem_ranges); ++ ++ return 0; ++} +diff --git a/kexec/dt-ops.h b/kexec/dt-ops.h +index 03659ce..3014205 100644 +--- a/kexec/dt-ops.h ++++ b/kexec/dt-ops.h +@@ -11,4 +11,11 @@ int dtb_set_property(char **dtb, off_t *dtb_size, const char *node, + + int dtb_delete_property(char *dtb, const char *node, const char *prop); + ++void dtb_extract_int_property(uint64_t *val, const void *buf, uint32_t cells); ++void dtb_fill_int_property(void *buf, uint64_t val, uint32_t cells); ++int dtb_add_range_property(char **dtb, off_t *dtb_size, uint64_t start, uint64_t end, ++ const char *node, const char* parent); ++int dtb_get_memory_ranges(char *dtb, struct memory_ranges *mem_ranges, ++ struct memory_ranges *extra_ranges); ++ + #endif +diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h +index bea29d4..2e99e2b 100644 +--- a/kexec/kexec-syscall.h ++++ b/kexec/kexec-syscall.h +@@ -134,6 +134,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, + #define KEXEC_ARCH_MIPS_LE (10 << 16) + #define KEXEC_ARCH_MIPS ( 8 << 16) + #define KEXEC_ARCH_CRIS (76 << 16) ++#define KEXEC_ARCH_RISCV (243 << 16) + #define KEXEC_ARCH_LOONGARCH (258 << 16) + + #define KEXEC_MAX_SEGMENTS 16 +@@ -177,6 +178,9 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, + #if defined(__arm64__) + #define KEXEC_ARCH_NATIVE KEXEC_ARCH_ARM64 + #endif ++#if defined(__riscv__) || defined(__riscv) ++#define KEXEC_ARCH_NATIVE KEXEC_ARCH_RISCV ++#endif + #if defined(__loongarch__) + #define KEXEC_ARCH_NATIVE KEXEC_ARCH_LOONGARCH + #endif +diff --git a/purgatory/Makefile b/purgatory/Makefile +index 2dd6c47..0a9d1c1 100644 +--- a/purgatory/Makefile ++++ b/purgatory/Makefile +@@ -25,6 +25,7 @@ include $(srcdir)/purgatory/arch/ia64/Makefile + include $(srcdir)/purgatory/arch/mips/Makefile + include $(srcdir)/purgatory/arch/ppc/Makefile + include $(srcdir)/purgatory/arch/ppc64/Makefile ++include $(srcdir)/purgatory/arch/riscv/Makefile + include $(srcdir)/purgatory/arch/s390/Makefile + include $(srcdir)/purgatory/arch/sh/Makefile + include $(srcdir)/purgatory/arch/x86_64/Makefile +diff --git a/purgatory/arch/riscv/Makefile b/purgatory/arch/riscv/Makefile +new file mode 100644 +index 0000000..8bded71 +--- /dev/null ++++ b/purgatory/arch/riscv/Makefile +@@ -0,0 +1,7 @@ ++# ++# Purgatory riscv ++# ++ ++riscv_PURGATORY_SRCS = ++ ++dist += purgatory/arch/sh/Makefile $(riscv_PURGATORY_SRCS) +-- +2.33.0 + diff --git a/kexec-tools-rpmlintrc b/kexec-tools-rpmlintrc new file mode 100644 index 0000000..a8fe4a9 --- /dev/null +++ b/kexec-tools-rpmlintrc @@ -0,0 +1,16 @@ +# +# The name for the init script is correct. kexec-tools is no name +# for an init script. +addFilter(".*incoherent-init-script-name.*"); + +# +# $null is a valid dependency. +addFilter(".*init-script-undefined-dependency.*"); + +# +# It does not make any sense to stop the "service" kexec on removal. +# kexec is no service but an init script to run kexec when rebooting. +# Stopping it here would lead to a very unexpected behaviour on reboot. :) +addFilter(".*init-script-without-%stop_on_removal-preun.*"); + +# :mode=python: diff --git a/kexec-tools-vmcoreinfo-in-xen.patch b/kexec-tools-vmcoreinfo-in-xen.patch new file mode 100644 index 0000000..1a46c00 --- /dev/null +++ b/kexec-tools-vmcoreinfo-in-xen.patch @@ -0,0 +1,79 @@ +From: Petr Tesarik +Date: Thu, 5 Apr 2018 10:57:05 +0200 +Subject: Revert "kexec-tools: Read always one vmcoreinfo file" +References: bsc#1085626, bsc#951740 +Upstream: not yet, upstream wants to stay broken + +This reverts commit 455d79f57e9367e5c59093fd74798905bd5762fc. + +The explanation seems bogus. The file under /sys/kernel +refers to the Linux kernel VMCOREINFO note, while the +file under /sys/hypervisor refers to the Xen hypervisor +VMCOREINFO_XEN note. The former note contains information +about the Linux kernel. The latter contains information +about the Xen hypervisor. Both are needed to allow page +filtering in makedumpfile. + +Signed-off-by: Petr Tesarik + +--- + kexec/crashdump-elf.c | 33 ++++++++++++++++++++++++++------- + 1 file changed, 26 insertions(+), 7 deletions(-) + +--- a/kexec/crashdump-elf.c ++++ b/kexec/crashdump-elf.c +@@ -40,6 +40,8 @@ int FUNC(struct kexec_info *info, + uint64_t notes_addr, notes_len; + uint64_t vmcoreinfo_addr, vmcoreinfo_len; + int has_vmcoreinfo = 0; ++ uint64_t vmcoreinfo_addr_xen, vmcoreinfo_len_xen; ++ int has_vmcoreinfo_xen = 0; + int (*get_note_info)(int cpu, uint64_t *addr, uint64_t *len); + long int count_cpu; + +@@ -52,14 +54,16 @@ int FUNC(struct kexec_info *info, + return -1; + } + +- if (xen_present()) { +- if (!get_xen_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len)) +- has_vmcoreinfo = 1; +- } else +- if (!get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len)) +- has_vmcoreinfo = 1; ++ if (get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len) == 0) { ++ has_vmcoreinfo = 1; ++ } ++ ++ if (xen_present() && ++ get_xen_vmcoreinfo(&vmcoreinfo_addr_xen, &vmcoreinfo_len_xen) == 0) { ++ has_vmcoreinfo_xen = 1; ++ } + +- sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo) * sizeof(PHDR) + ++ sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo + has_vmcoreinfo_xen) * sizeof(PHDR) + + ranges * sizeof(PHDR); + + /* +@@ -178,6 +182,21 @@ int FUNC(struct kexec_info *info, + dbgprintf_phdr("vmcoreinfo header", phdr); + } + ++ if (has_vmcoreinfo_xen) { ++ phdr = (PHDR *) bufp; ++ bufp += sizeof(PHDR); ++ phdr->p_type = PT_NOTE; ++ phdr->p_flags = 0; ++ phdr->p_offset = phdr->p_paddr = vmcoreinfo_addr_xen; ++ phdr->p_vaddr = 0; ++ phdr->p_filesz = phdr->p_memsz = vmcoreinfo_len_xen; ++ /* Do we need any alignment of segments? */ ++ phdr->p_align = 0; ++ ++ (elf->e_phnum)++; ++ dbgprintf_phdr("vmcoreinfo_xen header", phdr); ++ } ++ + /* Setup an PT_LOAD type program header for the region where + * Kernel is mapped if elf_info->kern_size is non-zero. + */ diff --git a/kexec-tools.changes b/kexec-tools.changes new file mode 100644 index 0000000..e3a45b4 --- /dev/null +++ b/kexec-tools.changes @@ -0,0 +1,1546 @@ +------------------------------------------------------------------- +Thu Jan 25 17:38:17 UTC 2024 - Jiri Bohac + +- add kexec-dont-use-kexec_file_load-on-xen.patch: + kexec: don't use kexec_file_load on xen (bsc#1218590) + +------------------------------------------------------------------- +Tue Oct 24 11:11:11 UTC 2023 - olaf@aepfle.de + +- Fix build with old glibc with 6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch + +------------------------------------------------------------------- +Wed Sep 6 09:10:09 UTC 2023 - Petr Tesařík + +- update to 2.0.27: + * ppc64: add --reuse-cmdline parameter support + * kexec: make -a the default + * x86: add devicetree support + * ppc64: document elf-ppc64 options and --dt-no-old-root + * LoongArch: kdump: set up kernel image segment + * arm64: zboot support + +------------------------------------------------------------------- +Tue Aug 8 08:08:08 UTC 2023 - olaf@aepfle.de + +- Disable Xen support in ALP + +------------------------------------------------------------------- +Wed Jun 28 15:10:51 UTC 2023 - Michal Suchanek + +- Pull kexec-bootloader from perl-Bootloader, bump version so that + perl-Bootloader can obsolete kexec-tools containing kexec-bootloader + (bsc#1211082). + +------------------------------------------------------------------- +Tue Apr 4 04:04:04 UTC 2023 - olaf@aepfle.de + +- Update kexec-tools-SYS_getrandom.patch to fix build errors on + old x86_64 distributions + +------------------------------------------------------------------- +Thu Feb 23 15:01:24 UTC 2023 - Michal Suchanek + +- kexec-bootloader: Add -a argument to load using kexec_load_file() when available (boo#1202820). + +------------------------------------------------------------------- +Thu Feb 2 13:45:39 UTC 2023 - Petr Tesařík + +- update to 2.0.26: + * m68k: pass rng seed via BI_RNG_SEED + * workflow: update to checkout@v3 + * LoongArch: Remove redundant cmdline parameters when using --reuse-cmdline option + * LoongArch: Add purgatory framework code + * LoongArch: PE format image loading support + * LoongArch: Add kexec/kdump support + * config: Add LoongArch architecture support in config.guess and config.sub files + * ppc64: remove rma_top limit +- refresh kexec-tools-riscv64.patch. + +------------------------------------------------------------------- +Tue Dec 27 12:37:09 UTC 2022 - Ludwig Nussel + +- Replace transitional %usrmerged macro with regular version check (boo#1206798) + +------------------------------------------------------------------- +Tue Oct 4 19:05:14 UTC 2022 - Dirk Müller + +- add kexec-tools-riscv64.patch + +------------------------------------------------------------------- +Wed Aug 17 21:46:31 UTC 2022 - Dirk Müller + +- update to 2.0.25: + * kexec-tools: Remove duplicate ultoa() definitions and redefine it + * i386: pass rng seed via setup_data + * kexec-tools: mips: Pass initrd parameter via cmdline + * arm64/crashdump-arm64: increase CRASH_MAX_MEMORY_RANGES to 32k + +------------------------------------------------------------------- +Wed Apr 27 20:16:19 UTC 2022 - Dirk Müller + +- update to 2.0.24: + * arm64: fix static data relocations in machine_apply_elf_rel() + * kexec/elf: assign one to align if sh_addralign equals zero + * arm64/crashdump-arm64: explicit type conversion to suppress compiler warning + * arm64/kexec-arm64: add support for R_AARCH64_MOVW_UABS_G* rela + * arm64/kexec-arm64: use enum to organize the reloc type + * arm64/kexec-arm64: add support for R_AARCH64_LDST128_ABS_LO12_NC rela + * kexec-tools: fix leak FILE pointer. + * purgatory: do not enable vectorization automatically for purgatory compiling + * kexec-tools: Determine if the image is lzma commpressed + * util_lib/elf_info: harden parsing of printk buffer + * github: run apt-get update before installing packages + * kexec-xen: Allow xen_kexec_exec() to return in case of Live Update + * kexec-tools: print error if kexec_file_load fails + * kexec-tools: mips: Concatenate --reuse-cmdline and --append + * kexec-tools: mips: Add some debug info + * arm64: fix PAGE_OFFSET calc for flipped mm + * arm64: read VA_BITS from kcore for 52-bits VA kernel + * arm64/crashdump: unify routine to get page_offset + * arm64: make phys_offset signed + * s390: add support for --reuse-cmdline + * use slurp_proc_file() in get_command_line() + * add slurp_proc_file() + * s390: use KEXEC_ALL_OPTIONS + * s390: add variable command line size + * arm64: support more than one crash kernel regions + * s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel() + * arm64/crashdump: deduce paddr of _text based on kernel code size +- drop kexec-tools-print-error-if-kexec_file_load-fails.patch, + kexec-tools-remove-duplicate-ramdisk-definition.patch (upstream) +- add homepage url +- add gpg validation + +------------------------------------------------------------------- +Wed Apr 13 07:10:02 UTC 2022 - Petr Tesařík + +- kexec-tools-print-error-if-kexec_file_load-fails.patch: print + error if kexec_file_load fails (bsc#1197176). + +------------------------------------------------------------------- +Mon May 3 10:57:35 UTC 2021 - Petr Tesařík + +- Bump version to 2.0.21 +- Drop patches from upstream git: + * kexec-tools-video-capability.patch + +------------------------------------------------------------------- +Mon Apr 26 09:35:21 UTC 2021 - Petr Tesařík + +- kexec-tools-remove-duplicate-ramdisk-definition.patch: + Remove duplicate definition of ramdisk (fix ppc build). + +------------------------------------------------------------------- +Mon Apr 26 08:07:47 UTC 2021 - Petr Tesařík + +- Bump version to 2.0.21 +- Drop patches from upstream git: + * kexec-tools-add-variant-helper-functions.patch + * kexec-tools-arm64-kexec-allocate-memory-space-avoiding-reserved-regions.patch + * kexec-tools-arm64-kdump-deal-with-resource-entries-in-proc-iomem.patch + * kexec-tools-build-multiboot2-for-i386.patch + * kexec-tools-fix-kexec_file_load-error-handling.patch + * kexec-tools-reset-getopt-before-falling-back-to-legacy.patch + * kexec-tools-s390-Reset-kernel-command-line-on-syscal.patch + * kexec-tools-Remove-duplicated-variable-declarations.patch + +------------------------------------------------------------------- +Tue Apr 20 12:01:43 UTC 2021 - Wolfgang Frisch + +- Hardening: Link as PIE (bsc#1185020). + +------------------------------------------------------------------- +Tue Nov 24 16:54:57 UTC 2020 - Ludwig Nussel + +- prepare usrmerge (boo#1029961) + +------------------------------------------------------------------- +Tue Nov 10 12:17:44 UTC 2020 - olaf@aepfle.de + +- Remove kexec-tools-xen-balloon-up.patch (bsc#1176606) + This patch was introduced to address bug#694863, it enabled kexec + for HVM at that time. Meanwhile Xen 4.7 introduced "soft-reset" + for HVM domUs. This host feature removed the requirement to + un-ballon the domU prior kexec. + With Xen 4.13 cpuid faulting became the default, which affected the + approach used in this patch to detect the domU type. As a result + invoking kexec in dom0 failed. + +------------------------------------------------------------------- +Fri Jun 5 09:36:21 UTC 2020 - Bernhard Wiedemann + +- Make kexec-bootloader work without 'which' package (boo#1172501) + +------------------------------------------------------------------- +Fri Apr 3 12:11:16 UTC 2020 - Petr Tesařík + +- kexec-tools-Remove-duplicated-variable-declarations.patch: + Remove duplicated variable declarations (boo#1160399). + +------------------------------------------------------------------- +Fri Apr 3 11:24:02 UTC 2020 - Petr Tesařík + +- kexec-tools-s390-Reset-kernel-command-line-on-syscal.patch: s390: + Reset kernel command line on syscall fallback (bsc#1167868). + +------------------------------------------------------------------- +Fri Mar 13 14:11:55 UTC 2020 - Petr Tesařík + +- kexec-tools-reset-getopt-before-falling-back-to-legacy.patch: + Reset getopt before falling back to legacy syscall (bsc#1166105). + +------------------------------------------------------------------- +Fri Mar 13 08:37:58 UTC 2020 - Petr Tesařík + +- kexec-tools-fix-kexec_file_load-error-handling.patch: Fix the + error handling if kexec_file_load() fails (bsc#1166105). + +------------------------------------------------------------------- +Wed Jan 29 07:35:18 UTC 2020 - Petr Tesařík + +- Fix build errors on old distributions + * kexec-tools-video-capability.patch + * kexec-tools-SYS_getrandom.patch + +------------------------------------------------------------------- +Fri Jan 10 06:02:42 UTC 2020 - Chester Lin + +- Fix compiling errors of multiboot2_x86_* functions for i586 + * kexec-tools-build-multiboot2-for-i386.patch + +------------------------------------------------------------------- +Mon Dec 16 15:45:05 UTC 2019 - Chester Lin + +- Bump to version 2.0.20 + Changelog: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.19..v2.0.20 +- Backport a upstream patch series: [jsc#SLE-9032] + Subject: [PATCH v2 0/3] arm64: handle "reserved" entries in /proc/iomem + * kexec-tools-add-variant-helper-functions.patch + * kexec-tools-arm64-kexec-allocate-memory-space-avoiding-reserved-regions.patch + * kexec-tools-arm64-kdump-deal-with-resource-entries-in-proc-iomem.patch + +------------------------------------------------------------------- +Fri Jun 14 12:11:18 UTC 2019 - Petr Tesarik + +- Bump to version 2.0.19 + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.18..v2.0.19 + +------------------------------------------------------------------- +Mon Jan 14 15:47:10 CET 2019 - kukuk@suse.de + +- Use %license instead of %doc [bsc#1082318] + +------------------------------------------------------------------- +Thu Nov 1 20:58:20 UTC 2018 - ptesarik@suse.com + +- Remove bogus Url RPM tag: The project does not have a home page. + +------------------------------------------------------------------- +Thu Nov 1 14:58:41 UTC 2018 - ptesarik@suse.com + +- Bump to version 2.0.18 + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.17..v2.0.18 +- Drop patches from upstream git: + * kexec-tools-fix-for-Unhandled-rela-relocation-R_X86_64_PLT32.patch +- Remove the confusing kdump binary (no longer in upstream). + +------------------------------------------------------------------- +Mon Sep 10 14:27:09 UTC 2018 - Alberto Planas Dominguez + +- kexec-tools-fix-for-Unhandled-rela-relocation-R_X86_64_PLT32.patch + Upstream backport. + + In response to a change in binutils, commit b21ebf2fb4c + (x86: Treat R_X86_64_PLT32 as R_X86_64_PC32) was applied to + the linux kernel during the 4.16 development cycle and has + since been backported to earlier stable kernel series. The + change results in the failure message in $SUBJECT when + rebooting via kexec. + + Fix this by replicating the change in kexec. + +------------------------------------------------------------------- +Thu Apr 19 11:54:10 UTC 2018 - ptesarik@suse.com + +- Bump to version 2.0.17 + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.16..v2.0.17 +- Drop kexec-tools-xen-static.patch: upstream uses run-time dynamic + linking to address the same issue. +- Drop all patches from upstream git: + * kexec-tools-add-a-helper-function-to-add-ranges.patch + * kexec-tools-ppc64-parse-ibm-dynamic-memory.patch + * kexec-tools-ppc64-leverage-kexec_file_load-support.patch + * kexec-tools-Return-ENOSYS-when-kexec-does-not-know.patch + * kexec-tools-Fix-option-checks-to-take-KEXEC_FILE_LOAD.patch + * kexec-tools-Do-not-special-case-the-s-option.patch + * kexec-tools-Add-option-to-revert-s.patch + * kexec-tools-Add-option-to-fall-back-to-KEXEC_LOAD.patch + * kexec-tools-Document-s-c-and-a-options-in-the-man-page.patch + * kexec-tools-fix-kexec-p-segfault.patch + +------------------------------------------------------------------- +Thu Apr 5 11:12:53 UTC 2018 - ptesarik@suse.com + +- kexec-tools-vmcoreinfo-in-xen.patch: Revert "kexec-tools: Read + always one vmcoreinfo file" (bsc#1085626, bsc#951740). + +------------------------------------------------------------------- +Thu Apr 5 09:05:11 UTC 2018 - ptesarik@suse.com + +- kexec-tools-fix-kexec-p-segfault.patch: Fix a segmentation fault + when trying to run "kexec -p" (bsc#1080916). + +------------------------------------------------------------------- +Tue Apr 3 11:43:18 UTC 2018 - msuchanek@suse.com + +- kexec: add -a option to fall back to KEXEC_LOAD when KEXEC_FILE_LOAD is not + supported (bsc#1080916, boo#1076839). + * kexec-tools-Return-ENOSYS-when-kexec-does-not-know.patch + * kexec-tools-Fix-option-checks-to-take-KEXEC_FILE_LOAD.patch + * kexec-tools-Do-not-special-case-the-s-option.patch + * kexec-tools-Add-option-to-revert-s.patch + * kexec-tools-Add-option-to-fall-back-to-KEXEC_LOAD.patch + * kexec-tools-Document-s-c-and-a-options-in-the-man-page.patch +- kexec-tools-ppc64-leverage-kexec_file_load-support.patch: kexec/ppc64: + leverage kexec_file_load support (bsc#1080916). + +------------------------------------------------------------------- +Fri Feb 23 07:38:55 UTC 2018 - ptesarik@suse.com + +- kexec-tools-ppc64-parse-ibm-dynamic-memory.patch: kexec/ppc64: + add support to parse ibm, dynamic-memory-v2 property + (bsc#1081789, LTC#164625). +- kexec-tools-add-a-helper-function-to-add-ranges.patch: kexec: add + a helper function to add ranges (bsc#1081789, LTC#164625). + +------------------------------------------------------------------- +Fri Jan 19 12:59:56 UTC 2018 - tchvatal@suse.com + +- Create compat link for rckexec-loader systemd service +- Convert the asciidoc file to normal man in order to drop asciidoc dep + * python2 only obsoletion and upstream has only raw manpages too +- Properly state all post/postun dependencies (systemd, suse-module-tools) +- There is no reason for exclusive arch if we state all archs +- Bump to version 2.0.16 + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.14..v2.0.16 +- Remove support for older products to trivialize spec file +- Make sure to not pull python2 via asciidoc +- Drop merged patch 0001-kexec-tools-2.0.14.git.patch +- Drop all patches from upstream git: + * 0002-ppc64-Reduce-number-of-ELF-LOAD-segments.patch + * 0003-kexec-Increase-the-upper-limit-for-RAM-segments.patch + * 0004-alpha-add-missing-__NR_kexec_load-definition.patch + * 0005-kexec-implemented-XEN-KEXEC-STATUS-to-determine-if-a.patch + * 0006-kexec-Remove-redundant-space-from-help-message.patch + * 0007-purgatory-Add-purgatory.map-and-purgatory.ro.sym-to-.patch + * 0008-kexec-Add-option-to-get-crash-kernel-region-size.patch + * 0009-crashdump-arm-Add-get_crash_kernel_load_range-functi.patch + * 0010-crashdump-arm64-Add-get_crash_kernel_load_range-func.patch + * 0011-crashdump-cris-Add-get_crash_kernel_load_range-funct.patch + * 0012-crashdump-ia64-Add-get_crash_kernel_load_range-funct.patch + * 0013-crashdump-m68k-Add-get_crash_kernel_load_range-funct.patch + * 0014-crashdump-mips-Add-get_crash_kernel_load_range-funct.patch + * 0015-crashdump-ppc-Add-get_crash_kernel_load_range-functi.patch + * 0016-crashdump-ppc64-Add-get_crash_kernel_load_range-func.patch + * 0017-crashdump-s390-Add-get_crash_kernel_load_range-funct.patch + * 0018-crashdump-sh-Add-get_crash_kernel_load_range-functio.patch + * 0019-gitignore-add-two-generated-files-in-purgatory.patch + * 0020-Only-print-debug-message-when-failed-to-serach-for-k.patch + * 0021-build_mem_phdrs-check-if-p_paddr-is-invalid.patch + * 0022-uImage-fix-realloc-pointer-confusion.patch + * 0023-uImage-Fix-uImage_load-for-little-endian-machines.patch + * 0024-uImage-Add-new-IH_ARCH_xxx-definitions.patch + * 0025-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch + * 0026-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch + * 0027-arm64-add-uImage-support.patch + * 0028-vmcore-dmesg-Define-_GNU_SOURCE.patch + * 0029-Don-t-use-L-width-specifier-with-integer-values.patch + * 0030-x86-x86_64-Fix-format-warning-with-die.patch + * 0031-ppc-Fix-format-warning-with-die.patch + * 0032-crashdump-Remove-stray-get_crashkernel_region-declar.patch + * 0033-x86-Support-large-number-of-memory-ranges.patch + * 0034-Fix-broken-Xen-support-in-configure.ac.patch + * 0035-kexec-extend-the-semantics-of-kexec_iomem_for_each_l.patch + * 0036-kexec-generalize-and-rename-get_kernel_stext_sym.patch + * 0037-arm64-identify-PHYS_OFFSET-correctly.patch + * 0038-arm64-change-return-values-on-error-to-negative.patch + * 0039-arm64-kdump-identify-memory-regions.patch + * 0040-arm64-kdump-add-elf-core-header-segment.patch + * 0041-arm64-kdump-set-up-kernel-image-segment.patch + * 0042-arm64-kdump-set-up-other-segments.patch + * 0043-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch + * 0044-arm64-kdump-Add-support-for-binary-image-files.patch + * 0045-Handle-additional-e820-memmap-type-strings.patch + * 0046-powerpc-fix-command-line-overflow-error.patch + * 0047-fix-how-RMA-top-is-deduced.patch + +------------------------------------------------------------------- +Mon Jan 8 15:14:57 UTC 2018 - msuchanek@suse.com + +- Fix kexec error on ppc64 (bsc#1074947). + 0046-powerpc-fix-command-line-overflow-error.patch + 0047-fix-how-RMA-top-is-deduced.patch + +------------------------------------------------------------------- +Tue Oct 31 10:23:51 MDT 2017 - carnold@suse.com + +- With Xen 4.10 there is a new required library called xentoolcore + (bsc#1037779) + kexec-tools-xen-static.patch +- Refreshed kexec-tools-disable-test.patch + +------------------------------------------------------------------- +Thu Jun 1 09:12:40 UTC 2017 - jengelh@inai.de + +- Remove redundant %clean section. Replace $RPM_* shell vars + by macros. +- Rewrite summary line. + +------------------------------------------------------------------- +Wed May 31 10:47:33 CEST 2017 - tiwai@suse.de + +- Update to version 2.0.14 (bsc#1039937, FATE#320672, FATE#320671) + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.13..v2.0.14 +- Backport upstream fixes (bsc#1039937, FATE#320672, FATE#320671) + 0001-kexec-tools-2.0.14.git.patch + 0002-ppc64-Reduce-number-of-ELF-LOAD-segments.patch + 0003-kexec-Increase-the-upper-limit-for-RAM-segments.patch + 0004-alpha-add-missing-__NR_kexec_load-definition.patch + 0005-kexec-implemented-XEN-KEXEC-STATUS-to-determine-if-a.patch + 0006-kexec-Remove-redundant-space-from-help-message.patch + 0007-purgatory-Add-purgatory.map-and-purgatory.ro.sym-to-.patch + 0008-kexec-Add-option-to-get-crash-kernel-region-size.patch + 0009-crashdump-arm-Add-get_crash_kernel_load_range-functi.patch + 0010-crashdump-arm64-Add-get_crash_kernel_load_range-func.patch + 0011-crashdump-cris-Add-get_crash_kernel_load_range-funct.patch + 0012-crashdump-ia64-Add-get_crash_kernel_load_range-funct.patch + 0013-crashdump-m68k-Add-get_crash_kernel_load_range-funct.patch + 0014-crashdump-mips-Add-get_crash_kernel_load_range-funct.patch + 0015-crashdump-ppc-Add-get_crash_kernel_load_range-functi.patch + 0016-crashdump-ppc64-Add-get_crash_kernel_load_range-func.patch + 0017-crashdump-s390-Add-get_crash_kernel_load_range-funct.patch + 0018-crashdump-sh-Add-get_crash_kernel_load_range-functio.patch + 0019-gitignore-add-two-generated-files-in-purgatory.patch + 0020-Only-print-debug-message-when-failed-to-serach-for-k.patch + 0021-build_mem_phdrs-check-if-p_paddr-is-invalid.patch + 0022-uImage-fix-realloc-pointer-confusion.patch + 0023-uImage-Fix-uImage_load-for-little-endian-machines.patch + 0024-uImage-Add-new-IH_ARCH_xxx-definitions.patch + 0025-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch + 0026-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch + 0027-arm64-add-uImage-support.patch + 0028-vmcore-dmesg-Define-_GNU_SOURCE.patch + 0029-Don-t-use-L-width-specifier-with-integer-values.patch + 0030-x86-x86_64-Fix-format-warning-with-die.patch + 0031-ppc-Fix-format-warning-with-die.patch + 0032-crashdump-Remove-stray-get_crashkernel_region-declar.patch + 0033-x86-Support-large-number-of-memory-ranges.patch + 0034-Fix-broken-Xen-support-in-configure.ac.patch + 0035-kexec-extend-the-semantics-of-kexec_iomem_for_each_l.patch + 0036-kexec-generalize-and-rename-get_kernel_stext_sym.patch + 0037-arm64-identify-PHYS_OFFSET-correctly.patch + 0038-arm64-change-return-values-on-error-to-negative.patch + 0039-arm64-kdump-identify-memory-regions.patch + 0040-arm64-kdump-add-elf-core-header-segment.patch + 0041-arm64-kdump-set-up-kernel-image-segment.patch + 0042-arm64-kdump-set-up-other-segments.patch + 0043-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch + 0044-arm64-kdump-Add-support-for-binary-image-files.patch + 0045-Handle-additional-e820-memmap-type-strings.patch +- Refreshed patches: + kexec-tools-xen-static.patch + kexec-tools-xen-balloon-up.patch +- Drop obsoleted arm64 patches: + kexec-tools-enable-aarch64-fixup.patch + kexec-tools-enable-aarch64.patch +- Fix source URL, as ftp was discontinued on korg +- Sync changelog with SLE12 packages + +------------------------------------------------------------------- +Wed May 10 15:51:43 MDT 2017 - carnold@suse.com + +- kexec-tools-xen-static.patch: xen breaks kexec-tools build + (bsc#1037779) + See also matching fix in xen-devel package + +------------------------------------------------------------------- +Tue Apr 11 14:27:09 UTC 2017 - bwiedemann@suse.com + +- fix kexec-bootloader with /boot partition (boo#1033599) + +------------------------------------------------------------------- +Wed Feb 22 12:51:28 UTC 2017 - meissner@suse.com + +- Do not pull in gcc-PIE, as it breaks the static build in here. + +------------------------------------------------------------------- +Mon Aug 8 10:47:36 UTC 2016 - ptesarik@suse.com + +- Update to version 2.0.13 + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.12..v2.0.13 + +- Refresh kexec-tools-enable-aarch64.patch + +------------------------------------------------------------------- +Fri Jun 17 11:44:18 UTC 2016 - normand@linux.vnet.ibm.com + +- remove sed line in spec for ppc64 about stack-protector + as now handled in Makefile. + +------------------------------------------------------------------- +Fri Jun 3 18:16:51 UTC 2016 - tonyj@suse.com + +- Update to version 2.0.12 (FATE#320915, bsc#980545) + Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.10..v2.0.12 + + Drop following patches (upstream): + kexec-tools-load-crash-kernel-high.patch + +- Fix pkg-config to check >= 4.7 rather than > 4.6 for xenlight + +- Specifically name Files in specfile rather than using glob. + +------------------------------------------------------------------- +Mon May 30 08:47:49 UTC 2016 - ptesarik@suse.com + +- kexec-tools-ppc64-reduce-elf-loads.patch: ppc64: Reduce number of + ELF LOAD segments (bsc#981339). + +------------------------------------------------------------------- +Tue May 3 15:17:15 UTC 2016 - olaf@aepfle.de + +- Adjust linking to libxenctrl to xen-4.7 API (fate#319989) + +------------------------------------------------------------------- +Thu Dec 10 16:33:20 CET 2015 - tiwai@suse.de + +- Fix missing dependency on coreutils for initrd macros (boo#958562) +- Call missing initrd macro at postun (boo#958562) + +------------------------------------------------------------------- +Mon Oct 26 09:33:04 UTC 2015 - ptesarik@suse.cz + +- kexec-tools-vmcoreinfo-in-xen.patch: Store XEN_VMCOREINFO in + panic kernel ELF notes. + (bsc#951740) + +------------------------------------------------------------------- +Wed Oct 14 04:11:05 UTC 2015 - jlee@suse.com + +- kexec-tools-xen-inhibit-file-based-syscall.patch: To inhibit file + based syscall on XEN, using old syscall to load crash kernel. + (bsc#947172) + +------------------------------------------------------------------- +Tue Oct 6 09:34:20 UTC 2015 - ptesarik@suse.com + +- kexec-tools-load-crash-kernel-high.patch: Load crash kernel high + on x86 (bsc#946365). + +------------------------------------------------------------------- +Fri Jun 26 07:33:16 UTC 2015 - ptesarik@suse.cz + +- Upgrade to kexec-2.0.10: This is a feature release coinciding + with the release of the v4.1 Linux Kernel. +- Refreshed patches: + * kexec-tools-xen-static.patch + * kexec-tools-xen-balloon-up.patch +- Dropped patches (now upstream): + * kexec-tools-callback-function-proto.patch + +------------------------------------------------------------------- +Mon May 4 08:36:01 UTC 2015 - jlee@suse.com + +- Add 'kexec-tools/kexec-tools-Provide-an-option-to-use-new-kexec-system-call.patch' + to support kdump on secure boot. (fate#315018, bnc#884453) + +------------------------------------------------------------------- +Sun Mar 29 01:53:16 UTC 2015 - crrodriguez@opensuse.org + +- kexec tools are included in the default initrd, we need + to regenerate if this package changes. + +------------------------------------------------------------------- +Fri Mar 20 15:19:45 UTC 2015 - schwab@linux-m68k.org + +- Enable building on m68k + +------------------------------------------------------------------- +Fri Feb 13 17:42:58 UTC 2015 - ptesarik@suse.cz + +- Upgrade to kexec-2.0.9: This is a bug-fix release coinciding with + the release of the v3.19 Linux Kernel. + +------------------------------------------------------------------- +Fri Jan 9 02:13:57 UTC 2015 - tonyj@suse.com + +- Fix x86 callback prototypes (bnc#905090) + Add patch: kexec-tools-callback-function-proto.patch + +------------------------------------------------------------------- +Thu Oct 9 16:38:05 UTC 2014 - ptesarik@suse.cz + +- Upgrade to kexec-2.0.8 +- Dropped patches (now upstream): + o kexec-tools-xen-e820-redefinition.patch + o kexec-tools-i386-bzimage_efi.patch + o kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch + o kexec-tools-zero-efi-info.patch + o kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch + o kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch + o kexec-tools-kdump-fix-elf-header-endianess.patch + +------------------------------------------------------------------- +Tue Aug 19 21:06:29 UTC 2014 - tonyj@suse.com + +- custom autoconf action was no longer setting HAVE_LIBXENCTRL (bnc#886873) + +------------------------------------------------------------------- +Fri Aug 15 21:34:43 UTC 2014 - tonyj@suse.com + +- Do not package kdump.8 as it is only a placeholder, full man page is provided + by kdump package (bnc#892090) + +------------------------------------------------------------------- +Sat Jul 26 14:53:22 UTC 2014 - tonyj@suse.com + +- Fix ELF header endianess for ppc64le kdump (bnc#888150) + New patch: kexec-tools-kdump-fix-elf-header-endianess.patch + +------------------------------------------------------------------- +Sun Jul 20 19:49:17 UTC 2014 - p.drouand@gmail.com + +- Remove insserv dependency; the package doesn't provide any sysvinit + script + +------------------------------------------------------------------- +Thu May 1 17:47:36 UTC 2014 - tonyj@suse.com + +- Device tree values should be big endian for ppc64le (bnc#875485) + New patch: kexec-tools-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch + +------------------------------------------------------------------- +Fri Apr 11 18:08:41 UTC 2014 - tonyj@suse.com + +- Expose flattened device trees (ppc64le) to new kexec'd kernel in Big Endian + format (bnc#873169) + New patch: kexec-tools-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch +- Update patch headers to reflect upstream commit id's: + Change patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch + Change patch: kexec-tools-zero-efi-info.patch + +------------------------------------------------------------------- +Tue Mar 18 16:45:14 UTC 2014 - tonyj@suse.com + +- Reserve mmconf areas for kdump kernel via memmap=X$Y in cmdline + (bnc#819777 [original: bnc#804800]: fix still needed for SGI UV systems). + New patch: kexec-tools-set-mmconf-reserved.patch +- Disable stack protector for ppc64le (bnc#869161) + New patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch +- Disable erroneous (efi memory descriptor version) message (bnc#867785c5) + New patch: kexec-tools-zero-efi-info.patch + +------------------------------------------------------------------- +Thu Feb 6 01:14:24 UTC 2014 - tonyj@suse.com + +- Drop obsolete /etc/init.d/kexec (bnc# 862143). +- Handle btrfs root subvolume (bnc# 862143c35) +- Create kexec-load.service (bnc# 862143) +- Update kexec-bootloader manpage (document reboot using kexec) +- Remove old 11.1 conditionals +- Update kexec-tools-i386-bzimage_efi.patch and + kexec-tools-xen-e820-redefinition.patch with upstream commit ids + +------------------------------------------------------------------- +Wed Feb 5 17:53:56 UTC 2014 - tonyj@suse.com + +- Update to version 2.0.5 + Drop patch 'device-tree-buffer-overflows.patch' (upstream) + Drop patch '0001-kexec-fs2dt-fix-endianess-conversion.patch' (upstream) +- Rename aarch64 patch to 'kexec-tools-enable-aarch64.patch' and rebase to + version from Linaro git. +- Add 'kexec-tools-enable-aarch64-fixup.patch' to solve arm libfdt breakage + with Linaro patch. +- Enable ppc64le +- Refresh patches for context. +- Add following patches (pending upstream): + 'kexec-tools-i386-bzimage_efi.patch' to fix i386 breakage. + 'kexec-tools-xen-e820-redefinition.patch' to fix xen/820 breakage. + +------------------------------------------------------------------- +Tue Feb 4 13:00:37 UTC 2014 - dmueller@suse.com + +- add 0001-kexec-fs2dt-fix-endianess-conversion.patch: + * fix ppc64 and arm +- refresh device-tree-buffer-overflows.patch with the version + that went upstream + +------------------------------------------------------------------- +Mon Feb 3 14:17:09 UTC 2014 - dmueller@suse.com + +- enable build for arm / aarch64 +- add kexec-aarch64.patch +- add device-tree-buffer-overflows.patch + +------------------------------------------------------------------- +Thu Jan 9 21:04:46 UTC 2014 - tonyj@suse.com + +- Update to version 2.0.4 +- Drop patches (mainline): + kexec-tools-fix-makefile-binaries.patch (aaedd532) + kexec-tools-fix-strncat.patch (d5efc524) + kexec-tools-no-vga-output.patch (f1facd4b) + +------------------------------------------------------------------- +Sun Jan 5 08:06:01 UTC 2014 - coolo@suse.com + +- xen 4.4 is exclusive to 64bit archs, so don't require it + +------------------------------------------------------------------- +Fri Dec 6 11:51:24 UTC 2013 - ptesarik@suse.cz + +- Remove double-packaging of /etc/init.d/kexec-tools, fixing build + errors on some targets, e.g. SLE-11. + +------------------------------------------------------------------- +Thu Apr 11 06:37:22 UTC 2013 - mmeister@suse.com + +- Added url as source. + Please see http://en.opensuse.org/SourceUrls + +------------------------------------------------------------------- +Thu Oct 11 23:10:42 UTC 2012 - tonyj@suse.com + +- Update to kexec 2.0.3. Drop unneeded patches. + +------------------------------------------------------------------- +Thu Jun 14 16:23:58 CEST 2012 - ohering@suse.de + +- Fix xen cpuid() inline asm to not clobber stack's red zone + See xen-unstable changeset 24344:72f4e4cb7440 + +------------------------------------------------------------------- +Thu Jun 14 11:26:16 CEST 2012 - ohering@suse.de + +- Balloon up in a Xen PVonHVM guest before kexec (bnc#694863) +- Update xen_present check for xenfs in pv_ops kernel (bnc#694863) +- Change xen_present hv check (bnc#658413) + +------------------------------------------------------------------- +Fri Apr 20 16:19:26 UTC 2012 - rschweikert@suse.com + +- place binaries into /usr tree (UsrMerge project) + +------------------------------------------------------------------- +Fri Dec 2 16:42:47 UTC 2011 - coolo@suse.com + +- add automake as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Sun Jul 10 23:48:14 CEST 2011 - meissner@suse.de + +- fixed strncat sizse argument on ppc + +------------------------------------------------------------------- +Tue May 17 11:12:54 CEST 2011 - jslaby@suse.de + +- fix build with gcc that doesn't understand --no-undefined + +------------------------------------------------------------------- +Sun Sep 12 07:26:33 UTC 2010 - bernhard@bwalle.de + +- Update to kexec-tools 2.0.2 (bug fix release). The complete + changelog can be viewed at + http://git.kernel.org/?p=utils/kernel/kexec/kexec-tools.git;a=shortlog;h=refs/tags/v2.0.2. +- Drop kexec-tools-increase-kernel-text-size.diff: Mainline. + +------------------------------------------------------------------- +Tue Mar 16 15:39:45 CET 2010 - ro@suse.de + +- disable autoreconf to fix build +- drop obsolete patch ARM_kexec-zImage-arm_page_to_unistd.diff + +------------------------------------------------------------------- +Wed Feb 10 23:32:34 UTC 2010 - jengelh@medozas.de + +- Add ExclusiveArch to specfile according to source capabilities + +------------------------------------------------------------------- +Sun Dec 20 17:33:50 CET 2009 - bernhard@bwalle.de + +- Update to kexec-tools 2.0.1 (bug fix release). +- Drop following patches because they are upstream now (or the + problem is fixed otherwise upstream): + o kexec-tools-ia64-uncached-memory.diff + o kexec-tools-ia64-PA.diff + o kexec-tools-build-warnings.diff + o kexec-tools-ppc64-build-warnings.diff + o kexec-tools-ppc64-IBM-QS2x-blades.diff + o kexec-tools-ia64-kdump-PT_LOAD-order.diff + o kexec-tools-crash-memory-ranges-drconf.diff + o kexec-tools-add-usable-drconf-memory-node-to-device-tree.diff + o kexec-tools-get-details-dynamic-reconfiguration-memory-node.diff + o kexec-tools-get-details-dynamic-reconfiguration-memory-node.diff + o kexec-tools-device-tree-return.diff + o kexec-tools-ppc-check-flags.diff + o kexec-tools-spell.diff + o kexec-tools-proc-iomem-xen.diff + o kexec-tools-parse-iomem-single-warning.diff + o kexec-tools-exclude-gart.diff + o kexec-tools-ppc64-memory-ranges-dynamic.diff + o kexec-tools-ppc64-dynamic-fix-1.diff + o kexec-tools-ppc64-dynamic-fix-2.diff + o kexec-tools-ppc64-dynamic-fix-3.diff + o kexec-tools-ppc64-reinit.diff + +------------------------------------------------------------------- +Mon Sep 21 13:20:37 UTC 2009 - jansimon.moeller@opensuse.org + +- fix build on arm. kexec-zImage-arm needed s#asm/page.h#unistd.h# + +------------------------------------------------------------------- +Wed Aug 12 09:46:46 CEST 2009 - tiwai@suse.de + +- increase kernel text size to fix for 2.6.31 kernel (bnc#530240) + +------------------------------------------------------------------- +Sun Jul 12 14:22:02 CEST 2009 - coolo@novell.com + +- disable as-needed to fix build + +------------------------------------------------------------------- +Thu Feb 5 13:06:38 CET 2009 - bwalle@suse.de + +- Re-initialize drconf variables for PPC64 (bnc #468571). + +------------------------------------------------------------------- +Wed Feb 4 12:23:50 CET 2009 - tiwai@suse.de + +- fix build failure due to missing xsltproc + +------------------------------------------------------------------- +Fri Jan 16 18:57:47 CET 2009 - bwalle@suse.de + +- The dynamic reallocation for PPC64 broke kdump completely. + Fix the patch so that dynamic reallocation actually works + without memory corruption (bnc #466782). + +------------------------------------------------------------------- +Fri Jan 16 15:11:37 CET 2009 - bwalle@suse.de + +- Add #!BuildIgnore on fop to speed up build (asciidoc don't + require fop for manpage generation). + +------------------------------------------------------------------- +Wed Jan 07 14:30:47 CET 2009 - bwalle@suse.de + +- Allocate memory ranges dynamically on PPC64 (bnc #460752). + +------------------------------------------------------------------- +Tue Dec 09 17:10:10 CET 2008 - bwalle@suse.de + +- Exclude GART memory from regions that must be written to the + dump file (bnc #457612). + +------------------------------------------------------------------- +Wed Nov 26 10:05:49 CET 2008 - bwalle@suse.de + +- Fix compile warning. + +------------------------------------------------------------------- +Mon Nov 24 23:00:59 CET 2008 - bwalle@suse.de + +- Read memory map from /proc/iomem instead of /sys/firmware/memmap + when running under Xen. +- Build against libxenctl on i386 and x86-64 but link statically + to avoid runtime dependencies that would exist even on non-Xen + systems. + +------------------------------------------------------------------- +Fri Nov 14 10:54:01 CET 2008 - bwalle@suse.de + +- Fix spell error in help output (bnc#444714). + +------------------------------------------------------------------- +Sat Nov 01 17:01:14 CET 2008 - bwalle@suse.de + +- Don't print "setup_linux_vesafb" message on stderr. + +------------------------------------------------------------------- +Mon Oct 27 10:25:42 CET 2008 - bwalle@suse.de + +- Update patch that checks for reserved and assigned bit flags on + the memory regions (bnc#438086). + +------------------------------------------------------------------- +Sun Oct 26 18:11:02 CET 2008 - bwalle@suse.de + +- Clear grubonce after using in kexec-bootloader (bnc#438194). +- Add rpmlint supression file. +- Correct debugging output: Number of section was one too small + (last index != size of array). + +------------------------------------------------------------------- +Fri Oct 24 14:17:21 CEST 2008 - bwalle@suse.de + +- Check for reserved and assigned bit flags on the memory regions + (bnc#438086). + +------------------------------------------------------------------- +Sat Oct 18 22:25:59 CEST 2008 - bwalle@suse.de + +- Honor grubonce also when the 1st (== 0th) entry was chosen. + +------------------------------------------------------------------- +Mon Oct 13 16:41:27 CEST 2008 - bwalle@suse.de + +- Fix runlevels (Default-Start, Default-Stop) in kexec.init. +- Only load kexec kernel when kexec reboot is enabled when the + target runlevel is 6 (reboot) to avoid slowdown of shutdown in + that case. + +------------------------------------------------------------------- +Thu Oct 09 19:00:04 CEST 2008 - bwalle@suse.de + +- PPC64: Use return value of count_dyn_reconf_memory_ranges(). + +------------------------------------------------------------------- +Thu Oct 09 18:39:45 CEST 2008 - bwalle@suse.de + +- Fix empty /proc/vmcore on PPC64 (bnc#431492). + o kexec/kdump: read crash memory ranges from drconf memory. + o kexec/kdump: add a new linux, usable-drconf-memory node to the + device tree. + o kexec/kdump: get details of ibm, dynamic-reconfiguration-memory + node of device tree. + +------------------------------------------------------------------- +Thu Oct 09 15:47:46 CEST 2008 - bwalle@suse.de + +- Add newline in error message of "kexec-bootloader". +- Add error handling when Bootloader::Tools::GetDefaultSection() + fails. + +------------------------------------------------------------------- +Wed Oct 08 16:57:28 CEST 2008 - bwalle@suse.de + +- IA64: Order of operations bug in PT_LOAD segment reader. + +------------------------------------------------------------------- +Wed Oct 08 16:29:33 CEST 2008 - bwalle@suse.de + +- ia64: Do not include uncached memory to vmcore. +- ia64: Make PA() work for both physical identity-mapped virtual + addresses. +- PPC64: Let kexec work on IBM QS2x blade servers +- Fix build warnings. + +------------------------------------------------------------------- +Mon Oct 06 17:32:56 CEST 2008 - bwalle@suse.de + +- Implement -h (help) option (bnc#432386). +- Remove documentation of -o (options) option that never existed. + +------------------------------------------------------------------- +Wed Aug 27 11:59:55 CEST 2008 - bwalle@suse.de + +- only install and build /etc/init.d/kexec with openSUSE 11.1 / + SLES 11 and later + +------------------------------------------------------------------- +Sat Aug 16 11:04:55 CEST 2008 - bwalle@suse.de + +- mark /etc/init.d/kexec as %config +- remove (empty) %preun + +------------------------------------------------------------------- +Fri Aug 15 09:35:48 CEST 2008 - bwalle@suse.de + +- add /etc/init.d/kexec to be able to reboot with kexec(8) + (FATE#302238) + +------------------------------------------------------------------- +Sat Jul 19 16:54:57 CEST 2008 - bwalle@suse.de + +- update to kexec-tools 2.0.0 (final) + o Allow BUILD_CFLAGS and TARGET_CFLAGS to be specified at + configure time + +------------------------------------------------------------------- +Mon Jul 14 17:32:17 CEST 2008 - bwalle@suse.de + +- update to kexec-tools 2.0.0-rc1 + o implement support for /sys/firmware/memmap interface + o Allow 32 bit kexec binary to boot kdump kernel on ppc64 + architecture + o kexec/crashdump.c: remove file descriptor leaks; make + kdump_info argument to get_vmcoreinfo() const + o Fix implicit declaration of inb/outb + o EDD implementation + o Specify the arch on kexec_unload + o Update KEXEC_ARCH_* constants from Linux kernel headers + o lots of code cleanup + o Add --reuse-cmdline + o documentation update (manpage, boot protocol) + o ensure that extra rtas segment is a multiple of PAGE_SIZE + o Allow building for ppc32 platforms + o Die on early EOF in slurp_file, instead of infinite-looping + o Fix copy-paste bug: entry16 does not start at entry16_debug + o Fix undefined symbol errors on readw/writew: arch/io.h, not + sys/io.h + o extract vmcoreinfo from /proc/vmcore for Xen + o Give installed files user-writable permission + o Use separate CPPFLAGS and LDFLAGS for purgatory +- dropped kexec-tools-fix-arch-on-unload: merged upstream +- dropped kexec-tools-edd-fix: merged upstream +- dropped kexec-tools-refactor-architecture-detection: merged + upstram +- dropped kexec-tools.gcc-bug.patch: merged upstream +- dropped kexec-tools.ppc32-64bit-purgatory.patch: merged upstream +- kexec-tools-edd-support: merged upstream +- kexec-tools-32bit-kexec-with-64bit-ppc64.patch: merged upstream +- removed README.SUSE: information not necessary any more + +------------------------------------------------------------------- +Thu Jul 3 14:39:02 CEST 2008 - bwalle@suse.de + +- fix 32 bit kexec to boot on 64 bit ppc64 (bnc#405015) + +------------------------------------------------------------------- +Mon May 26 23:14:15 CEST 2008 - bwalle@suse.de + +- fix EDD support when the BIOS-reported length is smaller than + the sysfs raw_data size (bnc#388754) + +------------------------------------------------------------------- +Mon May 26 14:15:00 CEST 2008 - bwalle@suse.de + +- fix kexec unload (rckdump stop) on ppc64 (bnc#394216) + +------------------------------------------------------------------- +Tue May 13 15:19:58 CEST 2008 - bwalle@suse.de + +- implement EDD (bnc#383210) + +------------------------------------------------------------------- +Mon Mar 24 23:38:05 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080324 + o tarball update (version), no functional changes between + v20080318-rc and v20080324 + +------------------------------------------------------------------- +Tue Mar 18 09:20:47 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080318-rc + o ia64 kern_vaddr_start was calculated incorrectly + o ia64: make load_crashdump_segments 80col wide + o fix i386 EFI boot using efifb + o mipsel: mipsel port + o fix kexec-tools on x86_64 (see bnc#368138) + o fix valid_memory_range region merging + o arm: invalid initialisation of iomem in get_memory_ranges() + o arm: use proc_iomem() + o no machine machine to proc_iomem() + +------------------------------------------------------------------- +Fri Mar 14 17:30:53 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080227-git + (current git snapshot, fixes x86_64, bnc#368138) +- kexec-tools-portability-issue deleted: mainline + +------------------------------------------------------------------- +Wed Feb 27 08:09:08 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080227 + (only increased version number) + +------------------------------------------------------------------- +Tue Feb 26 08:58:47 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080226-rc + o build: include configure and include/config.h.in in dist + tarball +- adjusted kexec-tools-portability-issue to build without warnings + on 32 bit systems + +------------------------------------------------------------------- +Thu Feb 21 10:55:57 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080221-rc + o Only include needed files in distribution tarball + o Clean up whitespace in include/x86/x86-linux.h + o Kexec command line length +- removed kexec-longer-cmdline.diff: fixed mainline differently + +------------------------------------------------------------------- +Wed Feb 20 08:30:37 CET 2008 - bwalle@suse.de + +- update to kexec-tools-testing v20080219-rc + o Fix the feature determining ELF32/ELF64 automatically + o Enable building a 32 bit binary for ppc64 platforms. + o Consolidate BOOTLOADER defines + o Use config.h for defines + o Add gamecube to config.h defines + o removed partially duplicated system headers + o Use general _SRCS and _OBJS, rather and _C_{SRCS, OBJS} and + _S_{SRCS, OBJS} + o build system fixes + o Add documentation on creating include/config.h.in to INSTALL + o Log unknown reloc name instead of its number + o Use zlib if present + o kexec buffer overflow on ppc platform + o sh: Remove hardcoded PAGE_SIZE in NetBSD loader + o Add ARM support to kexec + o Remove some extraneous whitespace + o kexec: Use target linker for purgatory +- removed kexec-tools-elf32-elf64-fix: mainline +- removed kexec-tools.ppc64-32bit-build.patch: mainline +- removed kexec-tools.fread-buffer-overflow.patch: mainline + +------------------------------------------------------------------- +Wed Jan 30 15:17:18 CET 2008 - sassmann@suse.de + +- fix fread buffer overflow on ppc + +------------------------------------------------------------------- +Tue Jan 22 10:14:31 CET 2008 - ro@suse.de + +- update ppc buildreq + +------------------------------------------------------------------- +Fri Nov 30 10:52:03 CET 2007 - bwalle@suse.de + +- fix a problem with automatic determination of ELF32/ELF64 on i386 + +------------------------------------------------------------------- +Tue Oct 30 08:46:49 CET 2007 - bwalle@suse.de + +- update to kexec-tools-testing 20071030 + o vmcoreinfo's address and size + +------------------------------------------------------------------- +Wed Oct 17 08:35:24 CEST 2007 - bwalle@suse.de + +- update to kexec-tools-testing v20071017-rc + o Set alternate location for /proc/iomem on ia64 xen + o debugging output improvements + o Handle malloc() failure in xen_get_nr_phys_cpus() + o Added generic --reuseinitrd option + o ppc64: fix device-tree mem node + o ppc64: fix misaligned cmdline + o ppc64: cleanup get_devtree_details + o ppc64: Add arch specific --reuseinitrd hooks + o ppc64: use kernels slave loop for purgatory + o ppc64: correct @ha relocation +- remove kexec-tools.check_reuse_initrd-close.patch (merged + mainline) + +------------------------------------------------------------------- +Thu Oct 11 16:48:58 CEST 2007 - bwalle@suse.de + +- remove kdump stuff from this package, that's now in the "kexec" + package + +------------------------------------------------------------------- +Wed Aug 29 15:23:58 CEST 2007 - bwalle@suse.de + +- add reset_devices kernel parameter as default + +------------------------------------------------------------------- +Sat Aug 25 22:37:42 CEST 2007 - olh@suse.de + +- do not require kdump-helpers on s390 + +------------------------------------------------------------------- +Fri Jul 27 14:56:14 CEST 2007 - bwalle@suse.de + +- update documentation for deleting all dumps (#302257) + +------------------------------------------------------------------- +Tue Jul 17 07:25:19 CEST 2007 - olh@suse.de + +- workaround gcc code analyzing bug + +------------------------------------------------------------------- +Mon Jul 16 15:33:22 CEST 2007 - olh@suse.de + +- update to kexec-tools-testing b84b87747a16f0afbef6f6802bb794a94f4961d9 + build 32bit powerpc kexec binary for 64bit kernels + +------------------------------------------------------------------- +Fri Jul 6 18:24:12 CEST 2007 - tiwai@suse.de + +- implement a simple status command for kdump init script + +------------------------------------------------------------------- +Tue Jul 3 00:00:18 CEST 2007 - bwalle@suse.de + +- removed 'machvec=dig' workaround from the documentation since + this has been fixed in the kernel (#271158) + +------------------------------------------------------------------- +Fri Jun 22 16:55:27 CEST 2007 - bwalle@suse.de + +- disable -fstack-protector on IA64 since the kdump kernel doesn't + boot with -fstack-protector enabled + +------------------------------------------------------------------- +Thu Jun 21 16:27:33 CEST 2007 - bwalle@suse.de + +- kdump init script: fix handling of spaces in kernel type + +------------------------------------------------------------------- +Wed Jun 13 16:51:53 CEST 2007 - bwalle@suse.de + +- remove KDUMP_KERNELVER="kdump" on x86_64 and i386 since there's + no special "kdump" kernel any more in the default configuration + (i.e. in the .spec file since it's different for the + architectures) + +------------------------------------------------------------------- +Wed Jun 13 15:21:27 CEST 2007 - bwalle@suse.de + +- removed libelf as BuildRequires + +------------------------------------------------------------------- +Mon Jun 11 17:06:07 CEST 2007 - bwalle@suse.de + +- moved copying of dump file to an external package + "kdump-helpers" +- moved kdump-helper which is needed to save dump in initrd + also to kdump-helpers package + +------------------------------------------------------------------- +Tue Apr 24 17:08:20 CEST 2007 - olh@suse.de + +- update to current kexec-tools-testing + add PS3 patches + +------------------------------------------------------------------- +Thu Apr 19 10:55:31 CEST 2007 - bwalle@suse.de + +- fixes in kdump-helper (update to 0.1.2): + o retrieve the disk size before mmap() + o return GENERAL_ERROR if the program cannot be opened + o use symbolic constants for exit values instead of magic numbers + now consistently + o check for correct return value of mmap() instead of NULL + +------------------------------------------------------------------- +Fri Apr 13 13:55:45 CEST 2007 - bwalle@suse.de + +- improved documentation of KDUMP_DUMPDEV (#264050) + +------------------------------------------------------------------- +Mon Apr 2 12:24:46 CEST 2007 - rguenther@suse.de + +- add zlib-devel BuildRequires + +------------------------------------------------------------------- +Tue Mar 20 20:39:13 CET 2007 - bwalle@suse.de + +- fixed script to properly unload kdump on IA64 (where kdump + kernel is the normal kernel) (#256179) + +------------------------------------------------------------------- +Mon Mar 19 10:58:10 CET 2007 - bwalle@suse.de + +- upgrade to latest snapshot + o [IA64] Use EFI_LOADER_DATA for ELF core header (-> needed + because kernel was updated to 2.6.21 on STABLE) + o include latest fixes + +------------------------------------------------------------------- +Wed Mar 14 18:45:27 CET 2007 - tiwai@suse.de + +- add detailed description about dump triggering methods to + README.SUSE (#250134) + +------------------------------------------------------------------- +Wed Mar 14 15:18:06 CET 2007 - tiwai@suse.de + +- improve the check of crash kernel in kdump init script (#252632) + +------------------------------------------------------------------- +Fri Mar 9 21:34:36 CET 2007 - bwalle@suse.de + +- added hint that VGA console doesn't work (#253173) + +------------------------------------------------------------------- +Thu Feb 15 13:44:01 CET 2007 - bwalle@suse.de + +- added setting to print the kdump command line to standard output +- small improvement for the outut message while dumping: last + message always prints 100% if it was sucessful + +------------------------------------------------------------------- +Wed Feb 14 17:16:33 CET 2007 - bwalle@suse.de + +- added KDUMP_VERBOSE option to print progress output while + dumping and to add the kexec call to system log +- added maxcpus=1 as default for KDUMP_COMMANDLINE_APPEND on IA64 +- added --noio as default for KEXEC_OPTIONS on IA64 + +------------------------------------------------------------------- +Tue Feb 13 18:38:52 CET 2007 - bwalle@suse.de + +- align the both start and end address of the ELF core header + to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps + (#214865) + +------------------------------------------------------------------- +Mon Feb 12 10:57:38 CET 2007 - bwalle@suse.de + +- fixed copying, blocksize was wrong (#243058) + +------------------------------------------------------------------- +Sat Feb 10 10:49:31 CET 2007 - schwab@suse.de + +- Fix help string. + +------------------------------------------------------------------- +Fri Feb 9 13:34:41 CET 2007 - bwalle@suse.de + +- fixed overflow error that prints the size from being printed + correctly if the size doesn't fit into an int (#243058) +- improved error handling to make sure that a similar problem as + in #243058 will output a better error message + +------------------------------------------------------------------- +Wed Feb 7 15:42:35 CET 2007 - bwalle@suse.de + +- don't refuse to deinstall kexec-tools if kdump was not configured + (#243081) +- fixed documentation error (/var/log/dump instead of + /var/log/dumps in README.SUSE) + (#239506) + +------------------------------------------------------------------- +Mon Feb 5 12:38:11 CET 2007 - tiwai@suse.de + +- updated to kexec-tools 2007.02.05: + * including last fixes + * fix for ppc64 dynamic memory range allocation (#242075) + +------------------------------------------------------------------- +Fri Feb 2 16:46:35 CET 2007 - bwalle@suse.de + +- fixes overflow on large IA64 systems (#241544) +- added KDUMP_COMMANDLINE_APPEND variable (#241607) +- increase the command line size (#236828) + +------------------------------------------------------------------- +Mon Jan 29 15:41:43 CET 2007 - olh@suse.de + +- do not unload kdump kernel during runlevel changes (#238733) + +------------------------------------------------------------------- +Thu Jan 25 19:28:57 CET 2007 - bwalle@suse.de + +- added documentation for initrd-based kdump saving +- fixed description of KDUMP_IMMEDIATE_REBOOT + +------------------------------------------------------------------- +Wed Jan 24 12:04:55 CET 2007 - tiwai@suse.de + +- fix invalid /proc/vmcore on ppc64 (#238078). + +------------------------------------------------------------------- +Thu Jan 18 15:22:25 CET 2007 - bwalle@suse.de + +- improved documentation as response to #226736 + +------------------------------------------------------------------- +Wed Jan 17 14:32:02 CET 2007 - bwalle@suse.de + +- implemented Initrd based kdump saving + (#301538) + +------------------------------------------------------------------- +Wed Dec 20 10:59:26 CET 2006 - tiwai@suse.de + +- take kexec-tools-testing snapshot-20061219. + o ia64 support + o relocatable kernel support + o lots of cleanups/fixes +- fix manpage and help about -u option (#208710) +- ia64 kdump support (#214865, FATE#301433, FATE#301434) + o add boot argument "CRASH=1" to indicate the crash environment + (for kexec'ing with the same kernel) + o fix kdump init script for ia64, which has only vmlinuz and + uses the same kernel for kdump +- reduce boot options for kdump kernel (#223500) + +------------------------------------------------------------------- +Thu Jul 13 17:39:20 CEST 2006 - tiwai@suse.de + +- fixed the calculation of required disk space in kdump + init script (#192172) +- fix the wrong usage of crash program in README.SUSE + +------------------------------------------------------------------- +Thu Jun 22 15:23:22 CEST 2006 - tiwai@suse.de + +- fix kexec to reserve ACPI NVS area (#179093) +- add more description about chkconfig and kdump service + (#183017) + +------------------------------------------------------------------- +Fri Jun 16 12:24:03 CEST 2006 - tiwai@suse.de + +- add irqpoll boot option for i386 and x86_64 for more robust + kdump (#183017) + +------------------------------------------------------------------- +Thu Jun 1 18:07:35 CEST 2006 - tiwai@suse.de + +- update README.SUSE for more precise description about crash + and debug kernel. + +------------------------------------------------------------------- +Tue May 30 16:03:26 CEST 2006 - tiwai@suse.de + +- ppc64 kdump ELF header fix for power 4 box (#175128). + +------------------------------------------------------------------- +Mon May 22 12:49:01 CEST 2006 - tiwai@suse.de + +- added the missing man page for kexec (#175084). +- add sleep after reboot in kdump init script for avoiding + confliction with script single (#171332) + +------------------------------------------------------------------- +Fri May 19 14:56:15 CEST 2006 - olh@suse.de + +- unconditionally add sysrq=1 for kdump boots, nothing to lose + +------------------------------------------------------------------- +Fri May 19 13:57:15 CEST 2006 - olh@suse.de + +- remove crashkernel= cmdline also if only the size is given + handle m as well as M because memparse() handles both + +------------------------------------------------------------------- +Tue May 2 16:18:57 CEST 2006 - tiwai@suse.de + +- update/improve README.SUSE +- fix the default value in sysconfig.kdump +- add elevator=deadline to the boot parameter of kdump kernel + to save memory footprint (#170591) + +------------------------------------------------------------------- +Fri Apr 28 21:07:49 CEST 2006 - olh@suse.de + +- use df -P to print all data for a mount point in a single line + long device node names will cause 2 lines in df output + +------------------------------------------------------------------- +Wed Apr 26 13:42:38 CEST 2006 - olh@suse.de + +- linux,platform properties were removed from kernel 2.6.17 + assume non-LPAR if some properties do no exist in the device-tree + (164993 - LTC23056) + +------------------------------------------------------------------- +Wed Apr 26 11:47:10 CEST 2006 - olh@suse.de + +- set /proc/sys/kernel/panic_on_oops to actually trigger a dump + +------------------------------------------------------------------- +Wed Mar 8 23:10:24 CET 2006 - olh@suse.de + +- add --args-linux only on intel + copy vmcore with --sparse, maybe it saves a few bytes. + +------------------------------------------------------------------- +Wed Feb 22 16:53:23 CET 2006 - tiwai@suse.de + +- updated to kdump7 patch. + +------------------------------------------------------------------- +Wed Feb 15 11:23:45 CET 2006 - tiwai@suse.de + +- fixed gdb-kdump script (#151001) + +------------------------------------------------------------------- +Mon Feb 13 15:09:58 CET 2006 - tiwai@suse.de + +- fix for ppc64 (#149576) + +------------------------------------------------------------------- +Sun Feb 12 17:58:43 CET 2006 - tiwai@suse.de + +- added the system check before dumping +- added README.SUSE +- added gdb-kdump helper script + +------------------------------------------------------------------- +Thu Feb 9 11:16:35 CET 2006 - tiwai@suse.de + +- fixed Default-Start in kdump init script. +- fixed RequiredStart in sysconfig/kdump. + +------------------------------------------------------------------- +Wed Feb 8 21:57:43 CET 2006 - tiwai@suse.de + +- changed the default values of KDUMP_IMMEDIATE_REBOOT and + KDUMP_RUNLEVEL (#149140). + +------------------------------------------------------------------- +Tue Feb 7 13:16:25 CET 2006 - tiwai@suse.de + +- added missing preun and postun sections. + +------------------------------------------------------------------- +Mon Feb 6 15:22:32 CET 2006 - tiwai@suse.de + +- fixed the messages from kdump to use suse rc macros +- added $KDUMP_RUNLEVEL to /etc/sysconfig/kdump for specifying + the runlevel to boot kdump kernel. +- added /sbin/rckdump +- fixed a typo in kdump init script + +------------------------------------------------------------------- +Fri Feb 3 16:20:13 CET 2006 - tiwai@suse.de + +- sync with mainstream dump6 patch: + most of ppc64 patches were merged there. + new fixes included: vmcore copy fix for x86_64 and ext_mem_k + calculation fix for i386 +- added KEXEC_TRANSFER sysconfig variable for user-defined + dump action. + +------------------------------------------------------------------- +Fri Jan 27 12:13:59 CET 2006 - tiwai@suse.de + +- added kdump init script and sysconfig. + +------------------------------------------------------------------- +Wed Jan 25 21:37:11 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 23 15:02:24 CET 2006 - olh@suse.de + +- update ppc64 kdump support + +------------------------------------------------------------------- +Thu Jan 5 16:37:12 CET 2006 - tiwai@suse.de + +- more fix for ppc64 kdump +- fix malloc size + +------------------------------------------------------------------- +Thu Dec 15 16:09:27 CET 2005 - tiwai@suse.de + +- use the latest kdump patch. + +------------------------------------------------------------------- +Mon Dec 12 14:46:46 CET 2005 - tiwai@suse.de + +- initial version: 1.101 + diff --git a/kexec-tools.keyring b/kexec-tools.keyring new file mode 100644 index 0000000..f1de293 --- /dev/null +++ b/kexec-tools.keyring @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBE7S0JsBEAC2bQSzrFOJxmDJMEjB90vt5tbmio8ZcY1z+0JuL4evVP2V1Xke +3dJMHl8eYj0pv7Wj6rbqVRTSyOYkaRBmqHhNfvYJe79SJg0rm9WjcdboNxhPMPIS +MH9zMhs8V3UlbentImu+nNCdLFRAupaegAnvCMkEmBe3lQO5Syd8Xu6kOtMNSXRq +inANKBxS330PVK8QWbjzu8fdUx+Fz/0aCbsIujo6IY29Nt/DaSuw6Bpd/dlm6zh3 +jbeukJ/j0sAiLPareQB7ZGBez1M0M8tHqT8pew8GBV/vhd3oL3Bt32yMQsb40PA7 +BxCg5bAPUBIa0yJy9ARaOJIU6//FSlyl+cHfoaGw1kHDPG8Z4C/uRzkanqrHiN8G +Y52fDdIw7k6aoWvo40m1YbjmezpTWomA3ltZ23GEdUjsXeRWBRAz6C2hDwok4ofV +Yt7b1WY2i7MgYrcEXBx3ykk/rHQUsdX9YQ5CZOPNXWgQ2dKru8GGq4amTBFojyT9 +shJyInH+rVP51XR6tIL4iMESRUwtAeaEvSfgYi3DW2EvlAKEtL09HgTPKG383bma +CA1rHI0B/o9IJN6+llkMcjo7zoJOGA2NrYCjTCzk5yye5TuENjpQtnrueAFBrLWS +PbWAqa0TJIP21Ta15U+LQdyMYcMzx4STG6HIo1BU26HtZY1YgpXSVra53QARAQAB +tB9TaW1vbiBIb3JtYW4gPGhvcm1zQGRlYmlhbi5vcmc+iQI4BBMBAgAiBQJO0uFN +AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDXz2RpajdPvuWAD/94UGjy +HSEM3Rlf09Aq0bqIT/CYUYVe61Ktqfk+vBdvDeL+tAlt7WCjaIXkGDr5Kvx2lypR +KG7EIDTvX/bNWuHsFL0o0RNdLj+VdiFK8jaQ1ZdYYgg68mdLYWg5iEzWpOf2UI5X +X5NDSJYmWJhNoQAKQcrDaSiSl1KE0GRTbD9lwG6psitk/l8dz77dMuqwMoJ8s/rx +fg8Gtn2FzwD/k7ODXwksGiqJT4Zw6P3lAw29/ejGYIRzDb5lh3SqdKT/us393NAL +12DK1tkK7JeLi+yyzsHtDYDWhbM0qTjwdRohnMIQUdg+6sAOUldaOXRKvr9JNWKz +bTgj6EVUUakKvCYA2ppUWVjjUgLHKu6U3+qnBkA9AbgPfQf9RiBGJj3rC4g2GpTn +4bOIex4QWI+7S66hOyBWAoX9hqVK1kYefOt5k2xH97zFuZqPAbzsJqryES+PP8cV +1qCCxRrF8o+LTnLZpzUB3PP96J7CeSmzgcIjWBQwd0u+9xa00djcpq2F8YI3YnYK +gb0OZfN7xFvOEtXFWH868MBS1gdazSUNlLpjryx6OS5QHr0kc4hQGh7wEfNIHetS +tlBt7hSXiQVs/RDRYttW9ekilkYHhQKaCLQg/wvRDoazcbGpKLILbNYFO/tww5QH +s0PgX6t5hhrqSoype+61PbOKuxa1UGbkunRCDbQeU2ltb24gSG9ybWFuIDxzaW1v +bkBob3Jtcy5uZXQ+iQI4BBMBAgAiBQJO0uE8AhsDBgsJCAcDAgYVCAIJCgsEFgID +AQIeAQIXgAAKCRDXz2RpajdPvgM0D/wJofm/xCspUyDPUiRSuLjQvVwFlwnZURfA +SGUp45rlw+zKncPLguaBGAo18tTIy9rX5EO2y8R0oufVY2DhmopLNuEIDCdIEOyA +nP3sYgYqXmxxbADkHFMlLDtn07hUPuUoPNCFFZ9nytqe0hcVpeU7ZN/Qt2e9n8dn +pyVsw/eQwwyAlwW6wbqfFFJC969/BEWMMozVOLxM13XTvkMZprqI3QfFdd4NsSuh +Y7Jwp937D8nk+sT4VDpuVaMi62WkdGjbqTWxF0PCTEiCog2txWNzIo4PhWXQAgqH +bWveQA9117U9sMI2BWTKmjXbpl48WZayvSam7JPQ2h4DVvhOpwZrIrJ51GUAefn6 +zxJkPedTSro57HYUCIc6P3A2LaaF7+lt938H9eCy9s0Ju3yG7IQMKxH2+g1j/vCA +iKw1F+d8q8LbJKyPa7eg4zSh7OnCsWwCJQtYPCQWgu+OZaA+g4VulWMprv8UfHYd +AImRTMn9VvFK2HinUmfiR3o83NULGYTT/SC3+0TQ/WLtSr0BbgJ/Ibj1puzHhK9Q +A8wGuV9BEmnO3w7IxgJ0uGvgTxtZsM+IlNZKj38g8qHpE9V3AIgDHZQ8Yb8Bzfq+ +Q6g+V16a4tiN55RH//ab3mJY18UyX31mPqfxoAYNAVTlDcbxPUeGjhzMJgr7j7LW +sh6w+z0u0bQhU2ltb24gSG9ybWFuIDxob3Jtc0B2ZXJnZS5uZXQuYXU+iQI4BBMB +AgAiBQJO0tCbAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDXz2RpajdP +vr0tD/9cwP7In2RC/7FQKR8oIHElLU9qXGQgzkknZaJKAp9+kiwVqyPlKlDrQ0qz +BnmiOtDK4c/WpBk8ze30iE7z26on6zKRk0g4uPrpjadvOgx2m+XYa9YvAMnIzsoz +DutdJjUM8Icb7Qk4iz0s1uS2eNyw/ee6WNn8jKXt/iKyDgffCs7qVqJ8bE5IkxH4 +IMGsFtcA2y04KY1iyQCaurppD9+3TLiFQlOJMjuiEsO8s6FdnwCixxII4XKA6CYa +VY3neX4Nnb4Mu42vCuSEiYQEe6Tpe+O8RGgfzAmMS5zFRKz0ZYCzFf/YfEM6aQmE +LnLjt1Ri2O+jddiqjTePVEu+2ATx0W2hr2dXH/ZhZvnv0F2V2c9l0ywEWSRW2njQ +lCzkT3J5YQ8CaHogXF/Osj6coCo9QgGRbPy3T4Akcs8XpNDIy8eDF177mp7jQo96 +Mm2446w0LHPnzumFr9P87CeuWymr/It//SMsfDN6HLh6MRI9aTA0ZirrQ/K7IBAA ++MvM5+pgHja425L4CmfjsJie2F/jwss93quFH1Dj3MUUlvQveez24Lf2hatm2t3e +t66bskEUuMiEi2GsvqoAtky86MNTywKM9krDX/Vald6874Nkf/4cgKCzTGYp2fBk +49dzjIUngnLHqLT134KWHuX+JBqttCdCw5lWpfx7CdYreAsAdbkCDQRO0tCbARAA +vdhCOjynQO6/+jtXrOap6CrE2tjvom5UFc291znL9XT4cpbnw3OxBrM62HgBOaBZ +0Kjzi/pyrZtnpM0lIx9wQVWhTVVeLb5LGP/PCe5TPOG3BFEokE1/DrL1vAvmJFhh +xA0KpvOPWB/YDpDVAXPfCNT28UWn1gPoAUl4+lQBxlRcZf7L+mzFqpei3z32vl1f +M7NZInnRZR67hdEBb2jo1MEAQNhCNfs7mC9ENkQhlsCwFDw/id7DNAOuKDNw3j/e +0fU/z+cL9mHuvK7nP4bUyU5micm3Q7PWse23dCueBxm4STB2Y+fnHijWh33h9a91 +HbFsAqyKxgo39dvuMqh4FNkfXgHCeZ/GszzpOws54eC8Sso1lM9B5ixjPvrh3jVw +5mF7cKPIdiojJ8vsWn0lK0Fv4yCc8cm8boZO5M89np7y2hE5SNUeZJ9NyQudbfGv +8yIBUPqQwEd1XdV8tjT+V24fc1MBe+ZM1m/a5W+/tf1QGBe0cJI9ncZhxrDmm5TD +aP7k8Nth2Mt05JKXpkIQVGUXp2oLiWT2cQQXjrVmcXOKWlPlI4YwXkrBfn4HoITB +24ppTwTtFIOlXzVa7WdfoCYBzy7hQ7mBxALRBbMAvh8yj9jZFEWc9GFHJodkPQ3Q +jBe/B7EoxX4o2AiyoeRnQ9lAAYDl0vEufxV9nI3pLlcAEQEAAYkCHwQYAQIACQUC +TtLQmwIbDAAKCRDXz2RpajdPviq1D/wJN+kmB5mqbMc3wScGqPOyIqWIBk06TPpD +uYpg3+c/AuIFfxM33v3S/N6pivzNnldd7CLQaEdqJfX/Au6insvpKAbXg9pHxwwV +OcskRSNQC9d4mFDESbYSI3HvZzOAEZQrrJRKuxH1KYX16YAWGrSVXmexr1tAucG0 +DXYgSkRzNEkxMmo1EOUBDa2ZnoKsbeaQ5kpLgKsTho3OU0FqJwpbIOmEM4kQb/i8 +irbGSqXOaS3ALZkWynoL0K2qKQG4RzaGPJtZCi6d+WP7503jge+/KjiY0xlwmR82 +3wq6xKUHn6xFwOYV5JYUQH77cNpqy8Pc0t0ikETc51g16KmpAIGFPHCoLvvxWIhk +fifhQEdQmr7arp43bxED6UhxPTpg1RLFKHmCiKIeEhQodnjHH/qIS+By4BcW0dwi +jMgl4O+A12uxGEX+OanBz0ER8pu+LdaTUPy0pHG3aK2b+kn15n3hKDpLHQlmEqNG +ZgI0GOmFfFizZuqUzlAnlCNHhCqCslCjIOgeCF4V73F8rYpAlLNdC44h8nw3JN6n +v2yqBbVxowLjYaz8gE4Hl5LyxndIbgRfjszow01l+Oa6XjVYix6j6UVlbooAcHiN +zi8b45Y1q9d2Bu+sKFFrQP2ADbSDjjPlmX2nhwuJLZ9F7mhkQ/n0aW+KBj0NQ1Rc +qsHVD2+G7g== +=h5iz +-----END PGP PUBLIC KEY BLOCK----- diff --git a/kexec-tools.spec b/kexec-tools.spec new file mode 100644 index 0000000..d57d8c7 --- /dev/null +++ b/kexec-tools.spec @@ -0,0 +1,128 @@ +# +# spec file for package kexec-tools +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +# Temporarily bump version to aid package split +Name: kexec-tools +Version: 2.0.27 +Release: 0 +Summary: Tools for loading replacement kernels into memory +License: GPL-2.0-or-later +Group: System/Kernel +URL: https://projects.horms.net/projects/kexec/ +Source: https://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz +Source1: https://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.sign +Source2: kexec-tools.keyring +Source3: kexec-load.service +Source4: %{name}-rpmlintrc +Patch0: 6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.patch +Patch3: %{name}-disable-test.patch +Patch4: %{name}-vmcoreinfo-in-xen.patch +# https://patchwork.kernel.org/project/linux-riscv/patch/20190416123233.4779-1-mick@ics.forth.gr/ +Patch5: %{name}-riscv64.patch +Patch10: %{name}-SYS_getrandom.patch +Patch11: kexec-dont-use-kexec_file_load-on-xen.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: systemd-rpm-macros +BuildRequires: zlib-devel +#!BuildIgnore: fop +#!BuildIgnore: gcc-PIE +Requires: perl-Bootloader >= 1.6 +Requires(post): suse-module-tools +Requires(postun):suse-module-tools +%{?systemd_requires} +%if 0%{?suse_version} == 1600 +# No Xen +%else +%ifarch x86_64 +BuildRequires: pkgconfig +BuildRequires: xen-devel +%endif +%endif + +%description +Kexec is a user space utility for loading another kernel and asking the +currently running kernel to do something with it. A currently running +kernel may be asked to start the loaded kernel on reboot, or to start +the loaded kernel after it panics. + +%prep +%setup -q -n %{name}-%{version} +%autopatch -p1 + +%build +autoreconf -fvi +export CFLAGS="%{optflags} -fPIC" +export BUILD_CFLAGS="%{optflags}" +export LDFLAGS="-pie" +%configure +%make_build + +%install +%make_install +mkdir -p %{buildroot}/%{_unitdir} +install -m644 %{SOURCE3} %{buildroot}/%{_unitdir} +mkdir -p %{buildroot}/%{_sbindir} +ln -s service %{buildroot}%{_sbindir}/rckexec-load +%if 0%{?suse_version} < 1550 +mkdir -p %{buildroot}/sbin +ln -s %{_sbindir}/kexec %{buildroot}/sbin +%endif + +%post +%service_add_post kexec-load.service +%{?regenerate_initrd_post} + +%postun +%service_del_postun kexec-load.service +%{?regenerate_initrd_post} + +%pre +%service_add_pre kexec-load.service + +%preun +%service_del_preun kexec-load.service + +%posttrans +%{?regenerate_initrd_posttrans} + +# Compatibility cruft +# there is no %license prior to SLE12 +%if %{undefined _defaultlicensedir} +%define license %doc +%else +# filesystem before SLE12 SP3 lacks /usr/share/licenses +%if 0%(test ! -d %{_defaultlicensedir} && echo 1) +%define _defaultlicensedir %{_defaultdocdir} +%endif +%endif +# End of compatibility cruft + +%files +%license COPYING +%doc AUTHORS News TODO doc +%{_mandir}/man*/* +%if 0%{?suse_version} < 1550 +/sbin/kexec +%endif +%{_sbindir}/rckexec-load +%{_sbindir}/kexec +%{_sbindir}/vmcore-dmesg +%{_unitdir}/kexec-load.service + +%changelog