]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix the VHD(x) boot issue introduced in 1.0.87.
authorlongpanda <admin@ventoy.net>
Tue, 10 Jan 2023 01:37:05 +0000 (09:37 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 10 Jan 2023 01:37:05 +0000 (09:37 +0800)
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c

index 41452b9f77f5d1118623167afcabbe4b275ea720..26baa8b49c52bbc7a6cae2072d3771aed28c9aff 100644 (file)
@@ -262,6 +262,10 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1,
     }
     else
     {
     }
     else
     {
+        if (offset == 0)
+        {
+            offset = gpt->MBR.PartTbl[partIndex].StartSectorId;
+        }
         offset *= 512;
         debug("MBR disk signature: %02x%02x%02x%02x Part(%d) offset:%llu\n",
             gpt->MBR.BootCode[0x1b8 + 0], gpt->MBR.BootCode[0x1b8 + 1],
         offset *= 512;
         debug("MBR disk signature: %02x%02x%02x%02x Part(%d) offset:%llu\n",
             gpt->MBR.BootCode[0x1b8 + 0], gpt->MBR.BootCode[0x1b8 + 1],