SHA256
1
0
forked from pool/kexec-tools

- update to 2.0.29:

* update man and --help
  * powerpc/kexec_load: add hotplug support
  * kexec_load: Use new kexec flag for hotplug support
  * x86-linux-setup.c: Use POSIX basename API
  * LoongArch: fix load command line segment error
  * LoongArch: add multi crash kernel segment support
  * LoongArch: fix kernel image size error
  * Arm: Fix add_buffer_phys_virt() align issue
  * Fix incorrect Free Software Foundation address in the license
  * util_lib/elf_info.c: fix a warning
  * kexec_file: add kexec_file flag to support debug printing
  * workflow: update to use checkout@v4
- drop kexec-dont-use-kexec_file_load-on-xen.patch, upstream
- drop fix-building-on-x86_64-with-binutils-2.41.patch, upstream
- kexec-tools-riscv-hotplug.patch: Fix build for riscv64.

OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=169
This commit is contained in:
Petr Tesařík 2024-08-12 12:59:55 +00:00 committed by Git OBS Bridge
commit d7aaf5659b
18 changed files with 3704 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,88 @@
From: Michel Lind <salimma@fedoraproject.org>
Subject: Fix building on x86_64 with binutils 2.41
Git-commit: 328de8e00e298f00d7ba6b25dc3950147e9642e6
Patch-mainline:
References:
Acked-by: Jiri Bohac <jbohac@suse.cz>
Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".
Fix by moving ".arch i386" below the relevant ".code32" directive, so
that the assembler is no longer expecting 64-bit instructions to be used
by the time that the ".arch i386" directive is encountered.
Based on similar iPXE fix:
https://github.com/ipxe/ipxe/commit/6ca597eee
Signed-off-by: Michel Lind <michel@michel-slm.name>
Signed-off-by: Simon Horman <horms@kernel.org>
diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
index 5167944..12e1164 100644
--- a/purgatory/arch/i386/entry32-16-debug.S
+++ b/purgatory/arch/i386/entry32-16-debug.S
@@ -25,10 +25,10 @@
.globl entry16_debug_pre32
.globl entry16_debug_first32
.globl entry16_debug_old_first32
- .arch i386
.balign 16
entry16_debug:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
index c051aab..eace095 100644
--- a/purgatory/arch/i386/entry32-16.S
+++ b/purgatory/arch/i386/entry32-16.S
@@ -20,10 +20,10 @@
#undef i386
.text
.globl entry16, entry16_regs
- .arch i386
.balign 16
entry16:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
index f7a494f..8ce9e31 100644
--- a/purgatory/arch/i386/entry32.S
+++ b/purgatory/arch/i386/entry32.S
@@ -20,10 +20,10 @@
#undef i386
.text
- .arch i386
.globl entry32, entry32_regs
entry32:
.code32
+ .arch i386
/* Setup a gdt that should that is generally usefully */
lgdt %cs:gdt
diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
index 201bb2c..a212eed 100644
--- a/purgatory/arch/i386/setup-x86.S
+++ b/purgatory/arch/i386/setup-x86.S
@@ -21,10 +21,10 @@
#undef i386
.text
- .arch i386
.globl purgatory_start
purgatory_start:
.code32
+ .arch i386
/* Load a gdt so I know what the segment registers are */
lgdt %cs:gdt
--
2.43.0

View File

@ -0,0 +1,59 @@
From: Jiri Bohac <jbohac@suse.cz>
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 <jbohac@suse.cz>
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

12
kexec-load.service Normal file
View File

@ -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

BIN
kexec-tools-2.0.28.tar.sign Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2f0ef872f39e2fe4b1b01feb62b0001383207239b9f8041f98a95564161d053
size 312524

BIN
kexec-tools-2.0.29.tar.sign Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67b1ac503aade45a54db0bc79228a8830a35d5d4f83cee932cff3e7a81a4a9ec
size 314576

View File

@ -0,0 +1,64 @@
From: Petr Tesarik <ptesarik@suse.com>
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 <ptesarik@suse.com>
---
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 <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/random.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
@@ -38,6 +37,16 @@
#include "x86-linux-setup.h"
#include "../../kexec/kexec-syscall.h"
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#else
+#include <linux/random.h>
+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

View File

@ -0,0 +1,28 @@
From: Tony Jones <tonyj@suse.de>
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(-)
Index: kexec-tools-2.0.28/Makefile.in
===================================================================
--- kexec-tools-2.0.28.orig/Makefile.in
+++ kexec-tools-2.0.28/Makefile.in
@@ -181,8 +181,11 @@ TARBALL.gz=$(TARBALL).gz
SRCS:= $(dist)
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

View File

@ -0,0 +1,23 @@
From: Petr Tesarik <ptesarik@suse.com>
Subject: riscv: fix build with hotplug support
Upstream: not yet, blocked by base RISC-V patches
Commit 3c47f384f1c4 ("kexec_load: Use new kexec flag for hotplug support")
adds a new architecture-specific function named arch_do_exclude_segment.
Since RISC-V does not yet implement hotplug updates in the kernel, add a
trivial definition of this function to kexec-tools.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Index: kexec-tools-2.0.29/kexec/arch/riscv/kexec-riscv.c
===================================================================
--- kexec-tools-2.0.29.orig/kexec/arch/riscv/kexec-riscv.c
+++ kexec-tools-2.0.29/kexec/arch/riscv/kexec-riscv.c
@@ -362,3 +362,8 @@ int arch_compat_trampoline(struct kexec_
void arch_update_purgatory(struct kexec_info *UNUSED(info))
{
}
+
+int arch_do_exclude_segment(struct kexec_info *UNUSED(info), struct kexec_segment *UNUSED(segment))
+{
+ return 0;
+}

1512
kexec-tools-riscv64.patch Normal file

File diff suppressed because it is too large Load Diff

16
kexec-tools-rpmlintrc Normal file
View File

@ -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:

View File

@ -0,0 +1,79 @@
From: Petr Tesarik <petr@tesarici.cz>
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 <ptesarik@suse.cz>
---
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.
*/

1590
kexec-tools.changes Normal file

File diff suppressed because it is too large Load Diff

76
kexec-tools.keyring Normal file
View File

@ -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+llkMcjo7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FHJodkPQ3Q
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-----

127
kexec-tools.spec Normal file
View File

@ -0,0 +1,127 @@
#
# spec file for package kexec-tools
#
# Copyright (c) 2024 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.29
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
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: %{name}-riscv-hotplug.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