2007-10-14 04:35:25 +02:00
|
|
|
#
|
2011-06-07 10:49:44 +02:00
|
|
|
# spec file for package kdump
|
2007-10-14 04:35:25 +02:00
|
|
|
#
|
2018-01-16 14:55:27 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-10-14 04:35:25 +02:00
|
|
|
#
|
2008-08-06 01:49:42 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2016-10-05 15:17:08 +02:00
|
|
|
# on systemd distros, rpm-build requires systemd-rpm-macros,
|
|
|
|
# which in turn defines %systemd_requires
|
2018-01-09 16:01:31 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
2016-10-05 15:17:08 +02:00
|
|
|
%define systemd_present %{defined systemd_requires}
|
|
|
|
|
2014-02-28 20:23:14 +01:00
|
|
|
%define dracutlibdir %{_prefix}/lib/dracut
|
2014-03-28 15:03:18 +01:00
|
|
|
|
|
|
|
%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev)}
|
|
|
|
%if "%{_udevdir}" == ""
|
2014-03-28 14:51:14 +01:00
|
|
|
%if 0%{?suse_version} >= 1230
|
2014-03-28 15:03:18 +01:00
|
|
|
%global _udevdir /usr/lib/udev
|
2014-03-28 14:51:14 +01:00
|
|
|
%else
|
2014-03-28 15:03:18 +01:00
|
|
|
%global _udevdir /lib/udev
|
|
|
|
%endif
|
2014-03-28 14:51:14 +01:00
|
|
|
%endif
|
2014-03-28 15:03:18 +01:00
|
|
|
%define _udevrulesdir %{_udevdir}/rules.d
|
2014-02-28 20:23:14 +01:00
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
Name: kdump
|
2016-10-05 12:35:07 +02:00
|
|
|
Version: 0.8.16
|
2012-03-21 11:42:35 +01:00
|
|
|
Release: 0
|
2007-10-14 04:35:25 +02:00
|
|
|
Summary: Script for kdump
|
2012-03-21 11:42:35 +01:00
|
|
|
License: GPL-2.0+
|
2007-10-14 04:35:25 +02:00
|
|
|
Group: System/Kernel
|
2016-10-05 12:35:07 +02:00
|
|
|
Url: https://github.com/ptesarik/kdump
|
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2017-06-14 15:00:33 +02:00
|
|
|
Source1: kernel-ELF-aarch64
|
2016-10-05 12:35:07 +02:00
|
|
|
Source2: %{name}-rpmlintrc
|
|
|
|
Patch1: %{name}-cmake-compat.patch
|
2017-05-16 13:35:29 +02:00
|
|
|
Patch2: %{name}-KDUMP_SSH_IDENTITY.patch
|
|
|
|
Patch3: %{name}-KDUMP_SSH_IDENTITY-cfg.patch
|
2017-05-17 15:47:00 +02:00
|
|
|
Patch4: %{name}-no-xen-secondary-kernel.patch
|
|
|
|
Patch5: %{name}-always-pass-kernelver-to-dracut.patch
|
|
|
|
Patch6: %{name}-pre-generate-mount-units.patch
|
|
|
|
Patch7: %{name}-bind-mount-sysroot.patch
|
|
|
|
Patch8: %{name}-x86_64-kexec-file-syscall.patch
|
2017-06-14 15:00:33 +02:00
|
|
|
Patch9: %{name}-aarch64.patch
|
|
|
|
Patch10: %{name}-fix-service-files.patch
|
|
|
|
Patch11: %{name}-Routable-preferred-source-address.patch
|
|
|
|
Patch12: %{name}-URLTransfer-complete-target.patch
|
|
|
|
Patch13: %{name}-prepend-IP-address.patch
|
2017-06-21 15:22:09 +02:00
|
|
|
Patch14: %{name}-do-not-free-fadump-memory-when-immediate-reboot-is-requested.patch
|
|
|
|
Patch15: %{name}-do-not-check-bind-mount.patch
|
|
|
|
Patch16: %{name}-source-save_dump.patch
|
|
|
|
Patch17: %{name}-remount-sysroot-readwrite.patch
|
2017-06-22 14:49:29 +02:00
|
|
|
Patch18: %{name}-fix-save_dump-to-NFS.patch
|
|
|
|
Patch19: %{name}-invoke-subcommand-destructors-on-exit.patch
|
2017-06-23 14:09:29 +02:00
|
|
|
Patch20: %{name}-move-class-SystemCPU-to-header-file.patch
|
|
|
|
Patch21: %{name}-treat-KDUMP_CPUS-0-as-all-available-CPUs.patch
|
|
|
|
Patch22: %{name}-multithreading-by-default.patch
|
2017-06-23 15:01:43 +02:00
|
|
|
Patch23: %{name}-explicitly-request-zFCP-devices.patch
|
2017-06-26 15:10:25 +02:00
|
|
|
Patch24: %{name}-fail-if-fadump-cannot-be-registered.patch
|
2017-06-29 18:35:58 +02:00
|
|
|
Patch25: %{name}-activate-QETH-devices.patch
|
2017-12-04 16:38:38 +01:00
|
|
|
Patch26: %{name}-Dont-exit-even-if-initrd-is-not-built.patch
|
|
|
|
Patch27: %{name}-Limit-kdump-cpus-to-number-provided-by-config.patch
|
|
|
|
Patch28: %{name}-Don-t-split-by-default.patch
|
2018-01-09 16:01:31 +01:00
|
|
|
Patch29: %{name}-fillupdir-fixes.patch
|
2018-01-16 14:55:27 +01:00
|
|
|
Patch30: %{name}-kdump_echo-and-kdump_logger-helpers.patch
|
|
|
|
Patch31: %{name}-try-both-kexec_load-and-kexec_file_load.patch
|
2018-01-26 14:33:37 +01:00
|
|
|
Patch32: %{name}-fix-m_threads-missing-initialization.patch
|
2018-02-09 09:27:53 +01:00
|
|
|
Patch33: %{name}-calibrate-adjust-sizeof-struct-page.patch
|
|
|
|
Patch34: %{name}-calibrate-update-kernel-text-data-size.patch
|
|
|
|
Patch35: %{name}-calibrate-update-user-space-requirements.patch
|
2012-03-21 11:42:35 +01:00
|
|
|
BuildRequires: asciidoc
|
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gcc-c++
|
2016-10-05 12:35:07 +02:00
|
|
|
BuildRequires: libblkid-devel
|
2012-03-21 11:42:35 +01:00
|
|
|
BuildRequires: libcurl-devel
|
2014-01-13 07:43:33 +01:00
|
|
|
BuildRequires: libelf-devel
|
2008-08-08 02:09:19 +02:00
|
|
|
BuildRequires: libesmtp-devel
|
2013-01-02 16:48:49 +01:00
|
|
|
BuildRequires: libopenssl-devel
|
2012-03-21 11:42:35 +01:00
|
|
|
BuildRequires: libxslt
|
2016-10-05 12:35:07 +02:00
|
|
|
BuildRequires: pkgconfig
|
2014-03-28 14:16:19 +01:00
|
|
|
BuildRequires: udev
|
2012-03-21 11:42:35 +01:00
|
|
|
BuildRequires: zlib-devel
|
2016-10-05 12:35:07 +02:00
|
|
|
Requires: curl
|
|
|
|
Requires: kexec-tools
|
|
|
|
Requires: makedumpfile
|
|
|
|
Requires: openssh
|
2017-03-11 19:37:00 +01:00
|
|
|
PreReq: %fillup_prereq
|
2016-10-05 12:35:07 +02:00
|
|
|
PreReq: coreutils
|
|
|
|
PreReq: sed
|
|
|
|
Recommends: cifs-utils
|
|
|
|
Recommends: nfs-client
|
2008-12-15 14:47:09 +01:00
|
|
|
#!BuildIgnore: fop
|
2016-10-05 12:35:07 +02:00
|
|
|
# update should detect the split-off from kexec-tools
|
|
|
|
Provides: kexec-tools:%{_initddir}/kdump
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
ExcludeArch: s390 ppc
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2013-09-05 14:03:56 +02:00
|
|
|
BuildRequires: systemd
|
2017-03-11 19:37:00 +01:00
|
|
|
%else
|
|
|
|
PreReq: %insserv_prereq
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
2014-07-04 14:00:43 +02:00
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
PreReq: dracut
|
|
|
|
%else
|
|
|
|
PreReq: mkinitrd
|
|
|
|
%endif
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2013-09-05 14:03:56 +02:00
|
|
|
%systemd_requires
|
|
|
|
%endif
|
2007-10-14 04:35:25 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
kdump is a package that includes several scripts for kdump, including
|
2016-10-05 12:35:07 +02:00
|
|
|
the kdump service and configuration files
|
2007-10-14 04:35:25 +02:00
|
|
|
|
2011-06-07 10:49:31 +02:00
|
|
|
The kernel package and this package are all that are required for a
|
|
|
|
crash dump to occur. However, if you wish to debug the crash dump
|
|
|
|
yourself you will need several debugging packages installed for each
|
|
|
|
kernel flavor and release you wish to debug.
|
2007-10-14 04:35:25 +02:00
|
|
|
|
2011-06-07 10:49:31 +02:00
|
|
|
For example, if you are debugging kernel-default, you will need:
|
|
|
|
- kernel-default-debuginfo
|
|
|
|
- kernel-default-devel
|
|
|
|
- kernel-default-devel-debuginfo
|
|
|
|
|
|
|
|
These packages are not needed to create the dump and can be installed
|
|
|
|
after a crash dump has occured.
|
2007-10-14 04:35:25 +02:00
|
|
|
|
|
|
|
%prep
|
2016-10-05 12:35:07 +02:00
|
|
|
%setup -q
|
2014-09-05 14:07:14 +02:00
|
|
|
%patch1 -p1
|
2017-05-16 13:35:29 +02:00
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
2017-05-17 15:47:00 +02:00
|
|
|
%patch4 -p1
|
|
|
|
%patch5 -p1
|
|
|
|
%patch6 -p1
|
|
|
|
%patch7 -p1
|
|
|
|
%patch8 -p1
|
2017-06-14 15:00:33 +02:00
|
|
|
%patch9 -p1
|
|
|
|
cp %{S:1} tests/data/
|
|
|
|
%patch10 -p1
|
|
|
|
%patch11 -p1
|
|
|
|
%patch12 -p1
|
|
|
|
%patch13 -p1
|
2017-06-21 15:22:09 +02:00
|
|
|
%patch14 -p1
|
|
|
|
%patch15 -p1
|
|
|
|
%patch16 -p1
|
|
|
|
%patch17 -p1
|
2017-06-22 14:49:29 +02:00
|
|
|
%patch18 -p1
|
|
|
|
%patch19 -p1
|
2017-06-23 14:09:29 +02:00
|
|
|
%patch20 -p1
|
|
|
|
%patch21 -p1
|
|
|
|
%patch22 -p1
|
2017-06-23 15:01:43 +02:00
|
|
|
%patch23 -p1
|
2017-06-26 15:10:25 +02:00
|
|
|
%patch24 -p1
|
|
|
|
%patch25 -p1
|
2017-12-04 16:38:38 +01:00
|
|
|
%patch26 -p1
|
|
|
|
%patch27 -p1
|
|
|
|
%patch28 -p1
|
2018-01-09 16:01:31 +01:00
|
|
|
%if 0%{?suse_version} >= 1330
|
|
|
|
%patch29 -p1
|
|
|
|
%endif
|
2018-01-16 14:55:27 +01:00
|
|
|
%patch30 -p1
|
|
|
|
%patch31 -p1
|
2018-01-26 14:33:37 +01:00
|
|
|
%patch32 -p1
|
2018-02-09 09:27:53 +01:00
|
|
|
%patch33 -p1
|
|
|
|
%patch34 -p1
|
|
|
|
%patch35 -p1
|
2014-02-14 17:18:09 +01:00
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
%build
|
2016-10-05 12:35:07 +02:00
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
export CXXFLAGS="%{optflags} -std=gnu++98"
|
2008-07-25 01:08:46 +02:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} ..
|
2016-10-05 12:35:07 +02:00
|
|
|
make %{?_smp_mflags}
|
2008-07-25 01:08:46 +02:00
|
|
|
cd -
|
2007-10-14 04:35:25 +02:00
|
|
|
|
2014-03-27 17:04:52 +01:00
|
|
|
%check
|
|
|
|
cd build
|
2016-10-05 12:35:07 +02:00
|
|
|
make %{?_smp_mflags} test
|
2014-03-27 17:04:52 +01:00
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
%install
|
2008-07-25 01:08:46 +02:00
|
|
|
cd build
|
2016-10-05 12:35:07 +02:00
|
|
|
make %{?_smp_mflags} DESTDIR=%{buildroot} install
|
2008-07-25 01:08:46 +02:00
|
|
|
cd -
|
2014-03-28 13:52:01 +01:00
|
|
|
# move udev rules
|
2016-10-05 12:35:07 +02:00
|
|
|
mkdir -p %{buildroot}/%{_udevrulesdir}
|
|
|
|
mv %{buildroot}/%{_sysconfdir}/udev/rules.d/* %{buildroot}/%{_udevrulesdir}/
|
2014-03-28 14:09:25 +01:00
|
|
|
# remove executable bit from non-binaries
|
2016-10-05 12:35:07 +02:00
|
|
|
chmod -x %{buildroot}/lib/kdump/setup-kdump.functions
|
2008-08-23 00:48:34 +02:00
|
|
|
# empty directory
|
2018-01-09 16:01:31 +01:00
|
|
|
mkdir -p %{buildroot}/var/crash
|
2014-07-04 14:00:43 +02:00
|
|
|
%if 0%{?suse_version} > 1310
|
2016-10-05 12:35:07 +02:00
|
|
|
rm -r %{buildroot}/lib/mkinitrd
|
2014-07-04 14:00:43 +02:00
|
|
|
%endif
|
2007-10-14 04:35:25 +02:00
|
|
|
|
2016-10-05 12:35:07 +02:00
|
|
|
# symlink for init script
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2016-10-05 12:35:07 +02:00
|
|
|
rm %{buildroot}%{_initddir}/boot.kdump
|
|
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rckdump
|
|
|
|
%else
|
|
|
|
rm %{buildroot}/usr/lib/systemd/system/kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
rm %{buildroot}/usr/lib/systemd/system/kdump-early.service
|
2016-10-05 12:35:07 +02:00
|
|
|
ln -s ../..%{_initddir}/boot.kdump %{buildroot}%{_sbindir}/rckdump
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
|
|
|
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2013-09-05 14:03:56 +02:00
|
|
|
%pre
|
|
|
|
%service_add_pre kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
%service_add_pre kdump-early.service
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
%post
|
2008-10-22 18:08:54 +02:00
|
|
|
# change only permission if the file exists before /etc/sysconfig/kdump
|
2018-01-09 16:01:31 +01:00
|
|
|
# has been created from %{_fillupdir}/sysconfig.kdump
|
2008-10-22 18:08:54 +02:00
|
|
|
change_permission=0
|
2016-10-05 12:35:07 +02:00
|
|
|
if [ ! -f %{_sysconfdir}/sysconfig/kdump ] ; then
|
2008-10-22 18:08:54 +02:00
|
|
|
change_permission=1
|
|
|
|
fi
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2016-10-05 12:35:07 +02:00
|
|
|
%{fillup_only -n kdump}
|
|
|
|
%service_add_post kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
%service_add_post kdump-early.service
|
2016-10-05 12:35:07 +02:00
|
|
|
%else
|
2008-08-16 00:14:11 +02:00
|
|
|
%{fillup_and_insserv -n kdump boot.kdump}
|
2016-10-05 12:35:07 +02:00
|
|
|
%endif
|
2014-11-09 18:54:50 +01:00
|
|
|
if [ "$change_permission" = 1 ]; then
|
2016-10-05 12:35:07 +02:00
|
|
|
chmod 0600 %{_sysconfdir}/sysconfig/kdump
|
2008-10-22 18:08:54 +02:00
|
|
|
fi
|
2008-08-23 00:48:34 +02:00
|
|
|
# if /var/log/dump is empty, make it a symlink to /var/crash
|
2014-11-09 18:54:50 +01:00
|
|
|
if test -d /var/log/dump && rmdir /var/log/dump >/dev/null 2>&1 ||
|
2008-08-23 00:48:34 +02:00
|
|
|
! test -d /var/log/dump ; then
|
2008-10-28 18:03:03 +01:00
|
|
|
ln -snf /var/crash /var/log/dump
|
2008-08-23 00:48:34 +02:00
|
|
|
fi
|
2007-10-14 04:35:25 +02:00
|
|
|
|
|
|
|
%preun
|
2008-11-11 16:10:10 +01:00
|
|
|
echo "Stopping kdump ..."
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2013-09-05 14:03:56 +02:00
|
|
|
%service_del_preun kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
%service_del_preun kdump-early.service
|
2016-10-05 12:35:07 +02:00
|
|
|
%else
|
|
|
|
%stop_on_removal boot.kdump
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
2007-10-14 04:35:25 +02:00
|
|
|
|
|
|
|
%postun
|
2008-11-20 16:45:01 +01:00
|
|
|
# force regeneration of kdumprd
|
2016-10-05 12:35:07 +02:00
|
|
|
touch %{_sysconfdir}/sysconfig/kdump
|
2008-08-23 00:48:34 +02:00
|
|
|
# delete symbolic link
|
2014-11-09 18:54:50 +01:00
|
|
|
rm /var/log/dump >/dev/null 2>&1 || true
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2016-10-05 12:35:07 +02:00
|
|
|
%service_del_postun kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
%service_del_postun kdump-early.service
|
2016-10-05 12:35:07 +02:00
|
|
|
%else
|
2008-11-20 16:45:01 +01:00
|
|
|
%restart_on_update boot.kdump
|
|
|
|
%insserv_cleanup
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
2007-10-14 04:35:25 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2008-07-25 01:08:46 +02:00
|
|
|
%doc ChangeLog COPYING README NEWS
|
|
|
|
%{_sbindir}/kdumptool
|
|
|
|
%{_sbindir}/mkdumprd
|
2013-09-13 13:03:38 +02:00
|
|
|
%{_sbindir}/kdump-bootloader.pl
|
2016-10-05 12:35:07 +02:00
|
|
|
%{_mandir}/man5/kdump.5%{ext_man}
|
|
|
|
%{_mandir}/man7/kdump.7%{ext_man}
|
|
|
|
%{_mandir}/man8/kdumptool.8%{ext_man}
|
|
|
|
%{_mandir}/man8/mkdumprd.8%{ext_man}
|
2018-01-09 16:01:31 +01:00
|
|
|
%{_fillupdir}/sysconfig.kdump
|
2014-07-04 14:00:43 +02:00
|
|
|
%if 0%{?suse_version} <= 1310
|
2008-07-25 01:08:46 +02:00
|
|
|
/lib/mkinitrd/scripts/*-kdump.sh
|
2013-01-02 16:48:49 +01:00
|
|
|
/lib/mkinitrd/scripts/setup-kdumpfs.sh
|
|
|
|
/lib/mkinitrd/scripts/setup-mkdumprd.sh
|
2014-07-04 14:00:43 +02:00
|
|
|
%endif
|
2014-02-28 20:28:53 +01:00
|
|
|
%dir %{dracutlibdir}
|
|
|
|
%dir %{dracutlibdir}/modules.d
|
2014-03-02 16:35:45 +01:00
|
|
|
%{dracutlibdir}/modules.d/99kdump/
|
2013-09-13 13:03:38 +02:00
|
|
|
%dir /lib/kdump
|
|
|
|
/lib/kdump/*
|
2014-03-28 13:52:01 +01:00
|
|
|
%{_udevrulesdir}/70-kdump.rules
|
2016-10-05 15:17:08 +02:00
|
|
|
%if %{systemd_present}
|
2013-09-05 14:03:56 +02:00
|
|
|
%{_unitdir}/kdump.service
|
2017-06-14 15:00:33 +02:00
|
|
|
%{_unitdir}/kdump-early.service
|
2016-10-05 12:35:07 +02:00
|
|
|
%else
|
|
|
|
%{_sysconfdir}/init.d/boot.kdump
|
2013-09-05 14:03:56 +02:00
|
|
|
%endif
|
2016-10-05 12:35:07 +02:00
|
|
|
%{_sbindir}/rckdump
|
2007-12-12 21:11:02 +01:00
|
|
|
|
2007-10-14 04:35:25 +02:00
|
|
|
%changelog
|