fadump: add a kernel install hook to clean up fadump initramfs
Kdump service will create fadump initramfs when needed, but it won't clean up the fadump initramfs on kernel uninstall. So create a kernel install hook to do the clean up job. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Reviewed-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
parent
25411da966
commit
4a2dcab26a
31
60-fadump.install
Executable file
31
60-fadump.install
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
COMMAND="$1"
|
||||||
|
KERNEL_VERSION="$2"
|
||||||
|
|
||||||
|
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Currently, fadump is supported only in environments with
|
||||||
|
# writable /boot directory.
|
||||||
|
if [[ ! -w "/boot" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
FADUMP_INITRD="/boot/.initramfs-${KERNEL_VERSION}.img.default"
|
||||||
|
FADUMP_INITRD_CHECKSUM="$FADUMP_INITRD.checksum"
|
||||||
|
|
||||||
|
ret=0
|
||||||
|
case "$COMMAND" in
|
||||||
|
add)
|
||||||
|
# Do nothing, fadump initramfs is strictly host only
|
||||||
|
# and managed by kdump service
|
||||||
|
;;
|
||||||
|
remove)
|
||||||
|
rm -f -- "$FADUMP_INITRD"
|
||||||
|
rm -f -- "$FADUMP_INITRD_CHECKSUM"
|
||||||
|
ret=$?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit $ret
|
@ -38,6 +38,7 @@ Source33: 92-crashkernel.install
|
|||||||
Source34: crashkernel-howto.txt
|
Source34: crashkernel-howto.txt
|
||||||
Source35: kdump-migrate-action.sh
|
Source35: kdump-migrate-action.sh
|
||||||
Source36: kdump-restart.sh
|
Source36: kdump-restart.sh
|
||||||
|
Source37: 60-fadump.install
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# These are sources for mkdumpramfs
|
# These are sources for mkdumpramfs
|
||||||
@ -204,6 +205,7 @@ install -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
|
|||||||
%endif
|
%endif
|
||||||
%ifarch ppc64 ppc64le
|
%ifarch ppc64 ppc64le
|
||||||
install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
|
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
|
%endif
|
||||||
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
|
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
|
||||||
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
|
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
|
||||||
@ -366,6 +368,7 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
%ifarch ppc64 ppc64le
|
%ifarch ppc64 ppc64le
|
||||||
/usr/sbin/mkfadumprd
|
/usr/sbin/mkfadumprd
|
||||||
|
%{_prefix}/lib/kernel/install.d/60-fadump.install
|
||||||
%endif
|
%endif
|
||||||
/usr/sbin/mkdumprd
|
/usr/sbin/mkdumprd
|
||||||
/usr/sbin/vmcore-dmesg
|
/usr/sbin/vmcore-dmesg
|
||||||
|
Loading…
Reference in New Issue
Block a user