kexec-tools.spec: make the existence of pre.d and post.d mandatory

If the directory /etc/kdump/pre.d is optional, then it is hard
to tell between the following cases:
  -1. no directory "/etc/kdump/pre.d"
  -2. "rm -rf /etc/kdump/pre.d", which removes all scripts under pre.d
For the second case, kdump.img should be rebuilt.

To bail out from this corner case, always creating pre.d and post.d
during rpm installation.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
Pingfan Liu 2020-07-16 16:50:13 +08:00 committed by Kairui Song
parent 5521a70cc7
commit 8bef2d943b

View File

@ -157,6 +157,9 @@ make -C makedumpfile-%{mkdf_ver} LDFLAGS="$LDFLAGS -I../eppic-%{eppic_ver}/libep
%install %install
mkdir -p -m755 $RPM_BUILD_ROOT/usr/sbin mkdir -p -m755 $RPM_BUILD_ROOT/usr/sbin
mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig 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%{_localstatedir}/crash
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/ mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/ mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/
@ -327,6 +330,9 @@ done
%endif %endif
%{dracutlibdir}/modules.d/* %{dracutlibdir}/modules.d/*
%dir %{_localstatedir}/crash %dir %{_localstatedir}/crash
%dir %{_sysconfdir}/kdump
%dir %{_sysconfdir}/kdump/pre.d
%dir %{_sysconfdir}/kdump/post.d
%{_mandir}/man8/kdumpctl.8.gz %{_mandir}/man8/kdumpctl.8.gz
%{_mandir}/man8/kexec.8.gz %{_mandir}/man8/kexec.8.gz
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64 %ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64