[PATCH] Revert "Don's try to restart dracut-initqueue if it's already failed"
by Kairui Song
systemctl is-failed will not work after dracut isolated to the emergency
target, so this judgement is invalid. And the restart is basically
harmless, so just revert this commit.
This reverts commit ad6a93b00d85a85702bb59d15ecc81a5382a9a31.
---
kdump-lib-initramfs.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index e766f95..a60a52a 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -226,8 +226,7 @@ dump_to_rootfs()
{
dinfo "Trying to bring up rootfs device"
- systemctl is-failed dracut-initqueue || systemctl start dracut-initqueue
-
+ systemctl start dracut-initqueue
dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
systemctl start sysroot.mount
--
2.29.2
3 years, 3 months
[PATCH v2] Doc: Improve the kdump sysconfig document
by Lianbo Jiang
Currently, the kdump sysconfig document is missed, let's add it to
the kexec-kdump-howto.txt as a document in order to help users better
understand these options in the /etc/sysconfig/kdump.
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
kexec-kdump-howto.txt | 84 ++++++++++++++++++++++++++++++++++++++++---
1 file changed, 79 insertions(+), 5 deletions(-)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 447bc5447886..3a58d8a0ffe1 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -524,17 +524,91 @@ to send over the necessary ssh key file. Restart the kdump service via
Advanced Setups
===============
-Kdump boot directory
---------------------
+About the /etc/sysconfig/kdump
+------------------------------
+
+Currently, there are a few options in the /etc/sysconfig/kdump, which are
+usually used to control the behavior of kdump kernel. Basically, all of
+these options have default values, most time we do not need to change them,
+but sometimes, we may modify them in order to better control the behavior
+of kdump kernel such as debug, etc.
+
+-KDUMP_BOOTDIR
Usually kdump kernel is the same as 1st kernel. So kdump will try to find
kdump kernel under /boot according to /proc/cmdline. E.g we execute below
command and get an output:
cat /proc/cmdline
BOOT_IMAGE=/xxx/vmlinuz-3.yyy.zzz root=xxxx .....
-Then kdump kernel will be /boot/xxx/vmlinuz-3.yyy.zzz.
-However a variable KDUMP_BOOTDIR in /etc/sysconfig/kdump is provided to
-user if kdump kernel is put in a different directory.
+
+Then kdump kernel will be /boot/xxx/vmlinuz-3.yyy.zzz. However, this option
+is provided to user if kdump kernel is put in a different directory.
+
+-KDUMP_IMG
+
+This represents the image type used for kdump. The default value is "vmlinuz".
+
+-KDUMP_IMG_EXT
+
+This represents the images extension. Relocatable kernels don't have one.
+Currently, it is a null string by default.
+
+-KEXEC_ARGS
+
+Any additional kexec arguments required. For example:
+KEXEC_ARGS="--elf32-core-headers".
+
+In most situations, this should be left empty. But, sometimes we hope to get
+additional kexec loading debugging information, we can add the '-d' option
+for the debugging.
+
+-KDUMP_KERNELVER
+
+This is a kernel version string for the kdump kernel. If the version is not
+specified, the init script will try to find a kdump kernel with the same
+version number as the running kernel.
+
+-KDUMP_COMMANDLINE
+
+The value of 'KDUMP_COMMANDLINE' will be passed to kdump kernel as command
+line parameters, this will likely match the contents of the grub kernel line.
+
+In general, if a command line is not specified, which means that it is a null
+string such as KDUMP_COMMANDLINE="", the default will be taken automatically
+from the '/proc/cmdline'.
+
+-KDUMP_COMMANDLINE_REMOVE
+
+This option allows us to remove arguments from the current kdump command line.
+If we don't specify any parameters for the KDUMP_COMMANDLINE, it will inherit
+all values from the '/proc/cmdline', which is not expected. As you know, some
+default kernel parameters could affect kdump, furthermore, that could cause
+the failure of kdump kernel boot.
+
+In addition, the option is also helpful to debug the kdump kernel, we can use
+this option to change kdump kernel command line.
+
+For more kernel parameters, please refer to kernel document.
+
+-KDUMP_COMMANDLINE_APPEND
+
+This option allows us to append arguments to the current kdump command line
+after processed by the KDUMP_COMMANDLINE_REMOVE. For kdump kernel, some
+specific modules require to be disabled like the mce, cgroup, numa, hest_disable,
+etc. Those modules may waste memory or kdump kernel doesn't need them,
+furthermore, there may affect kdump kernel boot.
+
+Just like above option, it can be used to disable or enable some kernel
+modules so that we can exclude any errors for kdump kernel, this is very
+meaningful for debugging.
+
+-KDUMP_STDLOGLVL | KDUMP_SYSLOGLVL | KDUMP_KMSGLOGLVL
+
+These variables are used to control the kdump log level in the first kernel.
+In the second kernel, kdump will use the rd.kdumploglvl option to set the log
+level in the above KDUMP_COMMANDLINE_APPEND.
+
+Logging levels: no logging(0), error(1), warn(2), info(3), debug(4)
Kdump Post-Capture Executable
-----------------------------
--
2.17.1
3 years, 3 months
[PATCH] kdump/lib: introduce a script to return recommened mem size
by Pingfan Liu
There is requirement to decide the recommended memory size for the current
system.
Implementing a script to achieve it.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump-lib-memsz.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 68 insertions(+)
create mode 100644 kdump-lib-memsz.sh
diff --git a/kdump-lib-memsz.sh b/kdump-lib-memsz.sh
new file mode 100644
index 0000000..d524a9f
--- /dev/null
+++ b/kdump-lib-memsz.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+# kdump-api-memsz.sh
+# return recommended size based on current system RAM size
+
+#get system memory size in the unit of GB
+get_system_size()
+{
+ result=$( cat /proc/iomem | grep "System RAM" | awk -F ":" {' print $1 '} | tr [:lower:] [:upper:] | paste -sd+ )
+ result="+$result"
+ # replace '-' with '+0x' and '+' with '-0x'
+ sum=$( echo $result | sed -e 's/-/K0x/g' | sed -e 's/+/-0x/g' | sed -e 's/K/+/g' )
+ size=$(printf "%d\n" $(($sum)))
+ let size=$size/1024/1024/1024
+
+ echo $size
+}
+
+get_recommend_size()
+{
+ local mem_size=$1
+ local _ck_cmdline=$2
+
+ last_sz=""
+ last_unit=""
+
+ IFS=','
+ for i in $_ck_cmdline
+ do
+ end=$( echo $i | awk -F "-" {' print $2 '} | awk -F ":" {' print $1 '} )
+ recommend=$( echo $i | awk -F "-" {' print $2 '} | awk -F ":" {' print $2 '} )
+ size=${end: : -1}
+ unit=${end: -1}
+ if [ $unit == 'T' ]; then
+ let size=$size*1024
+ fi
+ if [ $mem_size -lt $size ]; then
+ echo $recommend
+ return
+ fi
+ done
+ unset IFS
+}
+
+. /lib/kdump/kdump-lib.sh
+
+arch=$( lscpu | grep Architecture | awk -F ":" {' print $2 '} | tr [:lower:] [:upper:] )
+
+if [ $arch == "X86_64" ] || [ $arch == "S390" ]; then
+ ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M"
+elif [ $arch == "ARM64" ]; then
+ ck_cmdline="2G-:448M"
+elif [ $arch == "PPC64LE" ]; then
+ if is_fadump_capable; then
+ ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
+ else
+ ck_cmdline="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
+ fi
+fi
+
+ck_cmdline=$( echo $ck_cmdline | sed -e 's/-:/-102400T:/g' )
+
+sys_mem=$(get_system_size)
+
+result=$( get_recommend_size $sys_mem "$ck_cmdline" )
+
+echo $result
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 623274c..7f982c6 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -38,6 +38,7 @@ Source28: kdump-udev-throttler
Source29: kdump.sysconfig.aarch64
Source30: 60-kdump.install
Source31: kdump-logger.sh
+Source32: kdump-lib-memsz.sh
#######################################
# These are sources for mkdumpramfs
@@ -192,6 +193,7 @@ install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
+install -m 755 %{SOURCE32} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-memsz.sh
%ifnarch s390x
install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
%endif
--
2.7.5
3 years, 3 months
[PATCH] kdump.conf: Update doc about core_collector for ssh target
by Kairui Song
The current inline comment is a bit misleading, ssh dump target don't
need to use scp as core_collector, and when using scp as core_collector,
the vmcore could be huge.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
kdump.conf | 2 +-
kdump.conf.5 | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/kdump.conf b/kdump.conf
index e4db52e..bd98b79 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -21,7 +21,7 @@
# <mnt>/<path>/%HOST-%DATE/, supports DNS.
#
# ssh <user@server>
-# - Will scp /proc/vmcore to <user@server>:<path>/%HOST-%DATE/,
+# - Will save /proc/vmcore to <user@server>:<path>/%HOST-%DATE/,
# supports DNS.
# NOTE: make sure the user has write permissions on the server.
#
diff --git a/kdump.conf.5 b/kdump.conf.5
index ae07466..2c5a2bc 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -98,6 +98,11 @@ vmcore.flat, you will need to use "makedumpfile -R" to rearrange the
dump data from standard input to a normal dumpfile (readable with analysis
tools).
ie. "makedumpfile -R vmcore < vmcore.flat"
+.PP
+Note 3: If specified core_collector simply copy the vmcore file to the
+dump target (eg: cp, scp), the vmcore could be significantly large.
+Please make sure the dump target has enough space, at leaset larger
+than the system's RAM.
.RE
--
2.29.2
3 years, 3 months