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