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@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
On 01/29/15 at 03:17pm, Baoquan He wrote:
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@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.
The last sentence can be dropped "It's empty if not specified", it is confusing. Otherwise:
Acked-by: Dave Young dyoung@redhat.com
Bao, thanks for the update.
Dave
On 01/29/15 at 03:31pm, Dave Young wrote:
On 01/29/15 at 03:17pm, Baoquan He wrote:
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@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.
The last sentence can be dropped "It's empty if not specified", it is confusing. Otherwise:
Acked-by: Dave Young dyoung@redhat.com
Bao, thanks for the update.
Hmm, we need take care of ppc64 and s390x, at least do a test. For s390x there's no grub, not sure if BOOT_IMAGE is same. so Bao can you change the code to check [ -n "$BOOT_IMAGE" ] before calling dirname or there will be an error even it works ok in functionality.
Thanks Dave
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@redhat.com --- kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 17 +++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 37 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..aed62e3 100755 --- a/kdumpctl +++ b/kdumpctl @@ -292,6 +292,21 @@ 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. + [ -n "$KDUMP_BOOTDIR" ] && return + _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 +326,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
On 01/29/15 at 04:06pm, Baoquan He wrote:
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@redhat.com
kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 17 +++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 37 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..aed62e3 100755 --- a/kdumpctl +++ b/kdumpctl @@ -292,6 +292,21 @@ 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.
- [ -n "$KDUMP_BOOTDIR" ] && return
- _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 +326,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
Tested on ppc64, it works. I have not got a s390 machine.
Asked a console log from qzhao for s390 boot: https://bugzilla.redhat.com/show_bug.cgi?id=1185460
Seems there is BOOT_IMAGE=0 in cmdline, it should has different meanings. But this patch will work on all grub booted machines.
One possible fix is to exclude s390, for s390 just use /boot.
Thanks Dave
On 01/29/15 at 05:57pm, Dave Young wrote:
On 01/29/15 at 04:06pm, Baoquan He wrote:
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@redhat.com
kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 17 +++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 37 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..aed62e3 100755 --- a/kdumpctl +++ b/kdumpctl @@ -292,6 +292,21 @@ 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.
- [ -n "$KDUMP_BOOTDIR" ] && return
- _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 +326,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
Tested on ppc64, it works. I have not got a s390 machine.
Asked a console log from qzhao for s390 boot: https://bugzilla.redhat.com/show_bug.cgi?id=1185460
Oops, link is below:
http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2015/01/8528/852814...
Seems there is BOOT_IMAGE=0 in cmdline, it should has different meanings. But this patch will work on all grub booted machines.
One possible fix is to exclude s390, for s390 just use /boot.
Thanks Dave _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
OK, let me post a v5 patch to exclude s390x.
Tested on ppc64, it works. I have not got a s390 machine.
Asked a console log from qzhao for s390 boot: https://bugzilla.redhat.com/show_bug.cgi?id=1185460
Seems there is BOOT_IMAGE=0 in cmdline, it should has different meanings. But this patch will work on all grub booted machines.
One possible fix is to exclude s390, for s390 just use /boot.
Thanks Dave
Hi,
I built a test package with v5 patch, and Colin built it into an Atomic tree for testing. I removed the previous initramfs-kdump.img and rebooted.
After reboot, the kdump service was able to automatically locate the /boot/ostree/* directory containing the kernel vmlinuz and build a new initramfs-kdump.img. I then crashed the system. Here is a snippet from the console log:
kdump: dump target is /dev/mapper/atomicos-root kdump: saving to /sysroot//crash/127.0.0.1-2015.01.29-16:10:24/ kdump: saving vmcore-dmesg.txt kdump: saving vmcore-dmesg.txt complete kdump: saving vmcore Copying data : [100.0 %] - kdump: saving vmcore complete Stopping Kdump Vmcore Save Service... [ OK ] Stopped Kdump Vmcore Save Service.
And after boot:
-bash-4.2# ls -alhR /sysroot/crash /sysroot/crash: total 4.0K drwxr-xr-x. 3 root root 42 Jan 29 16:25 . drwxr-xr-x. 12 root root 4.0K Jan 29 13:55 .. drwxr-xr-x. 2 root root 42 Jan 29 16:10 127.0.0.1-2015.01.29-16:10:24
/sysroot/crash/127.0.0.1-2015.01.29-16:10:24: total 186M drwxr-xr-x. 2 root root 42 Jan 29 16:10 . drwxr-xr-x. 3 root root 42 Jan 29 16:25 .. -rw-------. 1 root root 186M Jan 29 16:10 vmcore -rw-r--r--. 1 root root 40K Jan 29 16:10 vmcore-dmesg.txt
-bash-4.2# grep KDUMP_BOOTDIR /etc/sysconfig/kdump KDUMP_BOOTDIR=""
-bash-4.2# rpm -q kexec-tools kexec-tools-2.0.7-15.1_atomic.el7.x86_64
----- Original Message -----
From: "Baoquan He" bhe@redhat.com To: "Dave Young" dyoung@redhat.com Cc: kexec@lists.fedoraproject.org, walters@redhat.com, jeder@redhat.com Sent: Thursday, January 29, 2015 5:08:20 AM Subject: Re: [Patch v4] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
OK, let me post a v5 patch to exclude s390x.
Tested on ppc64, it works. I have not got a s390 machine.
Asked a console log from qzhao for s390 boot: https://bugzilla.redhat.com/show_bug.cgi?id=1185460
Seems there is BOOT_IMAGE=0 in cmdline, it should has different meanings. But this patch will work on all grub booted machines.
One possible fix is to exclude s390, for s390 just use /boot.
Thanks Dave
On 01/29/15 at 11:28am, Jeremy Eder wrote:
Hi,
I built a test package with v5 patch, and Colin built it into an Atomic tree for testing. I removed the previous initramfs-kdump.img and rebooted.
After reboot, the kdump service was able to automatically locate the /boot/ostree/* directory containing the kernel vmlinuz and build a new initramfs-kdump.img. I then crashed the system. Here is a snippet from the console log:
Thanks for testing, glad to see it works. But we have more discussion and worries about the patch, we need to sort out all cases for kdump bootdir logic.
kdump: dump target is /dev/mapper/atomicos-root kdump: saving to /sysroot//crash/127.0.0.1-2015.01.29-16:10:24/ kdump: saving vmcore-dmesg.txt kdump: saving vmcore-dmesg.txt complete kdump: saving vmcore Copying data : [100.0 %] - kdump: saving vmcore complete Stopping Kdump Vmcore Save Service... [ OK ] Stopped Kdump Vmcore Save Service.
And after boot:
-bash-4.2# ls -alhR /sysroot/crash /sysroot/crash: total 4.0K drwxr-xr-x. 3 root root 42 Jan 29 16:25 . drwxr-xr-x. 12 root root 4.0K Jan 29 13:55 .. drwxr-xr-x. 2 root root 42 Jan 29 16:10 127.0.0.1-2015.01.29-16:10:24
/sysroot/crash/127.0.0.1-2015.01.29-16:10:24: total 186M drwxr-xr-x. 2 root root 42 Jan 29 16:10 . drwxr-xr-x. 3 root root 42 Jan 29 16:25 .. -rw-------. 1 root root 186M Jan 29 16:10 vmcore -rw-r--r--. 1 root root 40K Jan 29 16:10 vmcore-dmesg.txt
-bash-4.2# grep KDUMP_BOOTDIR /etc/sysconfig/kdump KDUMP_BOOTDIR=""
-bash-4.2# rpm -q kexec-tools kexec-tools-2.0.7-15.1_atomic.el7.x86_64
----- Original Message -----
From: "Baoquan He" bhe@redhat.com To: "Dave Young" dyoung@redhat.com Cc: kexec@lists.fedoraproject.org, walters@redhat.com, jeder@redhat.com Sent: Thursday, January 29, 2015 5:08:20 AM Subject: Re: [Patch v4] kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
OK, let me post a v5 patch to exclude s390x.
Tested on ppc64, it works. I have not got a s390 machine.
Asked a console log from qzhao for s390 boot: https://bugzilla.redhat.com/show_bug.cgi?id=1185460
Seems there is BOOT_IMAGE=0 in cmdline, it should has different meanings. But this patch will work on all grub booted machines.
One possible fix is to exclude s390, for s390 just use /boot.
Thanks Dave
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@redhat.com --- kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 19 +++++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 39 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..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 + _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
On Thu, Jan 29, 2015 at 06:09:11PM +0800, Baoquan He wrote:
[..]
+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
- _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
I think a better way to code this is following.
if user_specified_boot; use_it; return; else if is_it_atomic_system; look for boot_image on /proc/cmdline; return else use /boot fi
That way you don't have to hardcode things for s390. And behavior will remain unchanged for systems which are not atomic.
And you can grep for ostree= on /proc/cmdline to figure out if you are booting on atomic system or not.
Thanks Vivek
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
On Thu, Jan 29, 2015 at 04:06:15PM +0800, Baoquan He wrote:
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.
I am not a big fan of changing anything in /etc/sysconfig/kdump until and unless we have to.
Reason being that this does not work over upgrades. So assume that you have already shipped a version of kexec-tools for atomic and now you are upgrading it to new version. In that case old /etc/sysconfig/kdump will be used and things will still be broken. So in general changing what we have already shipped can create problems.
In this case, GA is yet to go out of door, so it might fly. But then it creates confusion for our regular customers who might be surprised to see the empty BOOT dir.
Even if we have to do it this way, I think it might be better to *not* specify a value of BOOT and just keep it commented out. That would mean that kdump logic can assume its own default values.
I am not sure that what's wrong with the approach to look for kernel in /boot/ direcotry first and if we don't find it there, then adjust to /boot/<atomic>/ dir.
Anyway, I can live with this solution too (though I am not too happy about changing current options in /etc/sysconfig/kdump.). So let us atleasts comment out BOOT optoin instead of assuming that blank means we can choose our own /boot.
Signed-off-by: Baoquan He bhe@redhat.com
kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 17 +++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 37 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=""
Let us comment it out. And put a comment that if one does not specify it then scripts will choose its own default. In most of the systems it will be /boot and in atomic systems it will be a subdirectory of /boot.
[..]
--- a/kdumpctl +++ b/kdumpctl @@ -292,6 +292,21 @@ get_pcs_cluster_modified_files() echo $modified_files }
+check_boot_dir() +{
How about calling it set_default_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.
- [ -n "$KDUMP_BOOTDIR" ] && return
- _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 +326,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
Thanks Vivek
On 01/29/15 at 08:21am, Vivek Goyal wrote:
On Thu, Jan 29, 2015 at 04:06:15PM +0800, Baoquan He wrote:
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.
I am not a big fan of changing anything in /etc/sysconfig/kdump until and unless we have to.
Reason being that this does not work over upgrades. So assume that you have already shipped a version of kexec-tools for atomic and now you are upgrading it to new version. In that case old /etc/sysconfig/kdump will be used and things will still be broken. So in general changing what we have already shipped can create problems.
In this case, GA is yet to go out of door, so it might fly. But then it creates confusion for our regular customers who might be surprised to see the empty BOOT dir.
Even if we have to do it this way, I think it might be better to *not* specify a value of BOOT and just keep it commented out. That would mean that kdump logic can assume its own default values.
We need carefully think about it. Comment out maybe better.
I am not sure that what's wrong with the approach to look for kernel in /boot/ direcotry first and if we don't find it there, then adjust to /boot/<atomic>/ dir.
Just because of intrducing support to ostree will make the defination of KDUMP_BOOTDIR confusing, it becomes not clear. Suppose it is "/boot" in sysconfig, but we actually use /boot/ostree/foo. It cause confusion to me.
BTW, even if we searching /boot, we need searching for os tree, there might be different os tree versions under /boot, I'm not sure though.
Anyway, I can live with this solution too (though I am not too happy about changing current options in /etc/sysconfig/kdump.). So let us atleasts comment out BOOT optoin instead of assuming that blank means we can choose our own /boot.
I found that the blocker flag is still not set, ditto for pm_ack, so I'm afraid we can not get this fixed in 7.1, we have only about half hour for this issue.
Signed-off-by: Baoquan He bhe@redhat.com
kdump.sysconfig.i386 | 4 ++-- kdump.sysconfig.ppc64 | 4 ++-- kdump.sysconfig.ppc64le | 4 ++-- kdump.sysconfig.s390x | 4 ++-- kdump.sysconfig.x86_64 | 4 ++-- kdumpctl | 17 +++++++++++++++++ kexec-kdump-howto.txt | 10 ++++++++++ 7 files changed, 37 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=""
Let us comment it out. And put a comment that if one does not specify it then scripts will choose its own default. In most of the systems it will be /boot and in atomic systems it will be a subdirectory of /boot.
[..]
--- a/kdumpctl +++ b/kdumpctl @@ -292,6 +292,21 @@ get_pcs_cluster_modified_files() echo $modified_files }
+check_boot_dir() +{
How about calling it set_default_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.
- [ -n "$KDUMP_BOOTDIR" ] && return
- _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 +326,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
Thanks Vivek _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec