[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, 6 months
[PATCH v15 0/4] Enhance Kdump to support ipv6 protocol
by Minfei Huang
Talked with Dave Young, we decide to simplify the patch to only support
non local ipv6 address from this patchset, and will support local ipv6
address in later patch. The reason why do this is it is hard to handle
and review the patchset which supports both modes.
In order to make static ip work in Kdump, we shall merge the patch
"dracut-module-setup: Apply the manual DNS to the 2nd kernel" firstly.
Minfe Huang (4):
dracut-kdump: Use the first filtered ip address as dump directory
dracut-module-setup: Support the network for ipv6 protocol
dracut-module-setup: Prefer ipv4 address as the hostname address
dracut-module-setup: Enhance ISCSI to support ipv6 protocol
dracut-kdump.sh | 4 +--
dracut-module-setup.sh | 78 +++++++++++++++++++++++++++++++++-----------------
kdump-lib.sh | 29 +++++++++++++++++++
3 files changed, 83 insertions(+), 28 deletions(-)
--
2.1.0
8 years, 4 months
[PATCH] Move the lib get_persistent_dev to kdump-lib.sh
by Minfei Huang
Since get_persistent_dev is called in dracut-module-setup.sh and
mkdumprd, we move this lib from mkdumprd to kdump-lib.sh. Thus
dracut-module-setup.sh can use this lib, not the function in dracut.sh.
Copy the function get_persistent_dev from dracut to make the function
consistent.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 2 +-
kdump-lib.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
mkdumprd | 25 ++-----------------------
3 files changed, 46 insertions(+), 24 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index eeb348c..efafc16 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -43,7 +43,7 @@ kdump_to_udev_name() {
dev=`blkid -L "${dev#LABEL=}"`
;;
esac
- echo $(get_persistent_dev "$dev")
+ echo $(get_persistent_devce "$dev")
}
kdump_is_bridge() {
diff --git a/kdump-lib.sh b/kdump-lib.sh
index e62b4e2..35aa533 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -86,6 +86,49 @@ get_root_fs_device()
return
}
+# get_maj_min <device>
+# Prints the major and minor of a device node.
+# Example:
+# $ get_maj_min /dev/sda2
+# 8:2
+get_maj_min() {
+ local _maj _min _majmin
+ _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)"
+ printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
+}
+
+get_persistent_devce() {
+ local i _tmp _dev
+
+ _dev=$(get_maj_min "$1")
+ [ -z "$_dev" ] && {
+ perror_exit "Kernel dev name of $1 is not found."
+ }
+
+ for i in \
+ /dev/mapper/* \
+ /dev/disk/${persistent_policy:-by-uuid}/* \
+ /dev/disk/by-uuid/* \
+ /dev/disk/by-label/* \
+ /dev/disk/by-partuuid/* \
+ /dev/disk/by-partlabel/* \
+ /dev/disk/by-id/* \
+ /dev/disk/by-path/* \
+ ; do
+ [[ -e "$i" ]] || continue
+ [[ $i == /dev/mapper/control ]] && continue
+ [[ $i == /dev/mapper/mpath* ]] && continue
+ _tmp=$(get_maj_min "$i")
+ if [ "$_tmp" = "$_dev" ]; then
+ echo $i
+ return
+ fi
+ done
+
+ perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name"
+ echo $1
+}
+
# findmnt uses the option "-v, --nofsroot" to exclusive the [/dir]
# in the SOURCE column for bind-mounts, then if $_mntpoint equals to
# $_mntpoint_nofsroot, the mountpoint is not bind mounted directory.
diff --git a/mkdumprd b/mkdumprd
index 28ecdd7..ac8a63a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -29,26 +29,6 @@ perror() {
echo $@ >&2
}
-get_persistent_dev() {
- local i _tmp _dev
-
- _dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
- [ -z "$_dev" ] && {
- perror_exit "Kernel dev name of $1 is not found."
- }
-
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
- _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null)
- if [ "$_tmp" = "$_dev" ]; then
- echo $i
- return
- fi
- done
-
- perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name"
- echo $1
-}
-
add_dracut_arg() {
local arg qarg is_quoted=0
while [ $# -gt 0 ];
@@ -138,11 +118,10 @@ to_mount() {
_mntopts="$_target $_fstype $_options"
#for non-nfs _dev converting to use udev persistent name
if [ -b "$_source" ]; then
- _pdev="$(get_persistent_dev $_source)"
+ _pdev="$(get_persistent_devce $_source)"
if [ $? -ne 0 ]; then
return 1
fi
-
else
_pdev=$_dev
fi
@@ -565,7 +544,7 @@ do
dd if=$config_val count=1 of=/dev/null > /dev/null 2>&1 || {
perror_exit "Bad raw disk $config_val"
}
- _praw=$(get_persistent_dev $config_val)
+ _praw=$(get_persistent_devce $config_val)
if [ $? -ne 0 ]; then
exit 1
fi
--
2.1.0
8 years, 4 months
[PATCH] watchdog: load iTCO_wdt early in cmdline hook
by Dave Young
We have added *wdt in kdump initramfs, but to improve it more we can do below
(1) load wdt drivers as early as possible so that we can save time before wdt timeout
some drivers like iTCO_wdt can stop the watchdog while driver initialization, so
it can give more chance for kdump.
It can save time especially in case some drivers take long time to init, like
some storage and networking cards.
(2) add only used wdt drivers in kdump initrd instead of add *wdt
wdt driver layer need a change so that we can get the proper driver name from
/dev/watchdog. Question to this is are we sure 1st kernel use /dev/watchdog
instead of /dev/watchdog1? It need more investigation.
(3) in case a driver can not stop (nowayout?) during module_init, we need load it
as early as possible and kick the watchdog. Likely we can use systemd default
watchdog functionality.
This patch is about to address (1), and specially for iTCO_wdt, we only tested
iTCO_wdt, thus in this patch only add this driver, need investigate on other drivers
later to see if other drivers works in this way.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -666,7 +666,8 @@ install() {
installkernel() {
wdt=$(lsmod|cut -f1 -d' '|grep "wdt$")
if [ -n "$wdt" ]; then
- [ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
+ [ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich &&
+ echo "rd.driver.pre=lpc_ich,iTCO_wdt " >> ${initdir}/etc/cmdline.d/00-wdt.conf
instmods $wdt
fi
}
8 years, 4 months
[PATCH] kdumpctl: Add man page for kdumpctl
by Dangyi Liu
It has been complained that kdumpctl does not have a documentation.
This patch adds a simple man page for kdumpctl.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
kdumpctl.8 | 35 +++++++++++++++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 37 insertions(+)
create mode 100644 kdumpctl.8
diff --git a/kdumpctl.8 b/kdumpctl.8
new file mode 100644
index 0000000..2c30b7c
--- /dev/null
+++ b/kdumpctl.8
@@ -0,0 +1,35 @@
+.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.
+
+Available commands are
+.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"
+kdump.conf(5)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index cf37727..f7dc2b4 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -27,6 +27,7 @@ Source22: kdump-dep-generator.sh
Source23: kdump-anaconda-addon-005-10-gd16915f.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
8 years, 4 months
[PATCH v14 0/4] Enhance Kdump to support ipv6 protocol
by Minfei Huang
Talked with Dave Young, we decide to simplify the patch to only support
non local ipv6 address from this patchset, and will support local ipv6
address in later patch. The reason why do this is it is hard to handle
and review the patchset which supports both modes.
In order to make static ip work in Kdump, we shall merge the patch
"dracut-module-setup: Apply the manual DNS to the 2nd kernel" firstly.
Minfei Huang (4):
dracut-kdump: Use the first filtered ip address as dump directory
dracut-module-setup: Support the network for ipv6 protocol
dracut-module-setup: Prefer ipv4 address as the hostname address
dracut-module-setup: Enhance ISCSI to support ipv6 protocol
dracut-kdump.sh | 4 +--
dracut-module-setup.sh | 77 +++++++++++++++++++++++++++++++++-----------------
kdump-lib.sh | 29 +++++++++++++++++++
3 files changed, 82 insertions(+), 28 deletions(-)
--
2.1.0
8 years, 4 months
[PATCH V3] remove the incomplete kdump.img
by Chao Fan
If the directory where the kdump.img is saved has no enough space for the
kdump.img, after restarting kdump service, it will get an incomplete file
named initramfs-xxxkdump.img, the restarting of kdump service failed, but
did not remove the incomplete file. So when reboot the system, kdump will
load the incomplete file, and then when kernel crash, the kdump will fail
because the file initramfs-xxxkdump.img is incomplete.
So, if the dracut failed building the initramfs-xxxkdump.img, kdump should
remove the file initramfs-xxxkdump.img so that kdump will not load a wrong
initramfs-xxxkdump.img when reboot the system.
Signed-off-by: Chao Fan <cfan(a)redhat.com>
---
kdumpctl | 1 +
1 file changed, 1 insertion(+)
diff --git a/kdumpctl b/kdumpctl
index eaf7f67..b82e3f0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -175,6 +175,7 @@ rebuild_kdump_initrd()
$MKDUMPRD $TARGET_INITRD $kdump_kver
if [ $? != 0 ]; then
echo "mkdumprd: failed to make kdump initrd" >&2
+ rm -f $TARGET_INITRD
return 1
fi
--
2.1.0
8 years, 4 months
[PATCH] ppc64: erase unnecessary segment info printing
by Qiao Zhao
Backport the following commit from upstream kexec-tools:
commit 5af63fb
Author: Baoquan He <bhe(a)redhat.com>
Date: Wed Oct 29 16:19:55 2014 +0800
ppc64: erase unnecessary segment info printing
In ppc64 loading, it will print the segment information. This is not
wanted since other Archs don't have this. People even think there's
something wrong. So erase it to make it be consistent with other Archs.
And if people really want to check these info, they can specify "-d"
option. They are printed in print_segments() too.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
---
...4-erase-unnecessary-segment-info-printing.patch | 29 ++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 31 insertions(+)
create mode 100644 kexec-tools-2.0.8-ppc64-erase-unnecessary-segment-info-printing.patch
diff --git a/kexec-tools-2.0.8-ppc64-erase-unnecessary-segment-info-printing.patch b/kexec-tools-2.0.8-ppc64-erase-unnecessary-segment-info-printing.patch
new file mode 100644
index 0000000..b669ec7
--- /dev/null
+++ b/kexec-tools-2.0.8-ppc64-erase-unnecessary-segment-info-printing.patch
@@ -0,0 +1,29 @@
+In ppc64 loading, it will print the segment information. This is not
+wanted since other Archs don't have this. People even think there's
+something wrong. So erase it to make it be consistent with other Archs.
+
+And if people really want to check these info, they can specify "-d"
+option. They are printed in print_segments() too.
+
+Signed-off-by: Baoquan He <bhe at redhat.com>
+---
+ kexec/arch/ppc64/kexec-elf-ppc64.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
+index ce10367..4a1540e 100644
+--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
+@@ -377,10 +377,6 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
+ dbgprintf("opal_base is %llx\n", (unsigned long long) my_opal_base);
+ dbgprintf("opal_entry is %llx\n", (unsigned long long) my_opal_entry);
+
+- for (i = 0; i < info->nr_segments; i++)
+- fprintf(stderr, "segment[%d].mem:%p memsz:%zu\n", i,
+- info->segment[i].mem, info->segment[i].memsz);
+-
+ return 0;
+ }
+
+--
+1.9.0
diff --git a/kexec-tools.spec b/kexec-tools.spec
index cf37727..99f90f3 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -69,6 +69,7 @@ ExcludeArch: aarch64
#
# Patches 301 through 400 are meant for ppc64 kexec-tools enablement
#
+Patch301: kexec-tools-2.0.8-ppc64-erase-unnecessary-segment-info-printing.patch
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
@@ -104,6 +105,7 @@ tar -z -x -v -f %{SOURCE19}
tar -z -x -v -f %{SOURCE23}
+%patch301 -p1
%patch601 -p1
%ifarch ppc
--
1.9.3
8 years, 4 months
[PATCH V13 0/4] Enhance Kdump to support ipv6 protocol
by Minfei Huang
Talked with Dave Young, we decide to simplify the patch to only support
non local ipv6 address from this patchset, and will support local ipv6
address in later patch. The reason why do this is it is hard to handle
and review the patchset which supports both modes.
Minfei Huang (4):
dracut-kdump: Use the first filtered ip address as dump directory
dracut-module-setup: Support the static route for ipv6 protocol
dracut-module-setup: Setup network route to support ipv6 protocol
dracut-module-setup: Enhance ISCSI to support ipv6 protocol
dracut-kdump.sh | 4 +--
dracut-module-setup.sh | 70 ++++++++++++++++++++++++++++----------------------
kdump-lib.sh | 33 ++++++++++++++++++++++++
3 files changed, 74 insertions(+), 33 deletions(-)
--
2.1.0
8 years, 4 months
[PATCH V2] remove the incomplete kdump.img
by Chao Fan
If the directory where the kdump.img saved has not enough space for the
kdump.img, after restart kdump, it will get an incomplete file named
initramfs-xxxkdump.img, the restart of kdump failed, but did not remove the
incomplete file. So when reboot the system, kdump will load the incomplete
file, and then when kernel crash, the kdump will fail because the file
initramfs-xxxkdump.img is incomplete.
So, when the dracut failed build the initramfs-xxxkdump.img, kdump should
remove the file initramfs-xxxkdump.img so that kdump will not load a wrong
initramfs-xxxkdump.img when reboot the system.
Signed-off-by: Chao Fan <cfan(a)redhat.com>
---
kdumpctl | 1 +
1 file changed, 1 insertion(+)
diff --git a/kdumpctl b/kdumpctl
index eaf7f67..b82e3f0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -175,6 +175,7 @@ rebuild_kdump_initrd()
$MKDUMPRD $TARGET_INITRD $kdump_kver
if [ $? != 0 ]; then
echo "mkdumprd: failed to make kdump initrd" >&2
+ rm -f $TARGET_INITRD
return 1
fi
--
2.1.0
8 years, 4 months