UINT32 j = 0;
UINT32 lbacount = 0;
UINT32 secNum = 0;
+ UINT32 TmpNum = 0;
+ UINT64 VirtSec = 0;
UINT64 offset = 0;
EFI_LBA curlba = 0;
EFI_LBA lastlba = 0;
{
return ventoy_read_iso_sector(Lba, secNum, Buffer);
}
+ else if (offset < g_chain->real_img_size_in_bytes)
+ {
+ TmpNum = (g_chain->real_img_size_in_bytes - offset) / 2048;
+ ventoy_read_iso_sector(Lba, TmpNum, Buffer);
+
+ Lba += TmpNum;
+ secNum -= TmpNum;
+ Buffer = (UINT8 *)Buffer + (g_chain->real_img_size_in_bytes - offset);
+ offset = Lba * 2048;
+ }
+
+ VirtSec = g_chain->virt_img_size_in_bytes / 2048;
+ if (Lba + secNum > VirtSec)
+ {
+ secNum = VirtSec - Lba;
+ }
if (secNum > g_sector_flag_num)
{
vt_linux_specify_initrd_file /antiX/initrd.gz
elif [ -f (loop)/360Disk/initrd.gz ]; then
vt_linux_specify_initrd_file /360Disk/initrd.gz
+ elif [ -f (loop)/porteus/initrd.xz ]; then
+ vt_linux_specify_initrd_file /porteus/initrd.xz
fi
}
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
+ if [ $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"
uint32_t lbacount = 0;
unsigned long lastbuffer;
uint64_t readend;
+ uint64_t VirtSec;
ventoy_virt_chunk *node;
ventoy_sector_flag *cur_flag;
ventoy_sector_flag *sector_flag = g_sector_flag;
ix86->regs.dl = sandev->drive;
return 0;
}
+ else if ((lba * 2048) < g_chain->real_img_size_in_bytes)
+ {
+ /* fix for grub4dos Inconsistent data read from error */
+ memset((void *)(buffer + (count - 1) * 2048), 0, 2048);
+
+ count = (g_chain->real_img_size_in_bytes / 2048) - lba;
+ ventoy_vdisk_read_real(lba, count, buffer);
+ ix86->regs.dl = sandev->drive;
+
+ lba += count;
+ buffer += count * 2048;
+ count = (readend - g_chain->real_img_size_in_bytes) / 2048;
+ }
+
+ VirtSec = g_chain->virt_img_size_in_bytes / 2048;
+ if (lba + count > VirtSec)
+ {
+ count = VirtSec - lba;
+ }
if (count > sizeof(g_sector_flag))
{