On 01/29/15 at 06:09pm, Baoquan He wrote:
diff --git a/kdumpctl b/kdumpctl
index 1c97405..2d1349d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -292,6 +292,23 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
+check_boot_dir()
+{
+ local _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.
+ #The BOOT_IMAGE is number like 0,1,.. , for now not handle it.
+ [ -n "$KDUMP_BOOTDIR" ] && return
+ [ "$(uname -m)" = "s390x" ] && return
Here return immediately if s390x while KDUMP_BOOTDIR just inherit empty
string.
NACK, will repost.
+ _boot_dir=$(cat /proc/cmdline | grep "BOOT_IMAGE")
+ if [ -z "$_boot_dir" ]; then
+ KDUMP_BOOTDIR="/boot"
+ else
+ eval $(echo "$_boot_dir" | 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