[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
Question: is there any automated way of building rpm package?
by HATAYAMA Daisuke
Hello,
Is there any automated way of building rpm package?
That is, installing files such eppic, kexec-tools-po, makedumpfile and kexec-tools with expected file names necessary for installation, place them proper file path location and then execute rpmbuild command.
I first found out there's no Makefile and INSTALL file, and then I tried preparing them manually in an ad-hoc way, but faced build failure several times and gave up.
--
Thanks.
HATAYAMA, Daisuke
8 years, 6 months
[PATCH] make kdump saving directory name consistent with RHEL6
by WANG Chao
Now we use the pattern:
<machine/ipaddr>-YYYY.MM.DD-HH:MM:SS
while rhel6 uses the following:
<machine/ipaddr>-YYYY-MM-DD-HH:MM:SS
This change may break someone's script and we should change it back to
keep consistent between releases.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump-lib-initramfs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 57b8304..68a94e8 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -7,7 +7,7 @@ CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
DEFAULT_ACTION="reboot"
-DATEDIR=`date +%Y.%m.%d-%T`
+DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
--
2.1.0
8 years, 9 months
[PATCH v7 0/4] Enhance kdump to support ipv6
by Minfei Huang
v7:
- use interface function is_ipv6_address to check whether is ipv6 or not
- fix some bugs
v6:
- construct the patches, split more small patches
- wrap the similar functional code to make it more clearly
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 (4):
mkdumprd: Add proper prefix "kdump-" before ethX in 2nd kernel
kdump-lib: Add a new function to get the ip address
kdump-lib: Add new libs to enhance kdump to support ipv6
ipv6: Enhance kdump to support ipv6
dracut-kdump.sh | 4 +-
dracut-module-setup.sh | 163 ++++++++++++++++++++++++++++++++++++-------------
kdump-lib.sh | 47 +++++++++++---
mkdumprd | 16 ++++-
4 files changed, 175 insertions(+), 55 deletions(-)
--
1.9.3
8 years, 10 months
[PATCH] dracut-moduel-setup.sh: Add the filter to verify the mount directory
by Minfei Huang
The crash dump is saved in the /sysroot/crash directory, not the
/sysroot/var/crash in the atomic system.
We will find the mount point by the command "df", if the directory is
mounted. But it is different between atomic system. "df /var/crash"
shows the "/var" is a mounted directory, but the "/var" is not a mounted
directory, for "df" command.
So add the filter to satisfy the mounted directory, that the mount point
will appear both "df" and "df $dir".
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ff7a088..b23de97 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -318,7 +318,10 @@ default_dump_target_install_conf()
_mntpoint=$(get_mntpoint_from_path $_save_path)
_target=$(get_target_from_path $_save_path)
- if [ "$_mntpoint" != "/" ]; then
+ # if the mount directory does not appear by the df command,
+ # the directory is not a mount directory,
+ # although the _mntpoint is "/", specified to the Atomic
+ if [ "$_mntpoint" != "/" ] && [ `df | grep "$_mntpoint" -q` ]; then
_fstype=$(get_fs_type_from_target $_target)
if $(is_fs_type_nfs $_fstype); then
--
1.9.3
8 years, 10 months
[Patch v6] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
by Baoquan He
Previously /boot is asumed as the default dir where kernel and initrd
is put. However, the directory containing the running kernel image
on Atomic systems differs in each installation. Usually something like:
/boot/ostree/rhel-atomic-host-b50a015b637c353dc6554c851f8a1212b60d6121a7316715e4a63e2a4113cd72
This means that kdump will not find vmlinuz when installed on an
Atomic host, and thus the kdump service will fail to start.
In this patch, the kdump boot dir finding behaviour is a little changed.
Firstly check whether user has specify a directory explicitly in
/etc/sysconfig/kdump. If yes that is respected. Otherwise we assume
1st kernel and kdump kernel are put in the same place under /boot.
Then find it according /proc/cmdline and append it to /boot/
Note:
So now the KDUMP_BOOTDIR in /etc/sysconfig/kdump is set as empty
by default. If user set KDUMP_BOOTDIR to a directory, then he need to
take care of all related things himself. otherwise kdump script handle
it automatically.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
kdumpctl | 19 +++++++++++++++++++
kexec-kdump-howto.txt | 10 ++++++++++
7 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 0d26a66..84b2447 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#KDUMP_BOOTDIR="/boot"
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 923aa26..5295626 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#KDUMP_BOOTDIR="/boot"
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 923aa26..5295626 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#KDUMP_BOOTDIR="/boot"
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 848b043..745dd27 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -29,7 +29,7 @@ MKDUMPRD_ARGS=""
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#KDUMP_BOOTDIR="/boot"
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 989c3c7..d9ad9b5 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#KDUMP_BOOTDIR="/boot"
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdumpctl b/kdumpctl
index 1c97405..31ceb47 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -292,6 +292,23 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
+check_boot_dir()
+{
+ local _is_atomic
+ #If user specify a boot dir for kdump kernel, let's use it. Otherwise
+ #check whether it's a atomic host. If yes parse the subdirectory under
+ #/boot; If not just find it under /boot.
+ [ -n "$KDUMP_BOOTDIR" ] && return
+
+ _is_atomic=$(cat /proc/cmdline | grep "ostree")
+ if [ -z "$_is_atomic" ] || [ "$(uname -m)" = "s390x" ]; then
+ KDUMP_BOOTDIR="/boot"
+ else
+ eval $(cat /proc/cmdline| grep "BOOT_IMAGE" | cut -d' ' -f1)
+ KDUMP_BOOTDIR="/boot"$(dirname $BOOT_IMAGE)
+ fi
+}
+
setup_target_initrd()
{
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
@@ -311,6 +328,8 @@ check_rebuild()
local _force_rebuild force_rebuild="0"
local initramfs_has_fadump
+ check_boot_dir
+
if [ -z "$KDUMP_KERNELVER" ]; then
kdump_kver=`uname -r`
else
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 5582e40..05b497f 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -404,6 +404,16 @@ Say foo.com:/export/tmp is mounted on /var. In this case dump target is
nfs server and path will be adjusted to "/crash" and dump will be saved to
foo.com:/export/tmp/crash/ directory.
+Kdump boot directory
+====================
+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.
Kdump Post-Capture Executable
--
1.8.5.3
8 years, 10 months
[Patch v3] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
by Baoquan He
Previously /boot is asumed as the default dir where kernel and initrd
is put. However, the directory containing the running kernel image
on Atomic systems differs in each installation. Usually something like:
/boot/ostree/rhel-atomic-host-b50a015b637c353dc6554c851f8a1212b60d6121a7316715e4a63e2a4113cd72
This means that kdump will not find vmlinuz when installed on an
Atomic host, and thus the kdump service will fail to start.
In this patch, the kdump boot dir finding behaviour is a little changed.
Firstly check whether user has specify a directory explicitly in
/etc/sysconfig/kdump. If yes that is respected. Otherwise we assume
1st kernel and kdump kernel are put in the same place under /boot.
Then find it according /proc/cmdline and append it to /boot/
Note:
So now the KDUMP_BOOTDIR in /etc/sysconfig/kdump is set as empty.
If user set KDUMP_BOOTDIR to other directory, then he need to
take care of all related things himself. Or kdump script handle
it automatically.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kdump.sysconfig.i386 | 4 ++--
kdump.sysconfig.ppc64 | 4 ++--
kdump.sysconfig.ppc64le | 4 ++--
kdump.sysconfig.s390x | 4 ++--
kdump.sysconfig.x86_64 | 4 ++--
kdumpctl | 11 +++++++++++
kexec-kdump-howto.txt | 11 +++++++++++
7 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 0d26a66..bb10c93 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -25,8 +25,8 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
-#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#Where to find the boot image, you can specify a place here.
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 923aa26..bd7fb9d 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -25,8 +25,8 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
-#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#Where to find the boot image , you can specify a place here.
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 923aa26..e70409c 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -25,8 +25,8 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
-#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#Where to find the boot image, you can specify a place here.
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 848b043..c45d27b 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -28,8 +28,8 @@ MKDUMPRD_ARGS=""
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
-#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#Where to find the boot image, you can specify a place here.
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 989c3c7..abf358a 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -25,8 +25,8 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
-#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+#Where to find the boot image, you can specify a place here.
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdumpctl b/kdumpctl
index 1c97405..fb30934 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -292,6 +292,15 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
+check_boot_dir()
+{
+ #If user specify a boot dir for kdump kernel, let's use it. Otherwise
+ #assume it's in the same place as 1st kernel.
+ [ -n "$KDUMP_BOOTDIR" ] && return
+ eval $(cat /proc/cmdline | grep "BOOT_IMAGE" | cut -d' ' -f1)
+ KDUMP_BOOTDIR="/boot"$(dirname $BOOT_IMAGE)
+}
+
setup_target_initrd()
{
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
@@ -311,6 +320,8 @@ check_rebuild()
local _force_rebuild force_rebuild="0"
local initramfs_has_fadump
+ check_boot_dir
+
if [ -z "$KDUMP_KERNELVER" ]; then
kdump_kver=`uname -r`
else
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 5582e40..a7ec3ce 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -404,6 +404,17 @@ Say foo.com:/export/tmp is mounted on /var. In this case dump target is
nfs server and path will be adjusted to "/crash" and dump will be saved to
foo.com:/export/tmp/crash/ directory.
+Kdump boot directory
+====================
+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. It's empty if not
+specified.
Kdump Post-Capture Executable
--
1.8.5.3
8 years, 10 months
[Patch v2] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
by Baoquan He
Previously /boot is asumed as the default dir where kernel and initrd
is put. However, the directory containing the running kernel image
on Atomic systems differs in each installation. Usually something like:
/boot/ostree/rhel-atomic-host-b50a015b637c353dc6554c851f8a1212b60d6121a7316715e4a63e2a4113cd72
This means that kdump will not find vmlinuz when installed on an
Atomic host, and thus the kdump service will fail to start.
In this patch, get the sub directory where kernel is put and append
it to /boot.
Note:
If user change KDUMP_BOOTDIR to other directory, then he need to
take care of all related things himself. Otherswise situation
will become complicated.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
kdumpctl | 11 +++++++++++
kexec-kdump-howto.txt | 10 ++++++++++
7 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 0d26a66..35070f8 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 923aa26..2f2322b 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 923aa26..2f2322b 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 848b043..de85d59 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -29,7 +29,7 @@ MKDUMPRD_ARGS=""
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 989c3c7..e0732d0 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -26,7 +26,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
KEXEC_ARGS=""
#Where to find the boot image
-KDUMP_BOOTDIR="/boot"
+KDUMP_BOOTDIR=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
diff --git a/kdumpctl b/kdumpctl
index 1c97405..fb30934 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -292,6 +292,15 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
+check_boot_dir()
+{
+ #If user specify a boot dir for kdump kernel, let's use it. Otherwise
+ #assume it's in the same place as 1st kernel.
+ [ -n "$KDUMP_BOOTDIR" ] && return
+ eval $(cat /proc/cmdline | grep "BOOT_IMAGE" | cut -d' ' -f1)
+ KDUMP_BOOTDIR="/boot"$(dirname $BOOT_IMAGE)
+}
+
setup_target_initrd()
{
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
@@ -311,6 +320,8 @@ check_rebuild()
local _force_rebuild force_rebuild="0"
local initramfs_has_fadump
+ check_boot_dir
+
if [ -z "$KDUMP_KERNELVER" ]; then
kdump_kver=`uname -r`
else
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 5582e40..05b497f 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -404,6 +404,16 @@ Say foo.com:/export/tmp is mounted on /var. In this case dump target is
nfs server and path will be adjusted to "/crash" and dump will be saved to
foo.com:/export/tmp/crash/ directory.
+Kdump boot directory
+====================
+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.
Kdump Post-Capture Executable
--
1.8.5.3
8 years, 10 months
[PATCH] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
by Baoquan He
Previously /boot is asumed as the default dir where kernel and initrd
is put. However, the directory containing the running kernel image
on Atomic systems differs in each installation. Usually something like:
/boot/ostree/rhel-atomic-host-b50a015b637c353dc6554c851f8a1212b60d6121a7316715e4a63e2a4113cd72
This means that kdump will not find vmlinuz when installed on an
Atomic host, and thus the kdump service will fail to start.
In this patch, get the sub directory where kernel is put and append
it to /boot.
Note:
If user change KDUMP_BOOTDIR to other directory, then he need to
take care of all related things himself. Otherswise situation
will become complicated.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kdumpctl | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 1c97405..aac1118 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -292,6 +292,15 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
+adjust_boot_dir()
+{
+ #If user specify different boot dir then /boot, he need take care of
+ # the whole thing like /boot//ostree/rhel-atomicxxxx/vmlinuz-xxx
+ [ $KDUMP_BOOTDIR != "/boot" ] && return
+ eval $(cat /proc/cmdline | grep "BOOT_IMAGE" | cut -d' ' -f1)
+ KDUMP_BOOTDIR=$KDUMP_BOOTDIR$(dirname $BOOT_IMAGE)
+}
+
setup_target_initrd()
{
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
@@ -311,6 +320,8 @@ check_rebuild()
local _force_rebuild force_rebuild="0"
local initramfs_has_fadump
+ adjust_boot_dir
+
if [ -z "$KDUMP_KERNELVER" ]; then
kdump_kver=`uname -r`
else
--
1.8.5.3
8 years, 10 months
[PATCH v4] Hardware iSCSI boot disk support
by WANG Chao
In 1st kernel, the iscsi device could be both software or hardware
based. But we only use software iscsi in 2nd kernel. This is fine for
software iscsi as it's consistent with 1st kernel. However kdump
bringing up hardware iscsi in software mode could lead conflicts with
dracut bringing up logic, depending on the configuration.
If boot disk is hardware iscsi, we should still use hardware iscsi in
2nd kernel. In this case, dracut will bring up the device like it does
for normal boot. kdump don't need to do extra work to configure software
iscsi.
[Quoting from Bao]
hw iscsi --> rd.iscsi.firmware=1 need be specified in
cmdline of 1st kernel
/
HBA (bios)
\ ip=ibft need be specified in cmdline. But if no
rd.iscsi.firmware=1, only bring up that NIC
For above 2 cases, we did nothing in kdump shell since it's enough to inherit
the kernel cmdline of 1st kernel. And both of them are only concerned
with the case which boot disk is dump target.
HBA -> /dev/sdx
For above case, the hw firmare is very smart and can take care of
anything. When system bootup if will appear automatically. This works
for kdump kernel too.
[End of quoting]
The other iscsi cases have very complicated combinations, which I've
tried to cover but fail. Since they're the cases not requested by
customers, I think we can handle them case by case in the future. Anyway
we've been stucking at hardware iscsi for a while. If this kind of
partial fix works for most of the use case, I think we can add this
first.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ff7a088..3c96076 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -415,7 +415,11 @@ kdump_get_iscsi_initiator() {
return 1
}
-# No ibft handling yet.
+# Figure out if the iscsi session is based on iBFT or firmware
+kdump_handle_hw_iscsi() {
+ [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]
+}
+
kdump_setup_iscsi_device() {
local path=$1
local tgt_name; local tgt_ipaddr;
@@ -438,6 +442,10 @@ kdump_setup_iscsi_device() {
return 1
fi
+ if kdump_handle_hw_iscsi ${path}; then
+ return 0
+ fi
+
tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
--
2.1.0
8 years, 10 months