[PATCH v3 1/2] kdumpctl: filter 'root' kernel parameter when running in live images
by Tong Li
Kernels of live images are booted with a kernel parameter which looks
like "root=live:CDLABEL=Fedora-WS-Live-25_A-2". This argument can't be
recognized by dracut during kdump process and will cause failure
of kdump if users didn't set KUDMP_COMMANDLINE in /etc/sysconfig/kdump.
So we should filter out 'root' when we find such a parameter in
/proc/cmdline to make kdump work correctly in live images.
Signed-off-by: Tong Li <tonli(a)redhat.com>
---
kdumpctl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index d0bbb55..aa24682 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -106,6 +106,10 @@ prepare_cmdline()
local cmdline;
if [ -z "$KDUMP_COMMANDLINE" ]; then
cmdline=`cat /proc/cmdline`
+ # 'root' parameter will cause kdump failure in live images
+ if [[ ${cmdline} == *"root=live:"* ]]; then
+ KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root"
+ fi
else
cmdline=${KDUMP_COMMANDLINE}
fi
--
2.7.4
7 years, 5 months
[PATCH v3 1/2] kdump/fadump: fix network interface name when
switching from fadump to kdump
by Hari Bathini
When a remote dump target is specified, kdump dracut module prefixes
'kdump-' to network interface name (ifname) as kernel assigned names
are not persistent. In fadump mode, kdump dracut module is added to
the default initrd, which adds the 'kdump-' prefix to the ifname of
the prodcution kernel itself. If fadump mode is disabled after this,
kdump dracut module picks the ifname that is already prefixed with
'kdump-' in the production kernel and adds another 'kdump-' to it,
making the ifname something like kdump-kdump-eth0 for kdump kernel.
Eventually, kdump kernel fails with below traces:
dracut-initqueue[246]: RTNETLINK answers: Network is unreachable
dracut-initqueue[246]: arping: Device kdump-kdump-eth0 not available.
The ip command shows the below:
kdump:/# ip addr show kdump-kdump-eth0
2: kdump-kdump-eth: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 \
qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 22:82:87:7b:98:02 brd ff:ff:ff:ff:ff:ff
inet6 2002:903:15f:550:2082:87ff:fe7b:9802/64 scope global \
mngtmpaddr dynamic
valid_lft 2591890sec preferred_lft 604690sec
inet6 fe80::2082:87ff:fe7b:9802/64 scope link
valid_lft forever preferred_lft forever
kdump:/#
The trailing 0 from kdump-kdump-eth0 is missing in the ifname, probably
truncated owing to ifname length limit, while setting.
This patch fixes this by avoiding addition of the prefix 'kdump-' when
such prefix is already present in the ifname.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
Changes from v2:
* Added a comment mentioning why this is needed.
dracut-module-setup.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 68e0ff8..0baffaa 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -161,7 +161,11 @@ kdump_get_perm_addr() {
kdump_setup_ifname() {
local _ifname
- if [[ $1 =~ eth* ]]; then
+ # If ifname already has 'kdump-' prefix, we must be switching from
+ # fadump to kdump. Skip prefixing 'kdump-' in this case as adding
+ # another prefix may truncate the ifname. Since an ifname with
+ # 'kdump-' is already persistent, this should be fine.
+ if [[ $1 =~ eth* ]] && [[ ! $1 =~ ^kdump-* ]]; then
_ifname="kdump-$1"
else
_ifname="$1"
7 years, 6 months
[PATCH] Documentation: step by step guide on confiuring kdump in
live images
by Tong Li
This is a short documentation on how to setup kdump on live images. All steps
was tested on Fedora 25 Alpha LiveCD and successfully saved vmcore captured
by kdump to a USB stick.
Signed-off-by: Tong Li <tonli(a)redhat.com>
---
kdump-live-images.txt | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 kdump-live-images.txt
diff --git a/kdump-live-images.txt b/kdump-live-images.txt
new file mode 100644
index 0000000..32f4d2d
--- /dev/null
+++ b/kdump-live-images.txt
@@ -0,0 +1,25 @@
+Kdump now can work on Live images, but some manual configurations are needed.
+Here is the step by step guide. Please use root privilege.
+
+0. (if you are using old versions of kexec-tools)
+ Apeend "root" to KDUMP_COMMANDLINE_REMOVE variable in /etc/sysconfig/kdump
+
+Live images are booted with a kernel parameter which looks like
+"root=live:CDLABEL=Fedora-WS-Live-25_A-2". This argument can't be recognized
+by dracut during kdump process and will cause failure of kdump. So we need
+to make sure 'root' parameter is removed during kdump process.
+
+1. Change dump target in /etc/kdump.conf
+
+When kdump is triggered in a Live environment, the default target /var/crash
+will not be mounted and unable to be used to save vmcore. You can modify it to
+make kdump save the captured dump file on an external disk or send it with ssh
+throught network.
+
+2. Run 'kdumpctl start' to build kdump initramfs and start kdump.
+
+Here is all configurations you need to tweak manually. If you want to confirm
+whether kdump is working or not, you can use sys-trigger interface by running:
+
+ $ echo 1 > /proc/sys/kernel/sysrq
+ $ echo c > /proc/sysrq-trigger
7 years, 6 months
[PATCH v2] kdumpctl: filter 'root' kernel parameter when running in
live images
by Tong Li
Live images are booted with a kernel parameter which looks like
"root=live:CDLABEL=Fedora-WS-Live-25_A-2". This argument can't be
recognized by dracut during kdump process and will cause failure
of kdump if users didn't set KUDMP_COMMANDLINE in /etc/sysconfig/kdump.
So we should filter 'root' out when we find such a parameter in
/proc/cmdline to make kdump work correctly in live images.
Signed-off-by: Tong Li <tonli(a)redhat.com>
---
kdumpctl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index d0bbb55..13d85c6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -106,6 +106,10 @@ prepare_cmdline()
local cmdline;
if [ -z "$KDUMP_COMMANDLINE" ]; then
cmdline=`cat /proc/cmdline`
+ # 'root' parameter will result kdump failure in live images
+ if [[ ${cmdline} == *"root=live"* ]]; then
+ KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root"
+ fi
else
cmdline=${KDUMP_COMMANDLINE}
fi
--
2.7.4
7 years, 6 months
[PATCH v2] Documentation: step by step guide on confiuring kdump in
live images
by Tong Li
This is a short documentation on how to setup kdump on live images. All steps
was tested on Fedora 25 Alpha LiveCD and successfully saved vmcore captured
by kdump to a USB stick.
Signed-off-by: Tong Li <tonli(a)redhat.com>
---
live-image-kdump-howto.txt | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 live-image-kdump-howto.txt
diff --git a/live-image-kdump-howto.txt b/live-image-kdump-howto.txt
new file mode 100644
index 0000000..e57e75b
--- /dev/null
+++ b/live-image-kdump-howto.txt
@@ -0,0 +1,23 @@
+Kdump now works on live images with some manual configurations. Here is the step
+by step guide.
+
+1. Enable crashkernel reservation
+
+Since there isn't any config files that can be used for adding kernel parameters
+for Live images, we have to append 'crashkernel' argument in boot menu every
+time we boot a Live image.
+
+2. Change dump target in /etc/kdump.conf
+
+When kdump kernel boots in a live environment, the default target /var/crash is
+in in ram so you need change the dump target to an external disk or an network
+dump target.
+
+3. Start kdump service
+
+ $ kdumpctl start
+
+4. Trigger a kdump test
+
+ $ echo 1 > /proc/sys/kernel/sysrq
+ $ echo c > /proc/sysrq-trigger
--
2.7.4
7 years, 6 months
[PATCH] kdumpctl: filter 'root' kernel parameter when running in
live images
by Tong Li
Live images are booted with a kernel parameter which looks like
"root=live:CDLABEL=Fedora-WS-Live-25_A-2". This argument can't be
recognized by dracut during kdump process and will cause failure
of kdump. So we should filter 'root' out when we find such a
parameter in /proc/cmdline to make kdump work correctly in live
images.
Signed-off-by: Tong Li <tonli(a)redhat.com>
---
kdumpctl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index d0bbb55..66f3ff7 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -27,6 +27,11 @@ if [ -f /etc/sysconfig/kdump ]; then
. /etc/sysconfig/kdump
fi
+# root parameter will result kdump failure in live images
+if [[ $(cat /proc/cmdline) == *"root=live:CDLABEL"* ]]; then
+ KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root"
+fi
+
single_instance_lock()
{
local rc timeout=5
--
2.7.4
7 years, 6 months
[PATCH 1/2] kdump/fadump: fix network interface name when switching
from fadump to kdump
by Hari Bathini
When a remote dump target is specified, kdump dracut module prefixes
'kdump-' to network interface name (ifname) as kernel assigned names
are not persistent. In fadump mode, kdump dracut module is added to
the default initrd, which adds the 'kdump-' prefix to the ifname of
the prodcution kernel itself. If fadump mode is disabled after this,
kdump dracut module picks the ifname that is already prefixed with
'kdump-' in the production kernel and adds another 'kdump-' to it,
making the ifname something like kdump-kdump-eth0 for kdump kernel.
Eventually, kdump kernel fails with below traces:
dracut-initqueue[246]: RTNETLINK answers: Network is unreachable
dracut-initqueue[246]: arping: Device kdump-kdump-eth0 not available.
The ip command shows the below:
kdump:/# ip addr show kdump-kdump-eth0
2: kdump-kdump-eth: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 \
qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 22:82:87:7b:98:02 brd ff:ff:ff:ff:ff:ff
inet6 2002:903:15f:550:2082:87ff:fe7b:9802/64 scope global \
mngtmpaddr dynamic
valid_lft 2591890sec preferred_lft 604690sec
inet6 fe80::2082:87ff:fe7b:9802/64 scope link
valid_lft forever preferred_lft forever
kdump:/#
The trailing 0 from kdump-kdump-eth0 is missing in the ifname, probably
truncated while setting.
This patch fixes this by avoiding addition of the prefix 'kdump-' when
such prefix is already present in the ifname.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.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 68e0ff8..490501a 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -161,7 +161,8 @@ kdump_get_perm_addr() {
kdump_setup_ifname() {
local _ifname
- if [[ $1 =~ eth* ]]; then
+ # If ifname has 'kdump-' prefix, don't add it again
+ if [[ $1 =~ eth* ]] && [[ ! $1 =~ ^kdump-* ]]; then
_ifname="kdump-$1"
else
_ifname="$1"
7 years, 6 months