Display warning message if ISO file has an invalid size.

This commit is contained in:
longpanda
2021-02-03 13:56:28 +08:00
parent 61d4248d51
commit a37c6af8d0
3 changed files with 44 additions and 3 deletions

View File

@@ -964,7 +964,19 @@ function iso_common_menuentry {
unset vt_volume_id
vt_chosen_img_path vt_chosen_path vt_chosen_size
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
if [ $vt_volume_space -ne $vt_chosen_size ]; then
vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
if [ $vt_volume_space -gt $vt_chosen_size -o $vt_chosen_size_mod -ne 0 ]; then
echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n"
echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n"
echo -e "\n press ENTER to exit (请按 回车 键返回) ..."
read vtInputKey
return
fi
fi
if vt_check_password "${vt_chosen_path}"; then
return