Hi Coiby,
wow, the spec files now look a lot better. There are a few nits but
mostly just typos (or me not understanding things). Thanks for taking
care of this!
On Tue, 19 Sep 2023 12:15:49 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
Related:
https://bugzilla.redhat.com/show_bug.cgi?id=2121912
This patch splits current kexec-tools into three packages kexec-tools,
kdump-utils and makedumpfile.
- the new kexec-tools is the same to the upstream kexec-tools which
provides the kexec and vmcore-dmesg binaries
- kdump-utils is responsible for building the kdump initrd and loading
it via the kexec binary
- makedumpfile is responsible for making a small dumpfile of vmcore
It's desirable to make this package modular because 1) now there is a
growing user base to use the kexec reboot 2) packaging makedumpfile and
kexec-tools alone will reduce the maintenance work.
When an old version of kexec-tools gets replaced by kdump-utils,
"%system_post" will be executed in the post scriptlet and the
^^^^^^^^^^^^ ^^^
s/%system_post/%systemd_post/
s/and the purpose is/which has the purpose/ ?
purpose is to "systemctl preset kdump" for freshly
installed
kexec-tools. But in the case of kdump-utils replacing kexec-tools, it
is not needed so skip this case.
"dnf repoquery --whatrequires kexec-tools" shows the following packages
requires kexec-tools,
- abrt-addon-vmcore
- anaconda-install-env-deps
- cockpit-kdump
- dracut-kiwi-oem-dump
- realtime-setup
- retrace-server
For those packages that need kdump, the dependency needs to point to
the new kdump-utils package instead.
Note some small improvements are also made in this change,
- stop mkdir'ing kcp as kcp.c has been gone long time ago
- use autosetup to automatically apply patches
- add the GPL2 LICENSE
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
for kdump-utils (the source code of makedumpfile and kexec-tools already
contain the license)
- remove unneeded Obsoletes
- use consistent build flags %make and %make_install (the benefits
include enabling parallel building automatically and avoiding installing
package file one by one)
Cc: fedora-devel(a)lists.fedorahosted.org
Cc: Dusty Mabe <dustymabe(a)redhat.com>
Cc: crash-catcher-owner(a)lists.fedorahosted.org
CC: anaconda-devel(a)lists.fedoraproject.org
Cc: Martin Pitt <mpitt(a)redhat.com>
Cc: kiwi-images(a)googlegroups.com
Cc: Clark Williams <williams(a)redhat.com>
Cc: Matěj Grabovský <mgrabovs(a)redhat.com>
Suggested-by: Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl>
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
v2
- Philipp
- remove unneeded triggerpostun scriptlet that deletes the kdump initrd when a kernel
package is removed
- remove triggerin scriptlet for inexistent kernel-kdump
- fix makedumpfile url error
- explain why %{_localstatedir}/lib/rpm-state/kexec-tools.no-pereset is needed
- remove the makedumpfile patches generated by packit
- kdump-utils uses its own version number
- fix the solution for not "systemctl preset kdump" when kdump-utils replacing
the kexec-tools
- Add a message in kexec-tools.spec to let users know that kexec-tools has been splitted
into three packages.
- use %make_build instead of make
(
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro)
- use updated license from
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt (the
previous one from upstream kexec-tools is outdated)
- drop "Provides kexec-tools" and "Obsoltes kexec-tools" in
kdump-utils.spec to avoid the bug that kdump-utils gets installed without kexec-tools
- drop uneeded archdef definition
- add "BuildRequires: gcc" for kexec-tools which is required
https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/
v1
- Zbigniew
- Use Provides correctly
- use one-per-line for BuildRequires, Requires and etc.
- don't change kdump.service state unexpectedly
- further split out makedumpfile [Philipp]
- s/kdump-tools/kdump-utils to have a unique name [Dave]
---
COPYING | 339 ++++++++++++++++++++++++++++++++++++++++
kdump-utils.spec | 291 +++++++++++++++++++++++++++++++++++
kexec-tools.spec | 384 +++-------------------------------------------
makedumpfile.spec | 63 ++++++++
4 files changed, 714 insertions(+), 363 deletions(-)
create mode 100644 COPYING
create mode 100644 kdump-utils.spec
create mode 100644 makedumpfile.spec
diff --git a/COPYING b/COPYING
new file mode 100644
index 00000000..d159169d
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
[...]
diff --git a/kdump-utils.spec b/kdump-utils.spec
new file mode 100644
index 00000000..a549acc0
--- /dev/null
+++ b/kdump-utils.spec
@@ -0,0 +1,291 @@
+Name: kdump-utils
+Version: 1.0.42
+Release: 1%{?dist}
+Summary: Kernel crash dump collection tools
+
+License: GPL-2.0-only
+%ifarch ppc64 ppc64le
+Requires(post): servicelog
+Recommends: keyutils
+%endif
+Requires(pre): coreutils
+Requires(pre): sed
+Requires: kexec-tools >= 2.0.27-1
The kexec-tools version in this patch is 2.0.27-2. I guess that's what
should be used here instead.
+# fedora-review needs to install the package to do the check
+Requires: (makedumpfile or kexec-tools == 2.0.27-1)
Same like above.
In addition, I believe it's just me not understanding how fedora-review
works but haven't you already required kexec-tools 2.0.27-2 above? Or
should it really be -1 here, i.e. the last not split version? But in
that case the content of kdump-utils and kexec-tools are in conflict.
I'm a little bit confused how this line needs to be read...
+Requires: dracut >= 058
+Requires: dracut-network >= 058
+Requires: dracut-squash >= 058
+Requires: ethtool
+Requires: util-linux
+Requires: binutils
+Recommends: grubby
+Recommends: hostname
+BuildRequires: systemd-rpm-macros
+
+%ifnarch s390x
+Requires: systemd-udev%{?_isa}
+%endif
+
+Source1: kdumpctl
+Source2: COPYING
+Source3: gen-kdump-sysconfig.sh
+Source4: gen-kdump-conf.sh
+Source7: mkdumprd
+Source10: kexec-kdump-howto.txt
+Source11: fadump-howto.txt
+Source12: mkdumprd.8
+Source13: 98-kexec.rules
+Source14: 98-kexec.rules.ppc64
+Source15: kdump.conf.5
+Source16: kdump.service
+Source20: kdump-lib.sh
+Source21: kdump-in-cluster-environment.txt
+Source22: kdump-dep-generator.sh
+Source23: kdump-lib-initramfs.sh
+Source25: kdumpctl.8
+Source26: live-image-kdump-howto.txt
+Source27: early-kdump-howto.txt
+Source28: kdump-udev-throttler
+Source30: 60-kdump.install
+Source31: kdump-logger.sh
+Source32: mkfadumprd
+Source33: 92-crashkernel.install
+Source34: crashkernel-howto.txt
+Source35: kdump-migrate-action.sh
+Source36: kdump-restart.sh
+Source37: 60-fadump.install
+
+#######################################
+# These are sources for mkdumpramfs
+# Which is currently in development
+#######################################
This comment seems to be out-dated. I believe we can just drop it.
+Source100: dracut-kdump.sh
+Source101: dracut-module-setup.sh
+Source102: dracut-monitor_dd_progress
+Source104: dracut-kdump-emergency.service
+Source106: dracut-kdump-capture.service
+Source107: dracut-kdump-emergency.target
+Source108: dracut-early-kdump.sh
+Source109: dracut-early-kdump-module-setup.sh
+
+Source200: dracut-fadump-init-fadump.sh
+Source201: dracut-fadump-module-setup.sh
+
+%description
+kdump-utils is reponsible for collecting the crash kernel dump. It builds and
+loads the kdump initramfs so when a kernel crashes, the system will boot the
+kdump kernel and initramfs to save the colletecd crash kernel dump to specified
+target.
+
+%build
+# setup the license and docs
+# don't copy the files if they exist otherwise building the packages locally
+# using tools like fedpkg will fail
+if [ ! -e COPYING ]]; then
Not sure if [...] or [[...]] is the preferred style for spec files. But
[...]] definitely looks odd (and failed for me) ;-)
+ cp %{SOURCE2} .
+ cp %{SOURCE10} .
+ cp %{SOURCE11} .
+ cp %{SOURCE21} .
+ cp %{SOURCE26} .
+ cp %{SOURCE27} .
+ cp %{SOURCE34} .
+fi
+
+# Generate sysconfig file
+%{SOURCE3} %{_target_cpu} > kdump.sysconfig
+%{SOURCE4} %{_target_cpu} > kdump.conf
+
+%install
+mkdir -p -m755 $RPM_BUILD_ROOT/usr/sbin
+mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
+mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/kdump
+mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/kdump/pre.d
+mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/kdump/post.d
+mkdir -p -m755 $RPM_BUILD_ROOT%{_localstatedir}/crash
+mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/
+mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/
+mkdir -p -m755 $RPM_BUILD_ROOT%{_docdir}
+mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/kdump
+mkdir -p -m755 $RPM_BUILD_ROOT%{_udevrulesdir}
+mkdir -p $RPM_BUILD_ROOT%{_unitdir}
+mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir}
+mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
+mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump
+mkdir -p -m755 $RPM_BUILD_ROOT%{_sharedstatedir}/kdump
+install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
+
+install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
+install -m 644 kdump.conf $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
+install -m 644 kdump.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
+install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
+install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
+install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
+install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
+install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
+%ifarch ppc64 ppc64le
+install -m 755 %{SOURCE32} $RPM_BUILD_ROOT/usr/sbin/mkfadumprd
+install -m 755 %{SOURCE35} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-migrate-action.sh
+install -m 755 %{SOURCE36} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-restart.sh
+%endif
+%ifnarch s390x
+install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
+%endif
+%ifnarch s390x ppc64 ppc64le
+# For s390x the ELF header is created in the kdump kernel and therefore kexec
+# udev rules are not required
+install -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
+%endif
+%ifarch ppc64 ppc64le
+install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
+install -m 755 -D %{SOURCE37}
$RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/60-fadump.install
+%endif
+install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
+install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
+install -m 755 -D %{SOURCE22}
$RPM_BUILD_ROOT%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh
+install -m 755 -D %{SOURCE30}
$RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/60-kdump.install
+install -m 755 -D %{SOURCE33}
$RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/92-crashkernel.install
After seeing how clean the other two spec files look I'm really
considering if we should add a Makefile. Just so we can use
%make_install...
Anyway I've noticed that there are two occurrences with a hard coded
/usr/sbin which probably should be converted to %{?sbindir} (same for
%files).
In addition you could get rid off some calls to mkdir by adding -D to
the install call. And you could get rid off a few calls to install by
grouping them together using the -t option. But that's pure nit picking
from my side similar to cleaning up the Sources on v1.
+%define remove_dracut_prefix() %(echo -n %1|sed
's/.*dracut-//g')
+%define remove_dracut_early_kdump_prefix() %(echo -n %1|sed
's/.*dracut-early-kdump-//g')
+%define remove_dracut_fadump_prefix() %(echo -n %1|sed 's/.*dracut-fadump-//g')
+
+# deal with dracut modules
+mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase
+cp %{SOURCE100}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE100}}
+cp %{SOURCE101}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE101}}
+cp %{SOURCE102}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE102}}
+cp %{SOURCE104}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE104}}
+cp %{SOURCE106}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE106}}
+cp %{SOURCE107}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE107}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE100}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix
%{SOURCE101}}
+mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump
+cp %{SOURCE108}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_prefix
%{SOURCE108}}
+cp %{SOURCE109}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_early_kdump_prefix
%{SOURCE109}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_prefix
%{SOURCE108}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_early_kdump_prefix
%{SOURCE109}}
+%ifarch ppc64 ppc64le
+mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit
+cp %{SOURCE200}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix
%{SOURCE200}}
+cp %{SOURCE201}
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix
%{SOURCE201}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix
%{SOURCE200}}
+chmod 755
$RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix
%{SOURCE201}}
+%endif
+
+
+%define dracutlibdir %{_prefix}/lib/dracut
+#and move the custom dracut modules to the dracut directory
+mkdir -p $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
+mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/*
$RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
+
+# don't try to systemctl preset the kdump service for old kexec-tools
+#
+#when the old kexec-tools gets removed, this scriptlet will be triggerd to
+# create a file. So later the posttrans script will know there is no need to
+# systemctl preset the kdump service.
+# This solution can be dropped when no users use old version of kexec-tools.
I would prefer if you could add a specific version to the comment.
Otherwise we will forget when no users of the old kexec-tools are
left. Personally I would use this, assuming that the split will get
into F39:
This workaround can be dropped once F40 is released and there is no
more supported update path from the old version of kexec-tools.
+%define kexec_tools_no_preset
%{_localstatedir}/lib/rpm-state/kexec-tools.no-preset
+%triggerin -- kexec-tools < 2.0.27-2
+touch %{kexec_tools_no_preset}
+
+%post
+touch /etc/kdump.conf
+
+%ifarch ppc64 ppc64le
+servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
2>/dev/null
+servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh
--match='refcode="#MIGRATE" and serviceable=0' --type=EVENT
--method=pairs_stdin >/dev/null
+%endif
+
+# This portion of the script is temporary. Its only here
+# to fix up broken boxes that require special settings
+# in /etc/sysconfig/kdump. It will be removed when
+# These systems are fixed.
+
+if [ -d /proc/bus/mckinley ]
+then
+ # This is for HP zx1 machines
+ # They require machvec=dig on the kernel command line
+ sed -e's/\(^KDUMP_COMMANDLINE_APPEND.*\)\("$\)/\1 machvec=dig"/' \
+ /etc/sysconfig/kdump > /etc/sysconfig/kdump.new
+ mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
+elif [ -d /proc/sgi_sn ]
+then
+ # This is for SGI SN boxes
+ # They require the --noio option to kexec
+ # since they don't support legacy io
+ sed -e's/\(^KEXEC_ARGS.*\)\("$\)/\1 --noio"/' \
+ /etc/sysconfig/kdump > /etc/sysconfig/kdump.new
+ mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
+fi
+
+
+%postun
+%systemd_postun_with_restart kdump.service
+
+%preun
+%ifarch ppc64 ppc64le
+servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
>/dev/null
+%endif
+%systemd_preun kdump.service
+
+%posttrans
+# don't try to systemctl preset the kdump service for old kexec-tools
+if [[ -f %{kexec_tools_no_preset} ]]; then
+ # this if branch can be removed when no users use the old kexec-tools
Same like above. I would prefer if you could add a specific version.
+ rm %{kexec_tools_no_preset}
+else
+ # Initial installation
+ %systemd_post kdump.service
+fi
+# Try to reset kernel crashkernel value to new default value or set up
+# crasherkernel value for new install
+#
+# Note
+# 1. Skip ostree systems as they are not supported.
+# 2. For Fedora 36 and RHEL9, "[ $1 == 1 ]" in posttrans scriptlet means both
install and upgrade;
+# For Fedora > 36, "[ $1 == 1 ]" only means install and "[ $1 == 2
]" means upgrade
+if [ ! -f /run/ostree-booted ] && [ $1 == 1 -o $1 == 2 ]; then
+ kdumpctl _reset-crashkernel-after-update
+ :
+fi
+
+%files
+%ifarch ppc64 ppc64le
+/usr/sbin/mkfadumprd
+%{_prefix}/lib/kernel/install.d/60-fadump.install
+%endif
+/usr/sbin/mkdumprd
+%{_bindir}/*
+%{_datadir}/kdump
Some more nit picking. Why do we provide an empty %{_datadir}/kdump?
Can't we just drop it? It's not a problem with your patch. Just
something I've noticed during review...
+%{_prefix}/lib/kdump
+%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
+%config(noreplace,missingok) %verify(not mtime) %{_sysconfdir}/kdump.conf
+%ifnarch s390x
+%config %{_udevrulesdir}
+%{_udevrulesdir}/../kdump-udev-throttler
+%endif
+%{dracutlibdir}/modules.d/*
+%dir %{_localstatedir}/crash
+%dir %{_sysconfdir}/kdump
+%dir %{_sysconfdir}/kdump/pre.d
+%dir %{_sysconfdir}/kdump/post.d
+%dir %{_sharedstatedir}/kdump
+%{_mandir}/man8/kdumpctl.8.gz
+%{_mandir}/man8/mkdumprd.8.gz
+%{_mandir}/man5/*
+%{_unitdir}/kdump.service
+%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh
+%{_prefix}/lib/kernel/install.d/60-kdump.install
+%{_prefix}/lib/kernel/install.d/92-crashkernel.install
+%license COPYING
+%doc kexec-kdump-howto.txt
+%doc early-kdump-howto.txt
+%doc fadump-howto.txt
+%doc kdump-in-cluster-environment.txt
+%doc live-image-kdump-howto.txt
+%doc crashkernel-howto.txt
+
+%changelog
+* Thu Aug 24 2023 Coiby <coxu(a)redhat.com> - 2.0.26-9
+- split from kexec-tools
diff --git a/kexec-tools.spec b/kexec-tools.spec
index ff8b4963..99168db6 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
[...]
@@ -142,260 +32,28 @@ autoreconf
[...]
%post
-# Initial installation
-%systemd_post kdump.service
-
-touch /etc/kdump.conf
-
-%ifarch ppc64 ppc64le
-servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
2>/dev/null
-servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh
--match='refcode="#MIGRATE" and serviceable=0' --type=EVENT
--method=pairs_stdin >/dev/null
-%endif
-
-# This portion of the script is temporary. Its only here
-# to fix up broken boxes that require special settings
-# in /etc/sysconfig/kdump. It will be removed when
-# These systems are fixed.
-
-if [ -d /proc/bus/mckinley ]
-then
- # This is for HP zx1 machines
- # They require machvec=dig on the kernel command line
- sed -e's/\(^KDUMP_COMMANDLINE_APPEND.*\)\("$\)/\1 machvec=dig"/' \
- /etc/sysconfig/kdump > /etc/sysconfig/kdump.new
- mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
-elif [ -d /proc/sgi_sn ]
-then
- # This is for SGI SN boxes
- # They require the --noio option to kexec
- # since they don't support legacy io
- sed -e's/\(^KEXEC_ARGS.*\)\("$\)/\1 --noio"/' \
- /etc/sysconfig/kdump > /etc/sysconfig/kdump.new
- mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
-fi
-
-
-%postun
-%systemd_postun_with_restart kdump.service
-
-%preun
-%ifarch ppc64 ppc64le
-servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
>/dev/null
-%endif
-%systemd_preun kdump.service
-
-%triggerin -- kernel-kdump
-touch %{_sysconfdir}/kdump.conf
-
-
-%triggerpostun -- kernel kernel-xen kernel-debug kernel-PAE kernel-kdump
-# List out the initrds here, strip out version nubmers
-# and search for corresponding kernel installs, if a kernel
-# is not found, remove the corresponding kdump initrd
-
-
-IMGDIR=/boot
-for i in `ls $IMGDIR/initramfs*kdump.img 2>/dev/null`
-do
- KDVER=`echo $i | sed -e's/^.*initramfs-//' -e's/kdump.*$//'`
- if [ ! -e $IMGDIR/vmlinuz-$KDVER ]
- then
- # We have found an initrd with no corresponding kernel
- # so we should be able to remove it
- rm -f $i
- fi
-done
-
-%posttrans
-# Try to reset kernel crashkernel value to new default value or set up
-# crasherkernel value for new install
-#
-# Note
-# 1. Skip ostree systems as they are not supported.
-# 2. For Fedora 36 and RHEL9, "[ $1 == 1 ]" in posttrans scriptlet means both
install and upgrade;
-# For Fedora > 36, "[ $1 == 1 ]" only means install and "[ $1 == 2
]" means upgrade
-if [ ! -f /run/ostree-booted ] && [ $1 == 1 -o $1 == 2 ]; then
- kdumpctl _reset-crashkernel-after-update
- :
-fi
-
+echo "kexec-tools has been splitted into three packages (kump-utils, kexec-tools
and makedumpfile). Please install kdump-utils if you need the kdump feature."
s/has been splitted/was split/
s/kump-utils/kdump-utils/
%files
/usr/sbin/kexec
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-/usr/sbin/makedumpfile
-%endif
-%ifarch ppc64 ppc64le
-/usr/sbin/mkfadumprd
-%{_prefix}/lib/kernel/install.d/60-fadump.install
-%endif
-/usr/sbin/mkdumprd
-/usr/sbin/vmcore-dmesg
-%{_bindir}/*
-%{_datadir}/kdump
-%{_prefix}/lib/kdump
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-%{_sysconfdir}/makedumpfile.conf.sample
-%endif
-%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
-%config(noreplace,missingok) %verify(not mtime) %{_sysconfdir}/kdump.conf
-%ifnarch s390x
-%config %{_udevrulesdir}
-%{_udevrulesdir}/../kdump-udev-throttler
-%endif
-%{dracutlibdir}/modules.d/*
-%dir %{_localstatedir}/crash
-%dir %{_sysconfdir}/kdump
-%dir %{_sysconfdir}/kdump/pre.d
-%dir %{_sysconfdir}/kdump/post.d
-%dir %{_sharedstatedir}/kdump
-%{_mandir}/man8/kdumpctl.8.gz
%{_mandir}/man8/kexec.8.gz
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-%{_mandir}/man8/makedumpfile.8.gz
-%endif
-%{_mandir}/man8/mkdumprd.8.gz
+/usr/sbin/vmcore-dmesg
%{_mandir}/man8/vmcore-dmesg.8.gz
-%{_mandir}/man5/*
-%{_unitdir}/kdump.service
-%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh
-%{_prefix}/lib/kernel/install.d/60-kdump.install
-%{_prefix}/lib/kernel/install.d/92-crashkernel.install
%doc News
%license COPYING
%doc TODO
-%doc kexec-kdump-howto.txt
-%doc early-kdump-howto.txt
-%doc fadump-howto.txt
-%doc kdump-in-cluster-environment.txt
-%doc live-image-kdump-howto.txt
-%doc crashkernel-howto.txt
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-%{_libdir}/eppic_makedumpfile.so
-/usr/share/makedumpfile/
-%endif
%changelog
+* Thu Aug 24 2023 Coiby <coxu(a)redhat.com> - 2.0.26-9
+- split kexec-tools into kexec-tools and kdump-utils
+
* Thu Jul 20 2023 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.0.26-8
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
diff --git a/makedumpfile.spec b/makedumpfile.spec
new file mode 100644
index 00000000..20e7edfd
--- /dev/null
+++ b/makedumpfile.spec
@@ -0,0 +1,63 @@
+%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
+%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
+Name: makedumpfile
+Version: 1.7.3
+Summary: makedumpfile package
+Release: 1%{?dist}
+
+License: GPL-2.0-only
+URL:
https://github.com/makedumpfile/makedumpfile
+Source0:
https://github.com/makedumpfile/makedumpfile/archive/%{version}/%{name}-%...
+Source1:
https://github.com/lucchouina/eppic/archive/%{eppic_ver}/eppic-%{eppic_sh...
+
+Requires(pre): zlib
+BuildRequires: make
+BuildRequires: gcc
+BuildRequires: zlib-devel
+BuildRequires: elfutils-devel
+BuildRequires: glib2-devel
+BuildRequires: bzip2-devel
+BuildRequires: ncurses-devel
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: lzo-devel
+BuildRequires: snappy-devel
+BuildRequires: libzstd-devel
+BuildRequires: pkgconfig
+BuildRequires: intltool
+BuildRequires: gettext
+
+%description
+make a small dumpfile of kdump
The description is pretty short. How about
makedumpfile is a tool to compress and filter out unneeded data from
kernel dumps to reduce its file size. It is typically used with the
kdump mechanism.
+
+%prep
+
Unnecessary new line. At least everywhere else you don't have a new
line when starting a new scriptlet.
Thanks!
Philipp
+%autosetup
+tar -z -x -v -f %{SOURCE1}
+
+%build
+%make_build LINKTYPE=dynamic USELZO=on USESNAPPY=on USEZSTD=on
+%make_build -C eppic-%{eppic_ver}/libeppic
+%make_build LDFLAGS="$LDFLAGS -Ieppic-%{eppic_ver}/libeppic
-Leppic-%{eppic_ver}/libeppic" eppic_makedumpfile.so
+
+%install
+%make_install
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
+install -m 644 makedumpfile.conf
$RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
+rm $RPM_BUILD_ROOT/%{_sbindir}/makedumpfile-R.pl
+
+mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
+install -m 755 eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
+
+%files
+/usr/sbin/makedumpfile
+/usr/share/man/man5/makedumpfile.conf.5.gz
+/usr/share/man/man8/makedumpfile.8.gz
+%{_sysconfdir}/makedumpfile.conf.sample
+%{_libdir}/eppic_makedumpfile.so
+/usr/share/makedumpfile/
+%license COPYING
+
+%changelog
+* Thu Aug 24 2023 Coiby <coxu(a)redhat.com> - 1.7.3-1
+- split from kexec-tools