From 1300f7f4f1d92ff1c0502e2b3bd9c18fef8da7d1 Mon Sep 17 00:00:00 2001 From: longpanda Date: Tue, 10 Jan 2023 09:37:05 +0800 Subject: [PATCH] Fix the VHD(x) boot issue introduced in 1.0.87. --- GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c index 41452b9f..26baa8b4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c @@ -262,6 +262,10 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1, } 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],