On 2016/11/17 at 14:22, Dave Young wrote:
On 11/17/16 at 02:02pm, Xunlei Pang wrote:
> On 2016/11/17 at 12:52, Dave Young wrote:
>> Although we use by-id in mkdumprd as persistent policy for the dump target
>> checking, finally it is not used in kdump 2nd kernel because we call dracut
>> function in module-setup.sh without persistent policy specified that means
>> kdump will copy default "by-uuid" dev name.
> This is really a good catch.
>
>> Though by-uuid usually works and it is still better to fix it as raw disk
>> uuid make no sense.
>>
>> Also do not need to call bind mount adjust function for raw dump, here add
>> another switch case for raw dump and cleanup the functions with short
>> variable names to keep code shorter.
>>
>> Signed-off-by: Dave Young <dyoung(a)redhat.com>
>> ---
>> dracut-module-setup.sh | 28 +++++++++++++++++-----------
>> 1 file changed, 17 insertions(+), 11 deletions(-)
>>
>> --- kexec-tools.orig/dracut-module-setup.sh
>> +++ kexec-tools/dracut-module-setup.sh
>> @@ -438,32 +438,38 @@ adjust_bind_mount_path()
>>
>> #install kdump.conf and what user specifies in kdump.conf
>> kdump_install_conf() {
>> + local _opt _val _pdev
>> sed -ne '/^#/!p' /etc/kdump.conf > ${initdir}/tmp/$$-kdump.conf
>>
>> - while read config_opt config_val;
>> + while read _opt _val;
>> do
>> # remove inline comments after the end of a directive.
>> - config_val=$(strip_comments $config_val)
>> - case "$config_opt" in
>> - ext[234]|xfs|btrfs|minix|raw)
>> - sed -i -e "s#^$config_opt[[:space:]]\+$config_val#$config_opt
$(kdump_to_udev_name $config_val)#" ${initdir}/tmp/$$-kdump.conf
>> + _val=$(strip_comments $_val)
>> + case "$_opt" in
>> + raw)
>> + _pdev=$(persistent_policy="by-id" kdump_to_udev_name
$_val)
> I was a little confused after reading kdump_to_udev_name(), whether should it be
called udev name or persistent dev?
> Is there any difference between them?
persistent_dev_name should be better, but the function name will be too
long?
How about kdump_get_persistent_dev, like the just removed one?
Thanks
Dave
> Regards,
> Xunlei
>
>> + sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#"
${initdir}/tmp/$$-kdump.conf
>> + ;;
>> + ext[234]|xfs|btrfs|minix)
>> + _pdev=$(kdump_to_udev_name $_val)
>> + sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#"
${initdir}/tmp/$$-kdump.conf
>> if is_atomic; then
>> - adjust_bind_mount_path "$config_val"
>> + adjust_bind_mount_path "$_val"
>> fi
>> ;;
>> ssh|nfs)
>> - kdump_install_net "$config_val"
>> + kdump_install_net "$_val"
>> ;;
>> dracut_args)
>> - if [[ $(get_dracut_args_fstype "$config_val") = nfs* ]] ;
then
>> - kdump_install_net "$(get_dracut_args_target
"$config_val")"
>> + if [[ $(get_dracut_args_fstype "$_val") = nfs* ]] ; then
>> + kdump_install_net "$(get_dracut_args_target
"$_val")"
>> fi
>> ;;
>> kdump_pre|kdump_post|extra_bins)
>> - dracut_install $config_val
>> + dracut_install $_val
>> ;;
>> core_collector)
>> - dracut_install "${config_val%%[[:blank:]]*}"
>> + dracut_install "${_val%%[[:blank:]]*}"
>> ;;
>> esac
>> done < /etc/kdump.conf