On 01/28/15 at 04:56pm, Dave Young wrote:
On 01/28/15 at 04:29pm, 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, 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
Hi, Bao
check_rebuild()
{
[snip]
kdump_kernel="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}"
setup_target_initrd
[snip]
The first use of KDUMP_BOOTDIR is in check_rebuild, so should move the adjust_boot_dir
to check_rebuild or at the beggining of kdumpctl and after sourcing sysconfig
Otherwise, it looks good
Hmm, I missed the diff context line.
Acked-by: Dave Young <dyoung(a)redhat.com>