+++ /dev/null
-From 23daba8bb97ff4291447e54859ed759cfe07975e Mon Sep 17 00:00:00 2001
-From: Kairui Song <kasong@redhat.com>
-Date: Wed, 29 Jan 2020 10:48:27 +0800
-Subject: [PATCH] kexec-tools: Remove duplicated variable declarations
-
-When building kexec-tools for Fedora 32, following error is observed:
-
-/usr/bin/ld: kexec/arch/x86_64/kexec-bzImage64.o:(.bss+0x0): multiple definition of `bzImage_support_efi_boot';
-kexec/arch/i386/kexec-bzImage.o:(.bss+0x0): first defined here
-
-/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm/../../fs2dt.h:33: multiple definition of `my_debug';
-kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/kexec/fs2dt.h:33: first defined here
-
-/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:68: multiple definition of `arm64_mem';
-kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:68: first defined here
-
-/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:54: multiple definition of `initrd_size';
-kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:54: first defined here
-
-/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:53: multiple definition of `initrd_base';
-kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:53: first defined here
-
-And apparently, these variables are wrongly declared multiple times. So
-remove duplicated declaration.
-
-Signed-off-by: Kairui Song <kasong@redhat.com>
----
- kexec/arch/arm64/kexec-arm64.h | 6 +++---
- kexec/arch/ppc64/kexec-elf-ppc64.c | 2 --
- kexec/arch/x86_64/kexec-bzImage64.c | 1 -
- kexec/fs2dt.h | 2 +-
- 4 files changed, 4 insertions(+), 7 deletions(-)
-
-diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
-index 628de79..ed447ac 100644
---- a/kexec/arch/arm64/kexec-arm64.h
-+++ b/kexec/arch/arm64/kexec-arm64.h
-@@ -50,8 +50,8 @@ int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
- void zImage_arm64_usage(void);
-
-
--off_t initrd_base;
--off_t initrd_size;
-+extern off_t initrd_base;
-+extern off_t initrd_size;
-
- /**
- * struct arm64_mem - Memory layout info.
-@@ -65,7 +65,7 @@ struct arm64_mem {
- };
-
- #define arm64_mem_ngv UINT64_MAX
--struct arm64_mem arm64_mem;
-+extern struct arm64_mem arm64_mem;
-
- uint64_t get_phys_offset(void);
- uint64_t get_vp_offset(void);
-diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
-index 3510b70..695b8b0 100644
---- a/kexec/arch/ppc64/kexec-elf-ppc64.c
-+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
-@@ -44,8 +44,6 @@
- uint64_t initrd_base, initrd_size;
- unsigned char reuse_initrd = 0;
- const char *ramdisk;
--/* Used for enabling printing message from purgatory code */
--int my_debug = 0;
-
- int elf_ppc64_probe(const char *buf, off_t len)
- {
-diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c
-index 8edb3e4..ba8dc48 100644
---- a/kexec/arch/x86_64/kexec-bzImage64.c
-+++ b/kexec/arch/x86_64/kexec-bzImage64.c
-@@ -42,7 +42,6 @@
- #include <arch/options.h>
-
- static const int probe_debug = 0;
--int bzImage_support_efi_boot;
-
- int bzImage64_probe(const char *buf, off_t len)
- {
-diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h
-index 7633273..fe24931 100644
---- a/kexec/fs2dt.h
-+++ b/kexec/fs2dt.h
-@@ -30,7 +30,7 @@ extern struct bootblock bb[1];
-
- /* Used for enabling printing message from purgatory code
- * Only has implemented for PPC64 */
--int my_debug;
-+extern int my_debug;
- extern int dt_no_old_root;
-
- void reserve(unsigned long long where, unsigned long long length);
---
-2.24.1
-
+++ /dev/null
-From 940c3a1e1a304fbecc850c593a272215b0f52eab Mon Sep 17 00:00:00 2001
-From: Kairui Song <kasong@redhat.com>
-Date: Wed, 31 Jul 2019 16:30:47 +0800
-Subject: [PATCH] x86: Fix broken multiboot2 buliding for i386
-
-When building for i386, an error occured:
-
-kexec/arch/i386/kexec-x86.c:39:22: error: 'multiboot2_x86_probe'
-undeclared here (not in a function); did you mean 'multiboot_x86_probe'?
-39 | { "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
- | ^~~~~~~~~~~~~~~~~~~~
- | multiboot_x86_probe
-
-kexec/arch/i386/kexec-x86.c:39:44: error: 'multiboot2_x86_load'
-undeclared here (not in a function); did you mean 'multiboot_x86_load'?
-39 | { "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
- | ^~~~~~~~~~~~~~~~~~~
- | multiboot_x86_load
-kexec/arch/i386/kexec-x86.c:40:4: error: 'multiboot2_x86_usage'
- undeclared here (not in a function); did you mean 'multiboot_x86_usage'?
-40 | multiboot2_x86_usage },
- | ^~~~~~~~~~~~~~~~~~~~
- | multiboot_x86_usage
-
-Fix this issue by putting the definition in the right header, also tidy
-up Makefile.
-
-Fixes: 22a2ed55132e ("x86: Support multiboot2 images")
-Signed-off-by: Kairui Song <kasong@redhat.com>
----
- kexec/arch/i386/Makefile | 2 +-
- kexec/arch/i386/kexec-x86.h | 5 +++++
- kexec/arch/x86_64/kexec-x86_64.h | 5 -----
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/kexec/arch/i386/Makefile b/kexec/arch/i386/Makefile
-index 105cefd..f486103 100644
---- a/kexec/arch/i386/Makefile
-+++ b/kexec/arch/i386/Makefile
-@@ -7,6 +7,7 @@ i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
- i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
- i386_KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
- i386_KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
-+i386_KEXEC_SRCS += kexec/arch/i386/kexec-mb2-x86.c
- i386_KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
- i386_KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
- i386_KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
-@@ -14,7 +15,6 @@ i386_KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
-
- dist += kexec/arch/i386/Makefile $(i386_KEXEC_SRCS) \
- kexec/arch/i386/crashdump-x86.h \
-- kexec/arch/i386/kexec-mb2-x86.c \
- kexec/arch/i386/kexec-x86.h \
- kexec/arch/i386/x86-linux-setup.h \
- kexec/arch/i386/include/arch/options.h
-diff --git a/kexec/arch/i386/kexec-x86.h b/kexec/arch/i386/kexec-x86.h
-index 1b58c3b..16d0f6c 100644
---- a/kexec/arch/i386/kexec-x86.h
-+++ b/kexec/arch/i386/kexec-x86.h
-@@ -60,6 +60,11 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
- struct kexec_info *info);
- void multiboot_x86_usage(void);
-
-+int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
-+ struct kexec_info *info);
-+void multiboot2_x86_usage(void);
-+int multiboot2_x86_probe(const char *buf, off_t buf_len);
-+
- int elf_x86_probe(const char *buf, off_t len);
- int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
- struct kexec_info *info);
-diff --git a/kexec/arch/x86_64/kexec-x86_64.h b/kexec/arch/x86_64/kexec-x86_64.h
-index 21c3a73..4cdeffb 100644
---- a/kexec/arch/x86_64/kexec-x86_64.h
-+++ b/kexec/arch/x86_64/kexec-x86_64.h
-@@ -33,9 +33,4 @@ int bzImage64_load(int argc, char **argv, const char *buf, off_t len,
- struct kexec_info *info);
- void bzImage64_usage(void);
-
--int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
-- struct kexec_info *info);
--void multiboot2_x86_usage(void);
--int multiboot2_x86_probe(const char *buf, off_t buf_len);
--
- #endif /* KEXEC_X86_64_H */
---
-2.21.0
-
Summary of changes,
-configure.ac: Add test for detect x32 ABI.
-purgatory/arch/x86_64/Makefile: Not use mcmodel large when
- x32 ABI is set.
-kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set
- use ELFCLASS32 instead of ELFCLASS64.
+[...]
kexec/kexec-syscall.h: Add correct syscall number for x32 ABI.
Upstream-Status: Submitted
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
- configure.ac | 9 +++++++++
- kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++
kexec/kexec-syscall.h | 4 ++++
- purgatory/arch/x86_64/Makefile | 4 +++-
- 4 files changed, 20 insertions(+), 1 deletion(-)
+ 1 file changed, 4 insertions(+)
-diff --git a/configure.ac b/configure.ac
-index c410e90..1ecadd5 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -52,6 +52,15 @@ case $target_cpu in
- ;;
- ia64|x86_64|alpha|m68k )
- ARCH="$target_cpu"
-+
-+ dnl ---Test for x32 ABI in x86_64
-+ if test "x$ARCH" = "xx86_64" ; then
-+ AC_EGREP_CPP(x32_test,
-+ [#if defined(__x86_64__) && defined (__ILP32__)
-+ x32_test
-+ #endif
-+ ], SUBARCH='x32', SUBARCH='64')
-+ fi
- ;;
- * )
- AC_MSG_ERROR([unsupported architecture $target_cpu])
-diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
-index c795037..06db7f0 100644
---- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
-+++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
-@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
- if (ehdr->ei_data != ELFDATA2LSB) {
- return 0;
- }
-+#ifdef __ILP32__
-+ if (ehdr->ei_class != ELFCLASS32) {
-+#else
- if (ehdr->ei_class != ELFCLASS64) {
-+#endif
- return 0;
- }
- if (ehdr->e_machine != EM_X86_64) {
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index ce2e20b..cab5535 100644
--- a/kexec/kexec-syscall.h
#ifdef __s390x__
#define __NR_kexec_load 277
#endif
-diff --git a/purgatory/arch/x86_64/Makefile b/purgatory/arch/x86_64/Makefile
-index 7300937..4af11e4 100644
---- a/purgatory/arch/x86_64/Makefile
-+++ b/purgatory/arch/x86_64/Makefile
-@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
- x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
- x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
-
--x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
-+ifeq ($(SUBARCH),64)
-+ x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
-+endif
---
-1.8.4.5
-
Summary: Tool for starting new kernel without reboot
Summary(pl.UTF-8): Narzędzie pozwalające załadować nowe jądro bez konieczności restartu
Name: kexec-tools
-Version: 2.0.20
-Release: 3
+Version: 2.0.21
+Release: 1
License: GPL v2
Group: Applications/System
Source0: https://www.kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
-# Source0-md5: 3b3ee68064648b1b9e86ad93b1c50644
+# Source0-md5: 4a0bbced84e46162d8f8e2c17a0b1466
Source1: kexec.init
Source2: kexec.sysconfig
Patch0: %{name}-xen.patch
-# from http://patchwork.openembedded.org/patch/90971/raw/
+# from http://patchwork.openembedded.org/patch/90971/raw/ (stripped to remaining syscall part)
Patch1: %{name}-x32.patch
-# https://src.fedoraproject.org/rpms/kexec-tools/raw/master/f/kexec-tools-2.0.20-fix-broken-multiboot2-buliding-for-i386.patch
-Patch2: %{name}-fix-broken-multiboot2-buliding-for-i386.patch
-Patch3: gcc10.patch
URL: https://www.kernel.org/pub/linux/utils/kernel/kexec/
BuildRequires: autoconf >= 2.50
BuildRequires: rpmbuild(macros) >= 1.228
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-%patch3 -p1
%build
%{__autoconf}