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
3 years, 9 months
Re: [PATCH v4 0/4] /etc/kdump/{pre.d,post.d} interface to set up
multiple binary and script files
by piliu
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") ?
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>
>
> Signed-off-by: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
>
> ---
> Changes since v1:
> [1]Change title.
> [2]Change behavior of non 0 Exit status that script/binary in kdump/pre.d was returned.
> [3]Stop using find/sort commands.
> [4]Add checking execution bit.
> [5]Add specification of /etc/kdump/{pre.d,post.d} interface
>
> Changes since v2:
> [1]Correct sentence errors in kdump.conf.
> [2]Move the doc commit after the code change.
> [3]Change the name of the added function in dracut-module-setup.sh.
> [4]Change the commit comment of kdumpctl
>
> Changes since v3:
> [1]Move the declaration of kdump_install_pre_post_conf before
> declaration of default_dump_target_install_conf
> in dracut-module-setup.sh.
> [2]Change the commit comment of kdumpctl.
> [3]Change the based on commit.
>
> ---
>
> Shin-ichi Onitsuka (4):
> dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d}
> into kdump initramfs
> kdumpctl: Check the update of the binary and script files in
> /etc/kdump/{pre.d,post.d}
> dracut-kdump.sh: Execute the binary and script files in
> /etc/kdump/{pre.d,post.d}
> kdump.conf: Specify /etc/kdump/{pre.d,post.d} interface
>
> dracut-kdump.sh | 34 ++++++++++++++++++++++++++++++++++
> dracut-module-setup.sh | 25 +++++++++++++++++++++++++
> kdump.conf | 14 ++++++++++++--
> kdumpctl | 16 +++++++++++++++-
> 4 files changed, 86 insertions(+), 3 deletions(-)
>
3 years, 9 months
Re: [PATCH v3 0/4] /etc/kdump/{pre.d,post.d} interface to set up
multiple binary and script files
by piliu
Except comment for 1/4, I am OK with this series.
But please rebase them to the latest Fedora. It will ease maintainers'
work (although I am not). During my test, I found it far lagged behind
the repo, and I had to apply them by manual.
Thanks,
Pingfan
On 05/28/2020 08:17 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 three patches created based on
> commit 4b43ba063ddbcdccf95d761d2a3641f3006d814d.
>
> Signed-off-by: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
>
> ---
> Changes since v1:
> [1]Change title.
> [2]Change behavior of non 0 Exit status that script/binary in kdump/pre.d was returned.
> [3]Stop using find/sort commands.
> [4]Add checking execution bit.
> [5]Add specification of /etc/kdump/{pre.d,post.d} interface
>
> Changes since v2:
> [1]Correct sentence errors in kdump.conf.
> [2]Move the doc commit after the code change.
> [3]Change the name of the added function in dracut-module-setup.sh.
> [4]Change the commit comment of kdumpctl
> ---
>
> Shin-ichi Onitsuka (4):
> dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d}
> into kdump initramfs
> kdumpctl: Check the update of the binary and script files in
> /etc/kdump/{pre.d,post.d}
> dracut-kdump.sh: Execute the binary and script files in
> /etc/kdump/{pre.d,post.d}
> kdump.conf: Specify /etc/kdump/{pre.d,post.d} interface
>
> dracut-kdump.sh | 34 ++++++++++++++++++++++++++++++++++
> dracut-module-setup.sh | 25 +++++++++++++++++++++++++
> kdump.conf | 14 ++++++++++++--
> kdumpctl | 16 +++++++++++++++-
> 4 files changed, 86 insertions(+), 3 deletions(-)
>
3 years, 9 months
Re: [PATCH v3 1/4] dracut-module-setup.sh: Install files under
by piliu
On 05/28/2020 08:18 AM, 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: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
> ---
> dracut-module-setup.sh | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index 7a2c7b4..cc9d009 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -521,6 +521,8 @@ kdump_install_conf() {
> esac
> done <<< "$(read_strip_comments /etc/kdump.conf)"
>
> + kdump_install_pre_post_conf
Should the declaration come firstly?
> +
> default_dump_target_install_conf
>
> kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"
> @@ -528,6 +530,29 @@ kdump_install_conf() {
> rm -f ${initdir}/tmp/$$-kdump.conf
> }
>
> +# 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
> +}
> +
> # Remove user custom configurations sysctl.conf & sysctl.d/*
> # and apply some optimization for kdump
> overwrite_sysctl_conf() {
>
3 years, 9 months
[PATCH v4 4/4] kdump.conf: Specify /etc/kdump/{pre.d,post.d}
interface
by onitsuka.shinic@fujitsu.com
This patch discribe /etc/kdump/{pre.d,post.d} interface.
Signed-off-by: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
---
kdump.conf | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 1f0fc2d..bcfdba0 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -79,13 +79,23 @@
# or script after the vmcore dump process terminates.
# The exit status of the current dump process is fed to
# the executable binary or script as its first argument.
+# 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 <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
+# 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_bins <binaries | shell scripts>
# - This directive allows you to specify additional binaries or
--
1.8.3.1
3 years, 9 months
[PATCH v4 3/4] dracut-kdump.sh: Execute the binary and script files
in /etc/kdump/{pre.d,post.d}
by onitsuka.shinic@fujitsu.com
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: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
---
dracut-kdump.sh | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 8752178..9c8f3a9 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -30,15 +30,49 @@ 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 /etc/kdump/pre.d/*; do
+ "$file"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $file exited with $_ret status"
+ fi
+ done
+ fi
+ return 0
}
do_kdump_post()
{
+ local _ret
+
+ if [ -d /etc/kdump/post.d ]; then
+ for file in /etc/kdump/post.d/*; do
+ "$file" "$1"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $file exited with $_ret status"
+ 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"
+ fi
fi
}
--
1.8.3.1
3 years, 9 months
[PATCH v4 2/4] kdumpctl: Check the update of the binary and script
files in /etc/kdump/{pre.d,post.d}
by onitsuka.shinic@fujitsu.com
This patch adds the binary and script files in /etc/kdump/{pre.d,post.d}
to modified checklist in order to update kdump initramfs when one adds
new scripts or binaries or removes the existing ones under
/etc/kdump/{pre.d, post.d}.
Signed-off-by: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4a674f2..408b88a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -339,9 +339,23 @@ 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 /etc/kdump/post.d/*; do
+ if [ -x "$file" ]; then
+ POST_FILES="$POST_FILES $file"
+ fi
+ done
+ fi
+ if [ -d /etc/kdump/pre.d ]; then
+ for file in /etc/kdump/pre.d/*; do
+ if [ -x "$file" ]; then
+ PRE_FILES="$PRE_FILES $file"
+ fi
+ 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"
--
1.8.3.1
3 years, 9 months
[PATCH v4 1/4] 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: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
---
dracut-module-setup.sh | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d3a674e..5382702 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"
--
1.8.3.1
3 years, 9 months
[PATCH v4 0/4] /etc/kdump/{pre.d,post.d} interface to set up multiple
binary and script files
by onitsuka.shinic@fujitsu.com
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.
Signed-off-by: Shinichi Onitsuka <onitsuka.shinic(a)fujitsu.com>
---
Changes since v1:
[1]Change title.
[2]Change behavior of non 0 Exit status that script/binary in kdump/pre.d was returned.
[3]Stop using find/sort commands.
[4]Add checking execution bit.
[5]Add specification of /etc/kdump/{pre.d,post.d} interface
Changes since v2:
[1]Correct sentence errors in kdump.conf.
[2]Move the doc commit after the code change.
[3]Change the name of the added function in dracut-module-setup.sh.
[4]Change the commit comment of kdumpctl
Changes since v3:
[1]Move the declaration of kdump_install_pre_post_conf before
declaration of default_dump_target_install_conf
in dracut-module-setup.sh.
[2]Change the commit comment of kdumpctl.
[3]Change the based on commit.
---
Shin-ichi Onitsuka (4):
dracut-module-setup.sh: Install files under /etc/kdump/{pre.d,post.d}
into kdump initramfs
kdumpctl: Check the update of the binary and script files in
/etc/kdump/{pre.d,post.d}
dracut-kdump.sh: Execute the binary and script files in
/etc/kdump/{pre.d,post.d}
kdump.conf: Specify /etc/kdump/{pre.d,post.d} interface
dracut-kdump.sh | 34 ++++++++++++++++++++++++++++++++++
dracut-module-setup.sh | 25 +++++++++++++++++++++++++
kdump.conf | 14 ++++++++++++--
kdumpctl | 16 +++++++++++++++-
4 files changed, 86 insertions(+), 3 deletions(-)
--
1.8.3.1
3 years, 9 months
[PATCH] Drop switch root capability for non fadump initramfs
by Kairui Song
Switch root is never used for kdump image, and this will be helpful to
reduce the initramfs size.
Also increase dracut dependency version and the function is
dracut_no_switch_root is new introduced.
This commit is applied to RHEL some time ago, but missing in Fedora as
Fedora's Dracut didn't backport this feature at that time. Now apply
this missing commit.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-module-setup.sh | 3 +++
kexec-tools.spec | 10 +++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 5397eb5..2cf7518 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -843,5 +843,8 @@ install() {
echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf
echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
+
+ # Save more memory by dropping switch root capability
+ dracut_no_switch_root
fi
}
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 6bada4a..cbea367 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -55,13 +55,13 @@ Source110: dracut-kdump-wait-for-target.sh
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
-Requires(pre): coreutils sed zlib
-Requires: dracut >= 047-34.git20180604
-Requires: dracut-network >= 044-117
-Requires: dracut-squash >= 049-4
+Requires(pre): coreutils sed zlib
+Requires: dracut >= 050
+Requires: dracut-network >= 050
+Requires: dracut-squash >= 050
Requires: ethtool
BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel
-BuildRequires: pkgconfig intltool gettext
+BuildRequires: pkgconfig intltool gettext
BuildRequires: systemd-units
BuildRequires: automake autoconf libtool
%ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le
--
2.26.2
3 years, 9 months