1 Star 0 Fork 9

Ming Wang/oc-kexec-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kexec-tools.spec 13.67 KB
一键复制 编辑 原始数据 按行查看 历史
%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
%global mkdf_ver 1.7.2
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Summary: The kexec/kdump userspace component
Name: kexec-tools
Version: 2.0.26
Release: 12%{?dist}
License: GPLv2
Url: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
Source0: http://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
Source1: kdumpctl
Source3: gen-kdump-sysconfig.sh
Source7: mkdumprd
Source8: kdump.conf
Source9: https://github.com/makedumpfile/makedumpfile/archive/%{mkdf_ver}/makedumpfile-%{mkdf_shortver}.tar.gz
Source10: kexec-kdump-howto.txt
Source11: fadump-howto.txt
Source12: mkdumprd.8
Source13: 98-kexec.rules
Source14: 98-kexec.rules.ppc64le
Source15: kdump.conf.5
Source16: kdump.service
Source19: https://github.com/lucchouina/eppic/archive/%{eppic_ver}/eppic-%{eppic_shortver}.tar.gz
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
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
# Kdump post hook for purging old dump
Source901: 99-purge-old-dump.sh
Patch0001: kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch
Patch0002: loongarch64-fix-some-functional-issues-and-compilati.patch
Patch0003: loongarch64-fix-kernel-image-size-error.patch
Patch0004: Fix-Exclude-pages-correctly-in-exclude_nodata_pages.patch
%ifarch ppc64le
Requires(post): servicelog
Recommends: keyutils
%endif
Requires: dracut >= 050
Requires: dracut-network >= 050
Requires: dracut-squash >= 050
Requires: ethtool
Recommends: grubby
Recommends: hostname
Recommends: dash
Recommends: kdump-initrd-systemd
BuildRequires: make bison flex gcc
BuildRequires: ncurses-devel
BuildRequires: zlib-devel elfutils-devel bzip2-devel lzo-devel snappy-devel libzstd-devel
BuildRequires: automake autoconf
BuildRequires: systemd-rpm-macros
Requires: systemd-udev
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
kernel to boot using the kernel's kexec feature either on a
normal or a panic reboot. This package contains the /sbin/kexec
binary and ancillary utilities that together form the userspace
component of the kernel's kexec feature.
%prep
%setup -q
%setup -TDq -a 9
%setup -TDq -a 19
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%build
autoreconf
%configure \
%ifarch ppc64le
--host=%{_target_platform} \
--build=%{_target_platform} \
%endif
--sbindir=/usr/sbin
rm -f kexec-tools.spec.in
# Setup the docs
cp %{SOURCE10} %{SOURCE11} %{SOURCE21} %{SOURCE26} %{SOURCE27} %{SOURCE34} .
# Generate sysconfig file
%{SOURCE3} %{_target_cpu} > kdump.sysconfig
make
%ifnarch loongarch64
make -C eppic-%{eppic_ver}/libeppic
%endif
make -C makedumpfile-%{mkdf_ver} LINKTYPE=dynamic USELZO=on USESNAPPY=on USEZSTD=on
%ifnarch loongarch64
make -C makedumpfile-%{mkdf_ver} LDFLAGS="$LDFLAGS -I../eppic-%{eppic_ver}/libeppic -L../eppic-%{eppic_ver}/libeppic" eppic_makedumpfile.so
%endif
%install
# Basic dirs
mkdir -p -m755 $RPM_BUILD_ROOT%{_localstatedir}/crash
mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/kdump
mkdir -p -m755 $RPM_BUILD_ROOT%{_sharedstatedir}/kdump
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/buildroot
# Binary and scripts
mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_sbindir}
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_sbindir}/mkdumprd
install -m 755 build/sbin/kexec $RPM_BUILD_ROOT%{_sbindir}/kexec
install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT%{_sbindir}/vmcore-dmesg
install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT%{_sbindir}/makedumpfile
%ifarch ppc64le
install -m 755 %{SOURCE32} $RPM_BUILD_ROOT%{_sbindir}/mkfadumprd
%endif
# Configs
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%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
install -m 644 kdump.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
# Man page
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
install -m 644 build/man/man8/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 build/man/man8/vmcore-dmesg.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8 $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5
# Library
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump
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
install -m 755 %{SOURCE901} $RPM_BUILD_ROOT%{_sysconfdir}/kdump/post.d/99-purge-old-dump.sh
%ifarch ppc64le
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
# Udev rules
mkdir -p -m755 $RPM_BUILD_ROOT%{_udevrulesdir}
install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
%ifarch ppc64le
install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
%else
install -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
%endif
# Services and hooks
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
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
%ifnarch loongarch64
# EPPIC
mkdir -p $RPM_BUILD_ROOT%{_datarootdir}/makedumpfile/eppic_scripts/
install -m 755 makedumpfile-%{mkdf_ver}/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
install -m 644 makedumpfile-%{mkdf_ver}/eppic_scripts/* $RPM_BUILD_ROOT%{_datarootdir}/makedumpfile/eppic_scripts/
%endif
# Dracut module
%define dracutlibdir %{_prefix}/lib/dracut
%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')
mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase
install -m 755 %{SOURCE100} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE100}}
install -m 755 %{SOURCE101} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}}
install -m 644 %{SOURCE102} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE102}}
install -m 644 %{SOURCE104} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE104}}
install -m 644 %{SOURCE106} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE106}}
install -m 644 %{SOURCE107} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE107}}
mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump
install -m 755 %{SOURCE108} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_prefix %{SOURCE108}}
install -m 755 %{SOURCE109} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99earlykdump/%{remove_dracut_early_kdump_prefix %{SOURCE109}}
%ifarch ppc64le
mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit
install -m 755 %{SOURCE200} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix %{SOURCE200}}
install -m 755 %{SOURCE201} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpinit/%{remove_dracut_fadump_prefix %{SOURCE201}}
%endif
# 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/
%post
touch /etc/kdump.conf
# Initial installation
%systemd_post kdump.service
%ifarch 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
%endif
%postun
%systemd_postun_with_restart kdump.service
%preun
%ifarch ppc64le
servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
%endif
%systemd_preun kdump.service
%posttrans
# try to reset kernel crashkernel value to new default value when upgrading
# the package
if ! grep -qs "ostree" /proc/cmdline && [ $1 == 1 ]; then
kdumpctl reset-crashkernel-after-update
rm /tmp/old_default_crashkernel 2>/dev/null
%ifarch ppc64le
rm /tmp/old_default_crashkernel_fadump 2>/dev/null
%endif
# dnf would complain about the exit code not being 0. To keep it happy,
# always return 0
:
fi
%files
%license COPYING
%doc News
%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
%{_bindir}/kdumpctl
%{_sbindir}/mkdumprd
%{_sbindir}/kexec
%{_sbindir}/makedumpfile
%{_sbindir}/vmcore-dmesg
%ifarch ppc64le
%{_sbindir}/mkfadumprd
%endif
%{_datadir}/kdump
%{_prefix}/lib/kdump
%dir %{_sysconfdir}/kdump
%dir %{_sysconfdir}/kdump/pre.d
%dir %{_sysconfdir}/kdump/post.d
%{_sysconfdir}/kdump/post.d/99-purge-old-dump.sh
%{_sysconfdir}/makedumpfile.conf.sample
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
%config(noreplace,missingok) %verify(not mtime) %{_sysconfdir}/kdump.conf
%config %{_udevrulesdir}
%{_udevrulesdir}/../kdump-udev-throttler
%dir %{_localstatedir}/crash
%dir %{_sharedstatedir}/kdump
%{_mandir}/man8/kdumpctl.8.gz
%{_mandir}/man8/kexec.8.gz
%{_mandir}/man8/makedumpfile.8.gz
%{_mandir}/man8/mkdumprd.8.gz
%{_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
%ifnarch loongarch64
%{_libdir}/eppic_makedumpfile.so
%{_datarootdir}/makedumpfile/
%endif
%{dracutlibdir}/modules.d/*
%changelog
* Sat Nov 16 2024 Ming Wang <[email protected]> - 2.0.26-12
- LoongArch64: fix loongarch64 kdump start failed
* Thu Oct 10 2024 Ming Wang <[email protected]> - 2.0.26-11
- Fix Exclude pages correctly in exclude_nodata_pages()
* Thu Sep 26 2024 OpenCloudOS Release Engineering <[email protected]> - 2.0.26-10
- Rebuilt for clarifying the packages requirement in BaseOS and AppStream
* Thu Sep 5 2024 Chunsheng Luo <[email protected]> - 2.0.26-9
- Fix changelog format error
* Wed Sep 4 2024 Ming Wang <[email protected]> - 2.0.26-8
- Add /etc/sysconfig/kdump auto generate support and fix some
functional issues
* Fri Aug 16 2024 OpenCloudOS Release Engineering <[email protected]> - 2.0.26-7
- Rebuilt for loongarch release
* Mon Apr 01 2024 Yi Lin <[email protected]> - 2.0.26-6
- remove xz used in mkdumprd, which makes dracut generating
kdump initramfs failed.
* Mon Mar 25 2024 Pengda Dou <[email protected]> - 2.0.26-5
- loongarch64 fix some functional issues and compilation
* Thu Mar 21 2024 Zhongze Hu <[email protected]> - 2.0.26-4
- fix bug: kdump init failed when deleting vmcore save path
* Wed Jan 17 2024 Rebuild Robot <[email protected]> - 2.0.26-3
- Rebuilt for elfutils
* Fri Sep 08 2023 OpenCloudOS Release Engineering <[email protected]> - 2.0.26-2
- Rebuilt for OpenCloudOS Stream 23.09
* Thu Jul 13 2023 Shuo Wang <[email protected]> - 2.0.26-1
- update to 2.0.26
* Fri Apr 28 2023 OpenCloudOS Release Engineering <[email protected]> - 2.0.24-6
- Rebuilt for OpenCloudOS Stream 23.05
* Thu Apr 13 2023 Xiaojie Chen <[email protected]> - 2.0.24-5
- Change the path saving vmcore to /var/crash
* Fri Mar 31 2023 OpenCloudOS Release Engineering <[email protected]> - 2.0.24-4
- Rebuilt for OpenCloudOS Stream 23
* Wed Mar 08 2023 Xiaojie Chen <[email protected]> - 2.0.24-3
- Remove noefi in crashkernel cmdline for aarch64
* Wed Dec 21 2022 Xiaojie Chen <[email protected]> - 2.0.24-2
- Change path saving vmcore to /var/log/crash
* Thu Jun 09 2022 Kairui Song <[email protected]> - 2.0.24-1
- Initial release
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/robinorg/oc-kexec-tools.git
[email protected]:robinorg/oc-kexec-tools.git
robinorg
oc-kexec-tools
oc-kexec-tools
master

搜索帮助