[PATCH RFC] module-setup.sh: install usb serial driver for ttyUSB0
by Dave Young
In case one want to use usb serial console, we need to pack the usb serial
driver into kdump initramfs so that one can see the console output on the usb
console.
I only handled ttyUSB0, this is like a hard code, but it should be enough for
most cases. Also only install the driver for the ttyUSB0 device.
Tested with adding "console=ttyUSB0" in 2nd kernel commandline.
Tested latest F22 kernel, there's CONFIG_USB_SERIAL_CONSOLE=y, kdump work ok.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 8 ++++++++
1 file changed, 8 insertions(+)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -626,4 +626,12 @@ installkernel() {
[ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
instmods $wdt
fi
+
+ if [ -c /dev/ttyUSB0 ]; then
+ _majmin=$(get_maj_min /dev/ttyUSB0)
+
+ _driver=$(readlink /sys/dev/char/$_majmin/device/driver)
+ _driver=$(basename $_driver)
+ instmods $_driver
+ fi
}
7 years
[PATCH v2] Add checking num-threads of makedumpfile
by Zhou Wenjian
A new feature that doing compressing and writing by multi-threads
has been added in makedumpfile. The thread num is specified by
"--num-threads NUM". According to its implementation, there will
be performance degradation if the threads are more than cpus.
So we should check it.
Signed-off-by: Zhou wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
kdumpctl | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index b504734..fd2abe4 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -259,6 +259,21 @@ check_config()
esac
done < $KDUMP_CONFIG_FILE
+ grep "^core_collector.*makedumpfile" $KDUMP_CONFIG_FILE | grep -q "num-threads"
+ if [ $? -eq 0 ];then
+ local nr_cpus=1
+ local num_threads=0
+ local core_collector=`grep "^core_collector" $KDUMP_CONFIG_FILE`
+
+ num_threads=`echo ${core_collector#*--num-threads} | awk '{print $1}'`
+ nr_cpus=`echo ${KDUMP_COMMANDLINE_APPEND#*nr_cpus=} | awk '{print $1}'`
+
+ if [ $num_threads -ge $nr_cpus ];then
+ echo "The num_threads:$num_threads(specified in /etc/kdump.conf) should be less than nr_cpus:$nr_cpus(specified in /etc/sysconfig/kdump)"
+ echo "or makedumpfile may have bad performance!"
+ fi
+ fi
+
check_fence_kdump_config || return 1
return 0
--
1.7.1
7 years, 8 months
[PATCH] Add checking num-threads of makedumpfile
by Zhou Wenjian
A new feature that doing compressing and writing by multi-threads
has been added in makedumpfile. The thread num is specified by
"--num-threads NUM". According to its implementation, there will
be performance degradation if the threads are more than cpus.
So we should check it.
Signed-off-by: Zhou wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
kdumpctl | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index b504734..a4b4681 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -259,6 +259,22 @@ check_config()
esac
done < $KDUMP_CONFIG_FILE
+ grep -v "^#" $KDUMP_CONFIG_FILE | grep -q "num-threads"
+ if [ $? -eq 0 ];then
+ local nr_cpus=1
+ local num_threads=0
+ local core_collector=`grep -v "^#" $KDUMP_CONFIG_FILE | grep "^core_collector"`
+
+ num_threads=`echo ${core_collector#*--num-threads} | awk '{print $1}'`
+ nr_cpus=`echo ${KDUMP_COMMANDLINE_APPEND#*nr_cpus=} | awk '{print $1}'`
+
+ test $num_threads -ge $nr_cpus &> /dev/null
+ if [ $? -eq 0 ];then
+ echo "The num_threads:$num_threads(specified in /etc/kdump.conf) should be less than nr_cpus:$nr_cpus(specified in /etc/sysconfig/kdump)"
+ echo "or makedumpfile may have bad performance!"
+ fi
+ fi
+
check_fence_kdump_config || return 1
return 0
--
1.7.1
7 years, 9 months
[PATCH] kdumpctl: Remove slub_debug from cmdline
by Dangyi Liu
slub_debug parameter enables debug for slub, making each object take
more memory than normal. During a typical kdump, "slub_debug=FZPU" will
cost about 33MB additional memory. If users really want to enable this
parameter, they should specify it in KDUMP_COMMANDLINE_APPEND.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index eaf7f67..9f7e56b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -105,7 +105,7 @@ prepare_cmdline()
else
cmdline=${KDUMP_COMMANDLINE}
fi
- cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz panic_on_warn`
+ cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz panic_on_warn slub_debug`
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
--
2.4.3
7 years, 9 months
[PATCH v3] kdumpctl: Add man page for kdumpctl
by Dangyi Liu
kdumpctl is useful sometimes when users want to debug or setup ssh key
authentication. So add a man page for it.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
v2->v3:
Trivial grammar fix
v1->v2:
Suggestion to use systemctl instead of kdumpctl
Add mkdumprd to "SEE ALSO"
kdumpctl.8 | 41 +++++++++++++++++++++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 43 insertions(+)
create mode 100644 kdumpctl.8
diff --git a/kdumpctl.8 b/kdumpctl.8
new file mode 100644
index 0000000..b446b81
--- /dev/null
+++ b/kdumpctl.8
@@ -0,0 +1,41 @@
+.TH KDUMPCTL 8 2015-07-13 kexec-tools
+
+.SH NAME
+kdumpctl \- control interface for kdump
+
+.SH SYNOPSIS
+.B kdumpctl
+.I COMMAND
+
+.SH DESCRIPTION
+.B kdumpctl
+is used to check or control the kdump service.
+In most cases, you should use
+.B systemctl
+to start / stop / enable kdump service instead. However,
+.B kdumpctl
+provides more details for debug and a helper to setup ssh key authentication.
+
+.SH COMMANDS
+.TP
+.I start
+Start the service.
+.TP
+.I stop
+Stop the service.
+.TP
+.I status
+Prints the current status of kdump service.
+It returns non-zero value if kdump is not operational.
+.TP
+.I restart
+Is equal to
+.I start; stop
+.TP
+.I propagate
+Helps to setup key authentication for ssh storage since it's
+impossible to use password authentication during kdump.
+
+.SH "SEE ALSO"
+.BR kdump.conf (5),
+.BR mkdumprd (8)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index a2e39f8..5b99c83 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -27,6 +27,7 @@ Source22: kdump-dep-generator.sh
Source23: kdump-anaconda-addon-005-12-g60fa4c1.tar.gz
Source24: kdump-lib-initramfs.sh
Source25: kdump.sysconfig.ppc64le
+Source26: kdumpctl.8
#######################################
# These are sources for mkdumpramfs
@@ -159,6 +160,7 @@ install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/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
+install -m 644 %{SOURCE26} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE24} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
%ifnarch s390x
--
2.4.3
7 years, 9 months
[PATCH v2] kdumpctl: Add man page for kdumpctl
by Dangyi Liu
v2: Suggestion to use systemctl instead of kdumpctl
Add mkdumprd to "SEE ALSO"
v1: Create man page
Dangyi Liu (1):
kdumpctl: Add man page for kdumpctl
kdumpctl.8 | 41 +++++++++++++++++++++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 43 insertions(+)
create mode 100644 kdumpctl.8
--
2.4.3
7 years, 9 months
[PATCH v2] mkdumprd: Remove ifcfg from dracut's modules
by Dangyi Liu
Ifcfg depends on network module, which is quite large and useless
when using a local dump target. Also we don't really need ifcfg to
setup network interfaces. So just remove it.
On fedora22, the uncompressed dumprd would decrease about 20MB when
using a local dump target. A regression testing is also conducted with
targets of nfs and ssh.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 28ecdd7..6e3d975 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -17,7 +17,7 @@ SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
SAVE_PATH=$(echo $SAVE_PATH | tr -s /)
extra_modules=""
-dracut_args=("--hostonly" "-o" "plymouth dash resume")
+dracut_args=("--hostonly" "-o" "plymouth dash resume ifcfg")
OVERRIDE_RESETTABLE=0
perror_exit() {
--
2.4.3
7 years, 9 months
[PATCH] module-setup: Choose the first matched gateway in kdump_static_ip
by Minfei Huang
The system may have multiple default route entry. Following is an
example to show the details.
# ip -6 route list dev eth0
2620:52:0:1040::/64 proto kernel metric 256 expires 2591978sec fe80::/64 proto kernel metric 256
default via fe80:52:0:1040::1 proto ra metric 1024 expires 1778sec hoplimit 64
default via fe80:52:0:1040::2 proto ra metric 1024 expires 1778sec hoplimit 64
Choose the first matched entry.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c37f7c0..a615124 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -99,7 +99,8 @@ kdump_static_ip() {
fi
if [ -n "$_ipaddr" ]; then
- _gateway=$(ip $_ipv6_flag route list dev $_netdev | awk '/^default /{print $3}')
+ _gateway=$(ip $_ipv6_flag route list dev $_netdev | \
+ awk '/^default /{print $3}' | head -n 1)
if [ "x" != "x"$_ipv6_flag ]; then
# _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/"
--
2.1.0
7 years, 9 months
[PATCH] mkdumprd: Remove ifcfg from dracut's modules
by Dangyi Liu
Ifcfg depends on network module, which is quite large (20M) and useless
when using a local kdump target. Also we don't really need ifcfg to
setup network interfaces. So just remove it.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 28ecdd7..6e3d975 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -17,7 +17,7 @@ SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
SAVE_PATH=$(echo $SAVE_PATH | tr -s /)
extra_modules=""
-dracut_args=("--hostonly" "-o" "plymouth dash resume")
+dracut_args=("--hostonly" "-o" "plymouth dash resume ifcfg")
OVERRIDE_RESETTABLE=0
perror_exit() {
--
2.4.3
7 years, 9 months
[PATCH] module-setup: Add permanent option to detect static ip address or not
by Minfei Huang
Dracut will die in the situation that dracut detects to use dhcp to
setup ip address, but kdump passes the ip address to it.
In commit 7ea50dc7a38d14009b9be36f6d6ca59a89a430be, we start to use
option permanent to get the ip address in kdump_static_ip. If the
network is setuped by static, we will get the ip address, otherwise
getting none.
In commit c994a80698b6b12e50791b36fe40ae36485098d0 which it used to
support ipv6 protocol, I miss the option permanent.
This patch is not a fixing patch, just pulls back something to make
kdump work as original.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c37f7c0..dbe9b10 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -92,7 +92,7 @@ kdump_static_ip() {
local _netdev="$1" _srcaddr="$2" _ipv6_flag
local _netmask _gateway _ipaddr _target _nexthop
- _ipaddr=$(ip addr show dev $_netdev | awk "/ $_srcaddr\/.* /{print \$2}")
+ _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}")
if is_ipv6_address $_srcaddr; then
_ipv6_flag="-6"
--
2.1.0
7 years, 10 months