[PATCH 0/5] trival fixes and improvement of pre.d/post.d hooks
by Pingfan Liu
Pingfan Liu (5):
kdump.conf: fix grammar
kdumpctl: make the existence of pre.d and post.d mandatory
kdumpctl: rely on the timestamp of scripts' directory to tell
modification
kdumpctl: remove executable checking on pre.d and post.d
module-setup.sh: suppress false alarm
dracut-module-setup.sh | 4 ++--
kdump.conf | 2 +-
kdumpctl | 24 ++++++++++--------------
3 files changed, 13 insertions(+), 17 deletions(-)
--
2.7.5
1 year, 10 months
[PATCH 0/4] use the option KEXEC_ARGS="-s" to enable the kexec file load
by Lianbo Jiang
This series includes four patches:
[1] Revert "kdump-lib: switch to the kexec_file_load() syscall on x86_64 by default"
[2] Revert "s390x: add kdump sysconfig option to use the kexec_file_load() syscall"
[3] x86_64: enable the kexec file load by default
[4] s390x: enable the kexec file load by default
Let's restore the logic of secureboot status check, and remove the
option 'KDUMP_FILE_LOAD=on|off'. We will use the option KEXEC_ARGS="-s"
to enable the kexec file load by default, which can avoid failures when
the secureboot is enabled.
Lianbo Jiang (4):
Revert "kdump-lib: switch to the kexec_file_load() syscall on x86_64
by default"
Revert "s390x: add kdump sysconfig option to use the kexec_file_load()
syscall"
x86_64: enable the kexec file load by default
s390x: enable the kexec file load by default
dracut-early-kdump.sh | 5 ++---
kdump-lib.sh | 29 +++++++++++++++++++++++++++++
kdump.sysconfig.s390x | 8 +-------
kdump.sysconfig.x86_64 | 8 +-------
kdumpctl | 13 ++++++-------
5 files changed, 39 insertions(+), 24 deletions(-)
--
2.17.1
1 year, 10 months
[PATCH] mkdumprd: Improve the error message for umounted dump target
by Kairui Song
Since commit ca01cbd, mkdumprd can generate the initramfs even if dump
target is not mounted. But it will refuse to work if the dump target is
not marked as noauto, and not mounted.
If a target is not marked as noauto in fstab, it should be mounted
automatically on boot. If it's not mounted, most likely something is
wrong and user should fix that. So mkdumprd will just show an error
message and quit to avoid further failure.
This commit make the error message more clear and less confusing.
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index bf816fc..0965cb4 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -222,7 +222,7 @@ check_user_configured_target()
[ $? -ne 0 ] && perror_exit "Failed to mount $_target on $_mnt for kdump preflight check."
_mounted=$_mnt
else
- perror_exit "$_target is configured in fstab but not mounted, please check its usability."
+ perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
fi
fi
else
--
2.26.2
1 year, 11 months
[PATCHv2] man: improve description about /etc/kdump/{pre.d,post.d}interface
by Pingfan Liu
The description is identical to the notes in kdump.conf
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
v1 -> v2: grammar fix: s/is exist/exists/
kdump.conf.5 | 12 ++++++++++++
kexec-kdump-howto.txt | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/kdump.conf.5 b/kdump.conf.5
index 5a0952b..9f2b2b6 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,6 +109,11 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
+If /etc/kdump/post.d directory exists, All files in
+the directory are collectively sorted and executed in
+lexical order, before binary or script specified
+kdump_post parameter is executed.
+.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
.RE
@@ -124,6 +129,13 @@ as follows:
.PP
non 0 - reboot the system
.PP
+If /etc/kdump/pre.d directory exists, all files in
+the directory are collectively sorted and executed in
+lexical order, after binary or script specified
+kdump_pre parameter is executed.
+Even if the binary or script in /etc/kdump/pre.d directory
+returns non 0 exit status, the processing is continued.
+.PP
Note that scripts written for this directive must use
the /bin/bash interpreter.
.RE
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 78ebf69..9b0fee2 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -543,6 +543,9 @@ It is possible to specify a custom script or binary you wish to run following
an attempt to capture a vmcore. The executable is passed an exit code from
the capture process, which can be used to trigger different actions from
within your post-capture executable.
+If /etc/kdump/post.d directory exist, All files in the directory are
+collectively sorted and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
Kdump Pre-Capture Executable
----------------------------
@@ -551,6 +554,11 @@ It is possible to specify a custom script or binary you wish to run before
capturing a vmcore. Exit status of this binary is interpreted:
0 - continue with dump process as usual
non 0 - reboot the system
+If /etc/kdump/pre.d directory exists, all files in the directory are collectively
+sorted and executed in lexical order, after binary or script specified
+kdump_pre parameter is executed.
+Even if the binary or script in /etc/kdump/pre.d directory returns non 0
+exit status, the processing is continued.
Extra Binaries
--------------
--
2.7.5
1 year, 11 months
[PATCH v2 0/2] Fix kdump issues with UUID= or LABEL= config style
by Kairui Song
Previous patch series:
[PATCH v2 0/7] Add support for unmounted dump target
assumed get_persistent_dev accepts any block target config format. But
it doesn't recognize the UUID= or LABEL= format. So always use the
wrapper version for kdump which supports it well.
Also fix a nfs detection issue introduced the that patch series.
Kairui Song (2):
Always wrap up call to dracut get_persistent_dev function
mkdumprd: Fix nfs detection in to_mount
Update from v1:
- Keep kdump_get_persistent_dev function name unchanged
- Simplify and fix nfs dump target detection in to_mount again
dracut-module-setup.sh | 14 --------------
kdump-lib.sh | 14 ++++++++++++++
kdumpctl | 2 +-
mkdumprd | 24 ++++++++++--------------
4 files changed, 25 insertions(+), 29 deletions(-)
--
2.26.2
1 year, 11 months
[PATCH] man: improve description about /etc/kdump/{pre.d,post.d}interface
by Pingfan Liu
The description is identical to the notes in kdump.conf
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf.5 | 12 ++++++++++++
kexec-kdump-howto.txt | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/kdump.conf.5 b/kdump.conf.5
index 5a0952b..e275662 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,6 +109,11 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
+If /etc/kdump/post.d directory is exist, All files in
+the directory are collectively sorted and executed in
+lexical order, before binary or script specified
+kdump_post parameter is executed.
+.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
.RE
@@ -124,6 +129,13 @@ as follows:
.PP
non 0 - reboot the system
.PP
+If /etc/kdump/pre.d directory exists, all files in
+the directory are collectively sorted and executed in
+lexical order, after binary or script specified
+kdump_pre parameter is executed.
+Even if the binary or script in /etc/kdump/pre.d directory
+returns non 0 exit status, the processing is continued.
+.PP
Note that scripts written for this directive must use
the /bin/bash interpreter.
.RE
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 78ebf69..bb905d3 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -543,6 +543,9 @@ It is possible to specify a custom script or binary you wish to run following
an attempt to capture a vmcore. The executable is passed an exit code from
the capture process, which can be used to trigger different actions from
within your post-capture executable.
+If /etc/kdump/post.d directory is exist, All files in the directory are
+collectively sorted and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
Kdump Pre-Capture Executable
----------------------------
@@ -551,6 +554,11 @@ It is possible to specify a custom script or binary you wish to run before
capturing a vmcore. Exit status of this binary is interpreted:
0 - continue with dump process as usual
non 0 - reboot the system
+If /etc/kdump/pre.d directory exists, all files in the directory are collectively
+sorted and executed in lexical order, after binary or script specified
+kdump_pre parameter is executed.
+Even if the binary or script in /etc/kdump/pre.d directory returns non 0
+exit status, the processing is continued.
Extra Binaries
--------------
--
2.7.5
1 year, 11 months
[PATCH 0/2] Fix kdump issues with UUID= or LABEL= config style
by Kairui Song
Previous patch series:
[PATCH v2 0/7] Add support for unmounted dump target
assumed get_persistent_dev accepts any block target config format. But
it doesn't recognize the UUID= or LABEL= format. So always use the
wrapper version for kdump which supports it well.
Also fix a nfs detection issue introduced the that patch series.
Kairui Song (2):
Always wrap up call to dracut get_persistent_dev function
mkdumprd: Fix nfs detection in to_mount
dracut-module-setup.sh | 20 +++-----------------
kdump-lib.sh | 14 ++++++++++++++
kdumpctl | 2 +-
mkdumprd | 6 +++---
4 files changed, 21 insertions(+), 21 deletions(-)
--
2.26.2
1 year, 11 months
[PATCH] Fix kdump failure when mount target specified by dracut_args
by Kairui Song
commit 61e0169 changed definition of dump_fs function, so
need to do a mount target conversion before calling it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-kdump.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 9c8f3a9..b71278d 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -208,7 +208,10 @@ read_kdump_conf()
case "$config_opt" in
dracut_args)
config_val=$(get_dracut_args_target "$config_val")
- [ -n "$config_val" ] && add_dump_code "dump_fs $config_val"
+ if [ -n "$config_val" ]; then
+ config_val=$(get_mntpoint_from_target "$config_val")
+ add_dump_code "dump_fs $config_val"
+ fi
;;
ext[234]|xfs|btrfs|minix|nfs)
config_val=$(get_mntpoint_from_target "$config_val")
--
2.26.2
1 year, 11 months
[PATCH] mkdumprd: Fix dracut error on multiple extra_modules
by Kairui Song
Dracut expects --add-drivers with a single parameter, so mkdumprd
should quota the module list.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 1bee98c..7bc1bd1 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -471,7 +471,7 @@ handle_default_dump_target
if [ -n "$extra_modules" ]
then
- add_dracut_arg "--add-drivers" "$extra_modules"
+ add_dracut_arg "--add-drivers" \"$extra_modules\"
fi
if ! is_fadump_capable; then
--
2.26.2
1 year, 11 months
Re: [PATCH v4 0/4] /etc/kdump/{pre.d,post.d} interface to set up
multiple binary and script files
by Kairui Song
Hi,
On Wed, Jun 10, 2020 at 12:56 PM onitsuka.shinic(a)fujitsu.com
<onitsuka.shinic(a)fujitsu.com> wrote:
>
> > -----Original Message-----
> > From: piliu <piliu(a)redhat.com>
> > Sent: Monday, June 8, 2020 11:28 PM
> > To: Onitsuka, Shinichi/鬼束 伸一 <onitsuka.shinic(a)fujitsu.com>; kexec(a)lists.fedoraproject.org; Kairui Song
> > <kasong(a)redhat.com>
> > Subject: Re: [PATCH v4 0/4] /etc/kdump/{pre.d,post.d} interface to set up multiple binary and script files
> >
> >
> >
> > On 06/05/2020 10:21 AM, 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 four patches created based on
> > > commit 8fcbb4d265f6f7948081ecd88cccbb1d6548c449.
> > Do you mean 8fcbb4d265f6 ("fadump: update fadump-howto.txt with some
> > more troubleshooting help") ?
>
> Thank you for your cooperation.
> The above commit is the most newer commit by my local master branch (cloned on June 4).
> Therefore, "PATCH v4 1/4"(patch of dracut-module-setup.sh) is created based on
> commit 0cc3b85d0d4c88c11e48229a76eb24c7d49f9748.
>
> $ git log --stat
> commit 8fcbb4d265f6f7948081ecd88cccbb1d6548c449
> Author: Hari Bathini <hbathini(a)linux.ibm.com>
> Date: Tue May 19 20:19:15 2020 +0530
>
> fadump: update fadump-howto.txt with some more troubleshooting help
>
> On journaling filesystems like XFS, bootloader is likely to pick up
> older initrd (without vmcore capture scripts) if system crashes right
> after initrd update, as the bootloader (read GRUB) may not replay
> filesystem log before reading the initrd from disk. Added steps to
> workaround that problem.
>
> Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
> Acked-by: Pingfan Liu <piliu(a)redhat.com>
>
> fadump-howto.txt | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> commit 47bdeee35d35cec5e0e843aeb36bd0b5aec595c4
> Author: Pingfan Liu <piliu(a)redhat.com>
> Date: Wed Jun 3 10:53:25 2020 +0800
>
> fadump-howto.txt: source it in spec file
>
> Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
> Acked-by: Kairui Song <kasong(a)redhat.com>
>
> kexec-tools.spec | 3 +++
> 1 file changed, 3 insertions(+)
>
> commit 134c578463aface9543cba16532cbac3e3ff2da7
> Author: Kairui Song <kasong(a)redhat.com>
> Date: Sun May 17 16:14:06 2020 +0800
>
> Don't inherit swiotlb parameter form 1st kernel by default
>
> Usually kdump kernel don't need a swiotlb. There are two cases known
> common case a swiotlb is needed:
>
> - SEV/SME is active.
> - crashkernel high reservation is used, or there are crashkernel memory
> above 4G.
>
> For both case, if swiotlb is set to a large value in first kernel, kdump
> kernel will likely to fail with OOM. So don't inherit swiotlb parameter
> by default.
>
> Signed-off-by: Kairui Song <kasong(a)redhat.com>
> Acked-by: Pingfan Liu <piliu(a)redhat.com>
>
> kdump.sysconfig | 2 +-
> kdump.sysconfig.aarch64 | 2 +-
> kdump.sysconfig.i386 | 2 +-
> kdump.sysconfig.ppc64 | 2 +-
> kdump.sysconfig.ppc64le | 2 +-
> kdump.sysconfig.s390x | 2 +-
> kdump.sysconfig.x86_64 | 2 +-
> 7 files changed, 7 insertions(+), 7 deletions(-)
>
> commit 0cc3b85d0d4c88c11e48229a76eb24c7d49f9748
> Author: Kairui Song <kasong(a)redhat.com>
> Date: Thu May 28 02:20:20 2020 +0800
>
> module-setup.sh: Add "rd.neednet" parameter if network is needed
>
> Upstream dracut now use network-manager module by default and since
> upstream commit 3dcaa97, network-manager expects user to pass "rd.neednet"
> to indicate network is required.
>
> Signed-off-by: Kairui Song <kasong(a)redhat.com>
> Acked-by: Dave Young <dyoung(a)redhat.com>
>
> dracut-module-setup.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> Isn't commit 0cc3b85d0d4c88c11e48229a76eb24c7d49f9748
> the most newer commit with dracut-module-setup.sh modified?
>
> Best Regards,
> Shinichi Onitsuka
>
> >
> > I tried to apply 1/4, but failed with
> > Applying: dracut-module-setup.sh: Install files under
> > /etc/kdump/{pre.d,post.d} into kdump initramfs
> > .git/rebase-apply/patch:13: trailing whitespace.
> > # install etc/kdump/pre.d and /etc/kdump/post.d
> > .git/rebase-apply/patch:14: trailing whitespace.
> > kdump_install_pre_post_conf() {
> > .git/rebase-apply/patch:15: trailing whitespace.
> > if [ -d /etc/kdump/pre.d ]; then
> > .git/rebase-apply/patch:16: trailing whitespace.
> > for file in /etc/kdump/pre.d/*; do
> > .git/rebase-apply/patch:17: trailing whitespace.
> > if [ -x "$file" ]; then
> > error: patch failed: dracut-module-setup.sh:427
> > error: dracut-module-setup.sh: patch does not apply
> > Patch failed at 0001 dracut-module-setup.sh: Install files under
> > /etc/kdump/{pre.d,post.d} into kdump initramfs
> > The copy of the patch that failed is found in: .git/rebase-apply/patch
> > When you have resolved this problem, run "git am --continue".
> > If you prefer to skip this patch, run "git am --skip" instead.
> > To restore the original branch and stop patching, run "git am --abort".
> >
> > I think maintainer is also busy on other topic, not sure if he is
> > willing to resolve it by manual.
> >
> > Except this issue, for the series's code part,
> > Acked-by: Pingfan Liu <piliu(a)redhat.com>
> >
No need to worry about the conflict, it was easily resolved, this
patch looks good.
--
Best Regards,
Kairui Song
1 year, 11 months