mkdumprd: ensure ssh path exists before check size

check_size checks if the specified dump path on the ssh target have
enough space. And if the path doesn't exits, it will fail and exit.

mkdir_save_path_ssh should be called first to check if the path
exists, and create the path if it doesn't exits, so the size check
can always work properly.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Pingfan Liu <piliu@redhat.com>
This commit is contained in:
Kairui Song 2019-10-18 14:10:15 +08:00
parent 882b920c2f
commit 18ee888eab

View File

@ -429,10 +429,10 @@ do
ssh)
if strstr "$config_val" "@";
then
check_size ssh $config_val
mkdir_save_path_ssh $config_val
check_size ssh $config_val
add_dracut_module "ssh-client"
add_dracut_sshkey "$SSH_KEY_LOCATION"
add_dracut_sshkey "$SSH_KEY_LOCATION"
else
perror_exit "Bad ssh dump target $config_val"
fi