[PATCH] dracut-kdump: Rename the function to make it more clearly
by Minfei Huang
The kdump will add the prefix "kdump-" before ethX in the 2nd kernel.
SSH client will store the peer known host key to the local file and the
link scope of ipv6 should append the netdevice to identify the address.
Thus we should correct the known host key if use the link scope of ipv6.
To make the function more clearly, rename it to
correct_ipv6_known_hosts, thus we can known it only for ipv6.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-kdump.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index e062665..52ebbdd 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -131,10 +131,11 @@ get_host_ip()
return 0
}
+# This function is only for ipv6
# kdump will change the ethernet device name in the 2nd using prefix "kdump-",
# the link scope of ipv6 has the format like fe80::5054:ff:fe48:ca80%eth0,
# So we should correct the known hosts
-correct_known_hosts()
+correct_ipv6_known_hosts()
{
if is_ipv6_target && is_ssh_dump_target; then
local _ipv6 _netdev _pre_netdev
@@ -196,7 +197,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
-correct_known_hosts
+correct_ipv6_known_hosts
if [ -z "$DUMP_INSTRUCTION" ]; then
add_dump_code "dump_fs $NEWROOT"
--
1.9.3
9 years, 5 months
[PATCH 0/2 v5] Enhance kdump to support ipv6
by Minfei Huang
v5:
- modify the get_route function
v4:
- consistent the netdevice name to add the prefix "kdump-" before the ethX
v3:
- Support the static route
v2:
- Fix some bugs
Minfei Huang (2):
dracut-kdump: Use proper the known hosts entry in the file known_hosts
ipv6: Enhance kdump to support ipv6
dracut-kdump.sh | 31 +++++++++-
dracut-module-setup.sh | 153 ++++++++++++++++++++++++++++++++++---------------
kdump-lib.sh | 50 ++++++++++++++++
mkdumprd | 14 ++++-
4 files changed, 199 insertions(+), 49 deletions(-)
--
1.8.3.1
9 years, 5 months
[RFC PATCH] kdump: remove sysctl.conf & sysctl.d/* files for kdump kernel
by Hari Bathini
Certain kernel parameters like min_free_kbytes can be configured at runtime
using sysctl. While this is useful in first kernel, it can lead to unnecessary
failures like OOM in kdump kernel. This patch enforces default vaules for all
sysctl parameters, in kdump kernel, by removing sysctl.conf & sysctl.d/* files.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
dracut-module-setup.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..e648f91 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -378,6 +378,18 @@ kdump_install_conf() {
rm -f /tmp/$$-kdump.conf
}
+# Default sysctl parameters should suffice for kdump kernel.
+# Remove custom configurations sysctl.conf & sysctl.d/*
+remove_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"
+}
+
kdump_iscsi_get_rec_val() {
local result
@@ -586,6 +598,7 @@ kdump_install_random_seed() {
install() {
kdump_install_conf
+ remove_sysctl_conf
if is_ssh_dump_target; then
kdump_install_random_seed
9 years, 5 months
[PATCH v2] kdump: fix OOM issue when vm.min_free_kbytes is set too high
by Hari Bathini
When the value of vm.min_free_kbytes is set too high in /etc/sysctl.conf,
kdump kernel fails with OOM. As min_free_kbytes may not be relevant for
kdump kernel, this patch tries to fix the issue by removing it from the
file sysctl.conf and thus forcing default value for vm.min_free_kbytes
parameter.
Changes from v1 to v2:
1. Moved snippet modifying /etc/sysctl.conf file to a new function
2. Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
dracut-module-setup.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..72871d0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -378,6 +378,16 @@ kdump_install_conf() {
rm -f /tmp/$$-kdump.conf
}
+# Certain things configured in /etc/sysctl.conf are not relevant
+# for kdump kernel. Tune them here
+kdump_sysctl_conf() {
+
+ # While min_free_kbytes may not be relevant for kdump kernel,
+ # it leads to OOM in cases where this value is too high.
+ # Let's be paranoid and force it to default value calculated by kernel.
+ sed -e "/min_free_kbytes/d" /etc/sysctl.conf > "${initdir}/etc/sysctl.conf"
+}
+
kdump_iscsi_get_rec_val() {
local result
@@ -586,6 +596,7 @@ kdump_install_random_seed() {
install() {
kdump_install_conf
+ kdump_sysctl_conf
if is_ssh_dump_target; then
kdump_install_random_seed
9 years, 5 months
[PATCH] kdump: fix OOM issue when vm.min_free_kbytes is set too high
by Hari Bathini
When the value of vm.min_free_kbytes is set too high in /etc/sysctl.conf,
kdump kernel fails with OOM. As min_free_kbytes may not be relevant for
kdump kernel, this patch tries to fix the issue by removing it from the
file sysctl.conf and thus forcing default value for vm.min_free_kbytes
parameter.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
dracut-module-setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..6ada7d3 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -612,6 +612,11 @@ install() {
# Also redirect dracut-emergency to kdump error handler
ln_r "$systemdsystemunitdir/emergency.service" "$systemdsystemunitdir/dracut-emergency.service"
+ # While min_free_kbytes may not be relevant for kdump kernel,
+ # it leads to OOM in cases where this value is too high.
+ # Let's be paranoid and force it to default value calculated in kernel.
+ sed -e "/^$/d" -e "/^#/d" -e "/min_free_kbytes/d" /etc/sysctl.conf > "${initdir}/etc/sysctl.conf"
+
# Check for all the devices and if any device is iscsi, bring up iscsi
# target. Ideally all this should be pushed into dracut iscsi module
# at some point of time.
9 years, 5 months
[PATCH v2 1/2] module-setup: move kdump_setup_netdev early when handling iscsi
by WANG Chao
Move kdump_setup_netdev in iscsi handling path early. Because when we
detect ibft or firmware iscsi session, we will bail out early, but still
need to bring up network device in 2nd kernel.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..b6218b3 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -434,8 +434,15 @@ kdump_setup_iscsi_device() {
return 1
fi
- tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
+ netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
+ sed 's|.*dev \(.*\).*|\1|g')
+ srcaddr=$(echo $netdev | awk '{ print $3; exit }')
+ netdev=$(echo $netdev | awk '{ print $1; exit }')
+
+ kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
+
+ tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
# get and set username and password details
username=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username")
@@ -452,13 +459,6 @@ kdump_setup_iscsi_device() {
[ -n "$username_in" ] && userpwd_in_str=":$username_in:$password_in"
- netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
- sed 's|.*dev \(.*\).*|\1|g')
- srcaddr=$(echo $netdev | awk '{ print $3; exit }')
- netdev=$(echo $netdev | awk '{ print $1; exit }')
-
- kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
-
# prepare netroot= command line
# FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr
# FIXME: Do we need to parse and set other parameters like protocol, port
--
1.9.3
9 years, 5 months
[PATCH v3 0/3] kdump config checking improvement and cleanup
by WANG Chao
Hi,
These patches are improvement and cleanup for sanity checking kdump.conf.
Please take a look.
v3 - v2: minor nit update per Vivek
WANG Chao (3):
Check "default" option config in kdump.conf
kdumpctl: clean up fence_kdump_nodes config check
kdumpctl: check_config_fence_kdump also check short hostname
kdumpctl | 55 +++++++++++++++++++++++++++++++++++++------------------
1 file changed, 37 insertions(+), 18 deletions(-)
--
1.9.3
9 years, 5 months
[PATCH v2 0/3] kdump config checking improvement and cleanup
by WANG Chao
Hi,
These patches are improvement and cleanup for sanity checking kdump.conf.
Please take a look.
WANG Chao (3):
Check "default" option config in kdump.conf
kdumpctl: clean up fence_kdump_nodes config check
kdumpctl: check_config_fence_kdump also check short hostname
kdumpctl | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
--
1.9.3
9 years, 5 months
[PATCH 0/2 v5] module-setup: Fix some bugs about static route
by Minfei Huang
Fix some bugs to make the static route work in the 2nd kernel.
v5:
- rename the variety _transit_target to _nexthop to make it sane.
v4:
- make the simple way to construct the static route config
v3:
- fix some bugs
v2:
- only add the prefix "kdump-" before the netdevice name when netdevice names ethX
Minfei Huang (2):
module-setup: Do not show the noisy in the terminal
module-setup: Correct the ethernet device name to make it work in 2nd
kernel
dracut-module-setup.sh | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
--
1.8.3.1
9 years, 5 months
[PATCH 0/2 v4] module-setup: Fix some bugs about static route
by Minfei Huang
Fix some bugs to make the static route work in the 2nd kernel.
v4:
- make the simple way to construct the static route config
v3:
- fix some bugs
v2:
- only add the prefix "kdump-" before the netdevice name when netdevice names ethX
Minfei Huang (2):
module-setup: Do not show the noisy in the terminal
module-setup: Correct the ethernet device name to make it work in 2nd
kernel
dracut-module-setup.sh | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
--
1.8.3.1
9 years, 5 months