SHA256
1
0
forked from pool/kdump

Accepting request 768202 from Kernel:kdump

OBS-URL: https://build.opensuse.org/request/show/768202
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kdump?expand=0&rev=109
This commit is contained in:
Dominique Leuenberger 2020-02-03 10:11:05 +00:00 committed by Git OBS Bridge
commit 8cb0a0d685
3 changed files with 81 additions and 42 deletions

View File

@ -0,0 +1,45 @@
From 3405c3b3b53f35459f425d7cf3c0ffaf759cade4 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Mon, 27 Jan 2020 17:30:24 +0100
Subject: [PATCH] kdump: activate udev rules late during boot
The kdump udev rule is very broad in scope and may slow down
booting strongly, especially during the coldplug phase where
"add" events for lots of CPU and memory devices have to be
processed. Therefore, activate this rule (which has the purpose
to support real hotplug rather than coldplug) late in the boot
sequence.
---
CMakeLists.txt | 2 +-
init/kdump.service | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f16f532..03eb133 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,7 +206,7 @@ ADD_CUSTOM_TARGET(
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/70-kdump.rules
DESTINATION
- /etc/udev/rules.d
+ /usr/lib/kdump
)
#
diff --git a/init/kdump.service b/init/kdump.service
index 997805f..fb19f84 100644
--- a/init/kdump.service
+++ b/init/kdump.service
@@ -5,6 +5,8 @@ After=local-fs.target network.service YaST2-Second-Stage.service YaST2-Firstboot
[Service]
Type=oneshot
ExecStart=/lib/kdump/load.sh --update
+ExecStartPost=-/usr/bin/cp /usr/lib/kdump/70-kdump.rules /run/udev/rules.d/70-kdump.rules
+ExecStopPost=-/usr/bin/rm -f /run/udev/rules.d/70-kdump.rules
ExecStop=/lib/kdump/unload.sh
RemainAfterExit=true
--
2.25.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 27 16:35:50 UTC 2020 - Martin Wilck <mwilck@suse.com>
- kdump-activate-udev-rules-late-during-boot.patch: Activate
kdump udev rules late during boot (bsc#1154837)
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 17 10:00:30 UTC 2019 - Petr Tesařík <ptesarik@suse.com> Tue Dec 17 10:00:30 UTC 2019 - Petr Tesařík <ptesarik@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package kdump # spec file for package kdump
# #
# Copyright (c) 2019 SUSE LLC # Copyright (c) 2020 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -18,24 +18,14 @@
# on systemd distros, rpm-build requires systemd-rpm-macros, # on systemd distros, rpm-build requires systemd-rpm-macros,
# which in turn defines %systemd_requires # which in turn defines %systemd_requires
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%define systemd_present %{defined systemd_requires} %define systemd_present %{defined systemd_requires}
%define dracutlibdir %{_prefix}/lib/dracut #Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev)} %define dracutlibdir %{_prefix}/lib/dracut
%if "%{_udevdir}" == ""
%if 0%{?suse_version} >= 1230
%global _udevdir /usr/lib/udev
%else
%global _udevdir /lib/udev
%endif
%endif
%define _udevrulesdir %{_udevdir}/rules.d
Name: kdump Name: kdump
Version: 0.9.0 Version: 0.9.0
@ -76,6 +66,7 @@ Patch27: %{name}-Document-fence_kdump_send.patch
Patch28: %{name}-powerpc-no-reload-on-CPU-removal.patch Patch28: %{name}-powerpc-no-reload-on-CPU-removal.patch
Patch29: %{name}-prefer-by-path-and-device-mapper.patch Patch29: %{name}-prefer-by-path-and-device-mapper.patch
Patch30: %{name}-calibrate-Update-values.patch Patch30: %{name}-calibrate-Update-values.patch
Patch31: %{name}-activate-udev-rules-late-during-boot.patch
BuildRequires: asciidoc BuildRequires: asciidoc
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -88,26 +79,27 @@ BuildRequires: libxslt
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: udev BuildRequires: udev
BuildRequires: zlib-devel BuildRequires: zlib-devel
#!BuildIgnore: fop
Requires: curl Requires: curl
Requires: kexec-tools Requires: kexec-tools
Requires: makedumpfile Requires: makedumpfile
Requires: openssh Requires: openssh
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %fillup_prereq PreReq: %fillup_prereq
PreReq: coreutils PreReq: coreutils
PreReq: dracut
PreReq: sed PreReq: sed
Recommends: cifs-utils Recommends: cifs-utils
Recommends: nfs-client Recommends: nfs-client
#!BuildIgnore: fop
# update should detect the split-off from kexec-tools # update should detect the split-off from kexec-tools
Provides: kexec-tools:%{_initddir}/kdump Provides: kexec-tools:%{_initddir}/kdump
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 ppc ExcludeArch: s390 ppc
%if %{systemd_present} %if %{systemd_present}
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
%else %else
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %insserv_prereq PreReq: %insserv_prereq
%endif %endif
PreReq: dracut
%if %{systemd_present} %if %{systemd_present}
%systemd_requires %systemd_requires
%endif %endif
@ -163,6 +155,7 @@ after a crash dump has occured.
%patch28 -p1 %patch28 -p1
%patch29 -p1 %patch29 -p1
%patch30 -p1 %patch30 -p1
%patch31 -p1
%build %build
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
@ -171,31 +164,25 @@ mkdir build
cd build cd build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} .. cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} ..
make %{?_smp_mflags} make %{?_smp_mflags}
cd -
%check %check
cd build cd build
make %{?_smp_mflags} test ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}
%install %install
cd build DESTDIR=%{buildroot} make -C build %{?_smp_mflags} install
make %{?_smp_mflags} DESTDIR=%{buildroot} install
cd -
# move udev rules
mkdir -p %{buildroot}/%{_udevrulesdir}
mv %{buildroot}/%{_sysconfdir}/udev/rules.d/* %{buildroot}/%{_udevrulesdir}/
# remove executable bit from non-binaries # remove executable bit from non-binaries
chmod -x %{buildroot}/lib/kdump/setup-kdump.functions chmod -x %{buildroot}/lib/kdump/setup-kdump.functions
# empty directory # empty directory
mkdir -p %{buildroot}/var/crash mkdir -p %{buildroot}%{_localstatedir}/crash
# symlink for init script # symlink for init script
%if %{systemd_present} %if %{systemd_present}
rm %{buildroot}%{_initddir}/boot.kdump rm %{buildroot}%{_initddir}/boot.kdump
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rckdump ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rckdump
%else %else
rm %{buildroot}/usr/lib/systemd/system/kdump.service rm %{buildroot}%{_prefix}/lib/systemd/system/kdump.service
rm %{buildroot}/usr/lib/systemd/system/kdump-early.service rm %{buildroot}%{_prefix}/lib/systemd/system/kdump-early.service
ln -s ../..%{_initddir}/boot.kdump %{buildroot}%{_sbindir}/rckdump ln -s ../..%{_initddir}/boot.kdump %{buildroot}%{_sbindir}/rckdump
%endif %endif
@ -217,8 +204,8 @@ fi
%service_add_post kdump.service %service_add_post kdump.service
%service_add_post kdump-early.service %service_add_post kdump-early.service
# ensure newly added kdump-early.service is-enabled matches prior state # ensure newly added kdump-early.service is-enabled matches prior state
if [ -x /usr/bin/systemctl ] && /usr/bin/systemctl is-enabled kdump.service &>/dev/null ; then if [ -x %{_bindir}/systemctl ] && %{_bindir}/systemctl is-enabled kdump.service &>/dev/null ; then
/usr/bin/systemctl reenable kdump.service || : %{_bindir}/systemctl reenable kdump.service || :
fi fi
%else %else
%{fillup_and_insserv -n kdump boot.kdump} %{fillup_and_insserv -n kdump boot.kdump}
@ -227,9 +214,9 @@ if [ "$change_permission" = 1 ]; then
chmod 0600 %{_sysconfdir}/sysconfig/kdump chmod 0600 %{_sysconfdir}/sysconfig/kdump
fi fi
# if /var/log/dump is empty, make it a symlink to /var/crash # if /var/log/dump is empty, make it a symlink to /var/crash
if test -d /var/log/dump && rmdir /var/log/dump >/dev/null 2>&1 || if test -d %{_localstatedir}/log/dump && rmdir %{_localstatedir}/log/dump >/dev/null 2>&1 ||
! test -d /var/log/dump ; then ! test -d %{_localstatedir}/log/dump ; then
ln -snf /var/crash /var/log/dump ln -snf %{_localstatedir}/crash %{_localstatedir}/log/dump
fi fi
%preun %preun
@ -245,7 +232,7 @@ echo "Stopping kdump ..."
# force regeneration of kdumprd # force regeneration of kdumprd
touch %{_sysconfdir}/sysconfig/kdump touch %{_sysconfdir}/sysconfig/kdump
# delete symbolic link # delete symbolic link
rm /var/log/dump >/dev/null 2>&1 || true rm %{_localstatedir}/log/dump >/dev/null 2>&1 || true
%if %{systemd_present} %if %{systemd_present}
%service_del_postun kdump.service %service_del_postun kdump.service
%service_del_postun kdump-early.service %service_del_postun kdump-early.service
@ -261,7 +248,7 @@ rm /var/log/dump >/dev/null 2>&1 || true
%else %else
# filesystem before SLE12 SP3 lacks /usr/share/licenses # filesystem before SLE12 SP3 lacks /usr/share/licenses
%if 0%(test ! -d %{_defaultlicensedir} && echo 1) %if 0%(test ! -d %{_defaultlicensedir} && echo 1)
%define _defaultlicensedir %_defaultdocdir %define _defaultlicensedir %{_defaultdocdir}
%endif %endif
%endif %endif
# End of compatibility cruft # End of compatibility cruft
@ -272,17 +259,18 @@ rm /var/log/dump >/dev/null 2>&1 || true
%doc ChangeLog README NEWS %doc ChangeLog README NEWS
%{_sbindir}/kdumptool %{_sbindir}/kdumptool
%{_sbindir}/mkdumprd %{_sbindir}/mkdumprd
%{_mandir}/man5/kdump.5%{ext_man} %{_mandir}/man5/kdump.5%{?ext_man}
%{_mandir}/man7/kdump.7%{ext_man} %{_mandir}/man7/kdump.7%{?ext_man}
%{_mandir}/man8/kdumptool.8%{ext_man} %{_mandir}/man8/kdumptool.8%{?ext_man}
%{_mandir}/man8/mkdumprd.8%{ext_man} %{_mandir}/man8/mkdumprd.8%{?ext_man}
%{_fillupdir}/sysconfig.kdump %{_fillupdir}/sysconfig.kdump
%dir %{dracutlibdir} %dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d %dir %{dracutlibdir}/modules.d
%{dracutlibdir}/modules.d/99kdump/ %{dracutlibdir}/modules.d/99kdump/
%dir /lib/kdump %dir /lib/kdump
/lib/kdump/* /lib/kdump/*
%{_udevrulesdir}/70-kdump.rules %dir /usr/lib/kdump
/usr/lib/kdump/70-kdump.rules
%if %{systemd_present} %if %{systemd_present}
%{_unitdir}/kdump.service %{_unitdir}/kdump.service
%{_unitdir}/kdump-early.service %{_unitdir}/kdump-early.service