Re: [PATCH 3/3] dracut-module-setup.sh: Install files under
/etc/kdump/{pre.d,post.d} into kdump initramfs
by Kairui Song
On Wed, Nov 6, 2019 at 12:28 PM onitsuka.shinic(a)fujitsu.com
<onitsuka.shinic(a)fujitsu.com> wrote:
>
> 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
Same as in 2/3, I think it's better to find only script files with
executable permission.
> + dracut_install $file
> + 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
If doable, I prefer to introduce as less binary as possible in the initramfs.
This will make find and sort always included in the initramfs, even if
there is no pre/post executable. Which may increase the initrmafs
size unnecessarily.
> +}
> +
> # 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.org
--
Best Regards,
Kairui Song
4 years, 5 months
Re: [PATCH 2/3] kdumpctl: Check the update of the binary and script
files in /etc/kdump/{pre.d,post.d}
by Kairui Song
On Wed, Nov 6, 2019 at 12:27 PM onitsuka.shinic(a)fujitsu.com
<onitsuka.shinic(a)fujitsu.com> wrote:
>
> This patch checks the update of the binary and script files in
> /etc/kdump/{pre.d,post.d} for initramfs of kdump.
> When kdumpd service is started or restarted, initramfs of kdump is recreated
> by new the binary and script files, if the binary and script files in
> /etc/kdump/{pre.d,post.d} are updated.
>
> Signed-off-by: shin-onitsuka <onitsuka.shinic(a)fujitsu.com>
>
> ---
> kdumpctl | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index f75b820..136fd36 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -335,9 +335,19 @@ check_files_modified()
>
> EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2`
> CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2`
> + if [ -d /etc/kdump/post.d ]; then
> + for file in `find /etc/kdump/post.d -type f`; do
Instead of `find /etc/kdump/post.d -type f`, will it be better to only
find executable files? And also only files with *.sh name.
Else if there is some permission problem, it will occur later in
initramfs anyway, better to fail early.
> + POST_FILES="$POST_FILES $file"
> + done
> + fi
> + if [ -d /etc/kdump/pre.d ]; then
> + for file in `find /etc/kdump/pre.d -type f`; do
> + PRE_FILES="$PRE_FILES $file"
> + done
> + fi
> CORE_COLLECTOR=`grep ^core_collector $KDUMP_CONFIG_FILE | cut -d\ -f2`
> CORE_COLLECTOR=`type -P $CORE_COLLECTOR`
> - EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
> + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES $POST_FILES $PRE_FILES"
> CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
> EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
> files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS $CORE_COLLECTOR"
It seems there is a small issue with this design, if the file in
/etc/kdump/{pre.d,post.d} is copied there preserving the timestamp,
then "kdumpctl restart" won't rebuild the initramfs even if the file
is missing in initramfs.
And kdumpctl restart won't check if the commands called by the script
is updated.
--
Best Regards,
Kairui Song
4 years, 5 months
RE: [PATCH 0/3]fix /etc/kdump/{pre.d,post.d} interface to set up
multiple binary and script files
by d.hatayama@fujitsu.com
> -----Original Message-----
> From: onitsuka.shinic(a)fujitsu.com [mailto:onitsuka.shinic@fujitsu.com]
> Sent: Wednesday, November 6, 2019 1:24 PM
> To: kexec(a)lists.fedoraproject.org
> Subject: [PATCH 0/3]fix /etc/kdump/{pre.d,post.d} interface to set up multiple
> binary and script files
>
> There is restriction on kdump_pre and kdump_post directives now that can be
> specified only once in /etc/kdump.conf.
> However, there are multiple components that need to use the directives.
>
> This patch implements /etc/kdump/{pre.d,post.d} interface to set up multiple
> binary and script files.
>
> For example, users put multiple binary and script files under
> /etc/kdump/pre.d directory as below:
>
> # find /etc/kdump/pre.d
> /etc/kdump/pre.d/50-foo.sh
> /etc/kdump/pre.d/75-hoge.sh
>
> Then, 50-foo.sh and 75-hoge.sh are executed in order before kdump dump process
> begins just like kdump_pre directive written in /etc/kdump.conf.
>
> This is composed of the following three patches created based on
> commit 603cd09b76584a1e3a2363f939cec0b7e29e52fb.
>
> shin-onitsuka (3):
> dracut-kdump.sh: Execute the binary and script files in
> /etc/kdump/{pre.d,post.d}.
> kdumpctl: Check the update of the binary and script files in
> /etc/kdump/{pre.d,post.d}
> dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d}
> into kdump initramfs
Maybe, the following order is more natural because it's consistent with
the order of executions:
dracut-module-setup.sh
kdumpctl
dracut-kdump.sh
>
> dracut-kdump.sh | 36 ++++++++++++++++++++++++++++++++++++
> dracut-module-setup.sh | 20 ++++++++++++++++++++
> kdumpctl | 12 +++++++++++-
> 3 files changed, 67 insertions(+), 1 deletion(-)
>
> --
> 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
4 years, 5 months
Re: [PATCH 1/3] dracut-kdump.sh: Execute the binary and script files
in /etc/kdump/{pre.d,post.d}.
by Kairui Song
On Wed, Nov 6, 2019 at 12:26 PM onitsuka.shinic(a)fujitsu.com
<onitsuka.shinic(a)fujitsu.com> wrote:
>
> This patch executes the binary and script files in /etc/kdump/{pre.d,post.d}
> just like kdump_pre or kdump_post directive written in /etc/kdump.conf.
>
> Signed-off-by: shin-onitsuka <onitsuka.shinic(a)fujitsu.com>
>
> ---
> dracut-kdump.sh | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/dracut-kdump.sh b/dracut-kdump.sh
> index 2ae1c7c..51a1f73 100755
> --- a/dracut-kdump.sh
> +++ b/dracut-kdump.sh
> @@ -30,15 +30,51 @@ do_dump()
>
> do_kdump_pre()
> {
> + local _ret
> +
> if [ -n "$KDUMP_PRE" ]; then
> "$KDUMP_PRE"
> + _ret=$?
> + if [ $_ret -ne 0 ]; then
> + echo "kdump: $KDUMP_PRE exited with $_ret status"
> + return $_ret
> + fi
> + fi
> +
> + if [ -d /etc/kdump/pre.d ]; then
> + for file in `find /etc/kdump/pre.d -type f | sort`; do
> + "$file"
> + _ret=$?
> + if [ $_ret -ne 0 ]; then
> + echo "kdump: $file exited with $_ret status"
> + return $_ret
> + fi
> + done
> fi
> }
Currently the behavior is:
# kdump_pre <binary | script>
# - Works like the "kdump_post" directive, but instead of running
# after the dump process, runs immediately before it.
# Exit status of this binary is interpreted as follows:
# 0 - continue with dump process as usual
# non 0 - reboot the system
After this patch, if any one of the scripts in pre.d failed, rest of
the scripts will be skipped, and kdump will reboot the system.
Better to doc this somewhere.
And this whole new thing needs a proper doc too.
>
> do_kdump_post()
> {
> + local _ret
> +
> + if [ -d /etc/kdump/post.d ]; then
> + for file in `find /etc/kdump/post.d -type f | sort`; do
> + "$file" "$1"
> + _ret=$?
> + if [ $_ret -ne 0 ]; then
> + echo "kdump: $file exited with $_ret status"
> + return $_ret
> + fi
> + done
> + fi
> +
> if [ -n "$KDUMP_POST" ]; then
> "$KDUMP_POST" "$1"
> + _ret=$?
> + if [ $_ret -ne 0 ]; then
> + echo "kdump: $KDUMP_POST exited with $_ret status"
> + return $_ret
> + fi
> fi
> }
>
> --
> 1.8.3.1
--
Best Regards,
Kairui Song
4 years, 5 months
Re: [PATCH 0/3]fix /etc/kdump/{pre.d,post.d} interface to set up
multiple binary and script files
by Kairui Song
On Wed, Nov 6, 2019 at 12:24 PM onitsuka.shinic(a)fujitsu.com
<onitsuka.shinic(a)fujitsu.com> wrote:
>
> There is restriction on kdump_pre and kdump_post directives now that can be
> specified only once in /etc/kdump.conf.
> However, there are multiple components that need to use the directives.
>
> This patch implements /etc/kdump/{pre.d,post.d} interface to set up multiple
> binary and script files.
>
> For example, users put multiple binary and script files under
> /etc/kdump/pre.d directory as below:
>
> # find /etc/kdump/pre.d
> /etc/kdump/pre.d/50-foo.sh
> /etc/kdump/pre.d/75-hoge.sh
>
> Then, 50-foo.sh and 75-hoge.sh are executed in order before kdump dump process
> begins just like kdump_pre directive written in /etc/kdump.conf.
>
> This is composed of the following three patches created based on
> commit 603cd09b76584a1e3a2363f939cec0b7e29e52fb.
>
> shin-onitsuka (3):
> dracut-kdump.sh: Execute the binary and script files in
> /etc/kdump/{pre.d,post.d}.
> kdumpctl: Check the update of the binary and script files in
> /etc/kdump/{pre.d,post.d}
> dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d}
> into kdump initramfs
>
> dracut-kdump.sh | 36 ++++++++++++++++++++++++++++++++++++
> dracut-module-setup.sh | 20 ++++++++++++++++++++
> kdumpctl | 12 +++++++++++-
> 3 files changed, 67 insertions(+), 1 deletion(-)
>
> --
> 1.8.3.1
Hi, thanks for the patch, I think this is a good idea. The title is a
bit confusing, you are not fixing it, but introduce a new feature. I
also added some comments for the patches.
Not sure if other people have any other concerns about this.
--
Best Regards,
Kairui Song
4 years, 5 months
[PATCH] Always set vm.zone_reclaim_mode = 3 in kdump kernel
by Kairui Song
By default kernel have vm.zone_reclaim_mode = 0 and large page
allocation might fail as kernel is very conservative on memory
reclaiming. If the page allocation failure is not handled carefully
it could lead to more serious problems.
This issue can be reproduced by change with following steps:
- Fill up page cache use:
# dd if=/dev/urandom of=/test bs=1M count=1300
- Now the memory is filled with write cache:
# free -m
total used free shared buff/cache available
Mem: 1790 184 132 2 1473 1348
Swap: 2119 7 2112
- Insert a module which simply calls "kmalloc(SZ_1M, GFP_KERNEL)" for
512 times: (Notice: vmalloc don't have such problem)
# insmod debug_module.ko
- Got following allocation failure:
insmod: page allocation failure: order:8, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0
- Clean up and repeat again with vm.zone_reclaim_mode = 3, OOM is not
observed.
In kdump kernel there is usually only one online CPU and limited memory,
so we set vm.zone_reclaim_mode = 3 to let kernel reclaim memory more
aggresively to avoid such issue.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-module-setup.sh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 37aaa80..e6358a8 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -537,16 +537,18 @@ kdump_install_conf() {
rm -f ${initdir}/tmp/$$-kdump.conf
}
-# Default sysctl parameters should suffice for kdump kernel.
-# Remove custom configurations sysctl.conf & sysctl.d/*
-remove_sysctl_conf() {
-
+# Remove user custom configurations sysctl.conf & sysctl.d/*
+# and apply some optimization for kdump
+overwrite_sysctl_conf() {
# As custom configurations like vm.min_free_kbytes can lead
# to OOM issues in kdump kernel, avoid them
rm -f "${initdir}/etc/sysctl.conf"
rm -rf "${initdir}/etc/sysctl.d"
rm -rf "${initdir}/run/sysctl.d"
rm -rf "${initdir}/usr/lib/sysctl.d"
+
+ mkdir -p "${initdir}/etc/sysctl.d"
+ echo "vm.zone_reclaim_mode = 3" > "${initdir}/etc/sysctl.d/99-zone-reclaim.conf"
}
kdump_iscsi_get_rec_val() {
@@ -812,7 +814,7 @@ kdump_install_random_seed() {
install() {
kdump_install_conf
- remove_sysctl_conf
+ overwrite_sysctl_conf
if is_ssh_dump_target; then
kdump_install_random_seed
--
2.23.0
4 years, 5 months
[PATCH] kdumpctl: make reload fail proof
by Hari Bathini
When large amount of memory, about 1TB, is removed with DLPAR memory
remove operation, kdump reload could fail due to race condition with
device tree property update. In such scenario, the subsequent kdump
reload requests would also fail as reload() only proceeds if current
load status is active. Since the possibility of this race condition
couldn't be wished away due to the nature of the scenario, workaround
it by proceeding to load even if current load status is not active as
long as kdump service is active, which kdump udev rules already check
for.
Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
---
kdumpctl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 048e9f5..2d21a41 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1116,8 +1116,7 @@ reload()
{
check_current_status
if [ $? -ne 0 ]; then
- echo "Kdump is not running: [WARNING]"
- return 0
+ echo "Kdump was not running: [WARNING]"
fi
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
4 years, 5 months
Re: [PATCH] Don't execute final_action if failure_action terminates
the system
by Kairui Song
On Tue, Nov 5, 2019 at 8:37 PM d.hatayama(a)fujitsu.com
<d.hatayama(a)fujitsu.com> wrote:
> > -----Original Message-----
> > From: Kairui Song [mailto:kasong@redhat.com]
> > Sent: Wednesday, October 30, 2019 6:35 PM
> > To: kexec(a)lists.fedoraproject.org
> > Cc: Pingfan Liu <piliu(a)redhat.com>; Dave Young <dyoung(a)redhat.com>; Hatayama,
> > Daisuke/畑山 大輔 <d.hatayama(a)fujitsu.com>; Kairui Song <kasong(a)redhat.com>
> > Subject: [PATCH] Don't execute final_action if failure_action terminates the
> > system
> >
> > If failure_action is shutdown/reboot/halt, final_action is pointless as
> > the system will be already stopping. And if final_action is different
> > from failure_action, it will trigger a systemd race problem and cause
> > unexpected behavior to occur.
> >
> > So let the error handler stop and exit after performing failure_action
> > successfully if failure_action is one of shutdown/reboot/halt.
> > This way, final_action will not be executed.
> >
> > Signed-off-by: Kairui Song <kasong(a)redhat.com>
> > ---
> > kdump-lib-initramfs.sh | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
> > index c409dce..8530556 100755
> > --- a/kdump-lib-initramfs.sh
> > +++ b/kdump-lib-initramfs.sh
> > @@ -56,13 +56,13 @@ get_kdump_confs()
> > FAILURE_ACTION="kdump_emergency_shell"
> > ;;
> > reboot)
> > - FAILURE_ACTION="systemctl reboot -f"
> > + FAILURE_ACTION="systemctl reboot -f && exit"
>
> Can -f option here also be removed?
>
> > ;;
> > halt)
> > - FAILURE_ACTION="halt"
> > + FAILURE_ACTION="halt && exit"
>
> It's better to replace halt with systemctl halt as suggested by Dave.
>
> > ;;
> > poweroff)
> > - FAILURE_ACTION="systemctl poweroff -f"
> > + FAILURE_ACTION="systemctl poweroff -f && exit"
>
> Ditto.
>
> I also checked the behavior when FAILURE_ACTION="exit" for in case, i.e.
> the situation where shutdown/halt/reboot doesn't work well for some reason
> even though it terminates with successful exit status.
> The result is infinite loop like:
>
> kdump-capture.serviec pulls in emergency.target on failrue
> => emergency.target pulls in emergency.service
> => emergency.service isolates kdump-error-handler.service
> => kdump-error-handler.service isolates default.target (= initrd.target) on ExecStopPost=
> => initrd.target pulls in kdump-capture.service
>
> I think there is a room to improve this design in another work.
>
Good suggestions.
Maye it's a good idea to let ExecStopPost= repeat the final_action again?
--
Best Regards,
Kairui Song
4 years, 5 months
[PATCH] spec: move binaries from /sbin to /usr/sbin
by Pingfan Liu
Before this patch
$rpm -ql kexec-tools | grep sbin
/sbin/kexec
/sbin/makedumpfile
/sbin/mkdumprd
/sbin/vmcore-dmesg
After this patch
$rpm -ql kexec-tools | grep sbin
/usr/sbin/kexec
/usr/sbin/makedumpfile
/usr/sbin/mkdumprd
/usr/sbin/vmcore-dmesg
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kexec-tools.spec | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 2881615..f8d4c1c 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -138,7 +138,7 @@ autoreconf
--host=powerpc64le-redhat-linux-gnu \
--build=powerpc64le-redhat-linux-gnu \
%endif
- --sbindir=/sbin
+ --sbindir=/usr/sbin
rm -f kexec-tools.spec.in
# setup the docs
cp %{SOURCE10} .
@@ -154,7 +154,7 @@ make -C makedumpfile-%{mkdf_ver} LDFLAGS="$LDFLAGS -I../eppic-%{eppic_ver}/libep
%endif
%install
-mkdir -p -m755 $RPM_BUILD_ROOT/sbin
+mkdir -p -m755 $RPM_BUILD_ROOT/usr/sbin
mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
mkdir -p -m755 $RPM_BUILD_ROOT%{_localstatedir}/crash
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/
@@ -168,8 +168,8 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
-install -m 755 build/sbin/kexec $RPM_BUILD_ROOT/sbin/kexec
-install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/sbin/vmcore-dmesg
+install -m 755 build/sbin/kexec $RPM_BUILD_ROOT/usr/sbin/kexec
+install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/usr/sbin/vmcore-dmesg
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/
@@ -178,7 +178,7 @@ SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig
install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
-install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/sbin/mkdumprd
+install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
@@ -201,7 +201,7 @@ 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
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile
+install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
@@ -306,12 +306,12 @@ do
done
%files
-/sbin/kexec
+/usr/sbin/kexec
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
-/sbin/makedumpfile
+/usr/sbin/makedumpfile
%endif
-/sbin/mkdumprd
-/sbin/vmcore-dmesg
+/usr/sbin/mkdumprd
+/usr/sbin/vmcore-dmesg
%{_bindir}/*
%{_datadir}/kdump
%{_prefix}/lib/kdump
--
2.20.1
4 years, 5 months
[PATCH 3/3] dracut-module-setup.sh: Install files under
/etc/kdump/{pre.d,post.d} into kdump initramfs
by onitsuka.shinic@fujitsu.com
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
+ 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
4 years, 5 months