From 4246f26725b723e9d1ab6ec13659f1c95afd8336 Mon Sep 17 00:00:00 2001 From: "onitsuka.shinic@fujitsu.com" Date: Fri, 5 Jun 2020 02:22:35 +0000 Subject: [PATCH] dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d} into kdump initramfs This patch installs the binary and script files under /etc/kdump/{pre.d,post.d} into new initramfs of kdump. Signed-off-by: Shinichi Onitsuka Acked-by: Pingfan Liu --- dracut-module-setup.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index faa918a..90f3772 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -427,6 +427,29 @@ kdump_install_net() { fi } +# install etc/kdump/pre.d and /etc/kdump/post.d +kdump_install_pre_post_conf() { + if [ -d /etc/kdump/pre.d ]; then + for file in /etc/kdump/pre.d/*; do + if [ -x "$file" ]; then + dracut_install $file + else + echo "$file is not executable" + fi + done + fi + + if [ -d /etc/kdump/post.d ]; then + for file in /etc/kdump/post.d/*; do + if [ -x "$file" ]; then + dracut_install $file + else + echo "$file is not executable" + fi + done + fi +} + default_dump_target_install_conf() { local _target _fstype @@ -492,6 +515,8 @@ kdump_install_conf() { esac done <<< "$(read_strip_comments /etc/kdump.conf)" + kdump_install_pre_post_conf + default_dump_target_install_conf kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"