-----Original Message-----
From: onitsuka.shinic(a)fujitsu.com [mailto:onitsuka.shinic@fujitsu.com]
Sent: Wednesday, November 6, 2019 1:28 PM
To: kexec(a)lists.fedoraproject.org
Subject: [PATCH 3/3] 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: shin-onitsuka <onitsuka.shinic(a)fujitsu.com>
---
dracut-module-setup.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index b186b38..414a184 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -530,6 +530,8 @@ kdump_install_conf() {
esac
done <<< "$(read_strip_comments /etc/kdump.conf)"
+ kdump_install_preafter_conf
+
default_dump_target_install_conf
kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"
@@ -537,6 +539,24 @@ kdump_install_conf() {
rm -f ${initdir}/tmp/$$-kdump.conf
}
+# install etc/kdump/pre.d and /etc/kdump/post.d
+kdump_install_preafter_conf() {
+ if [ -d /etc/kdump/pre.d ]; then
+ for file in `find /etc/kdump/pre.d`; do
+ dracut_install $file
I'm concerned when users put symblic link files under /etc/kdump/pre.d direcotry.
Maybe, only symbolic-link files are included into the kdump initramfs?
As below, there is inst_symlink() in /usr/lib/dracut/dracut-init.sh, and
so I guess it would at least be OK if we use inst_symlink, but
install_multiple() could handle symbolic-link files appropreately.
Could you check the behavior?
inst_symlink() {
local _hostonly_install
if [[ "$1" == "-H" ]]; then
_hostonly_install="-H"
shift
fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -L $1 ]] || return 1
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L
"$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f}
${_hostonly_install:+-H} "$@"
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D
"$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
}
inst_multiple() {
local _ret
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L
"$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f}
"$@"
_ret=$?
(($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D
"$initdir"} -a ${loginstall:+-L "$loginstall"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H}
"$@" || :
return $_ret
}
dracut_install() {
inst_multiple "$@"
}
+ done
+ fi
+
+ if [ -d /etc/kdump/post.d ]; then
+ for file in `find /etc/kdump/post.d`; do
+ dracut_install $file
+ done
+ fi
+
+ dracut_install /usr/bin/find
+ dracut_install /usr/bin/sort
+}
+
# Default sysctl parameters should suffice for kdump kernel.
# Remove custom configurations sysctl.conf & sysctl.d/*
remove_sysctl_conf() {
--
1.8.3.1
_______________________________________________
kexec mailing list -- kexec(a)lists.fedoraproject.org
To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.or
g