diff --git a/INSTALL/tool/VentoyWorker.sh b/INSTALL/tool/VentoyWorker.sh index fa2af33a..7844b922 100644 --- a/INSTALL/tool/VentoyWorker.sh +++ b/INSTALL/tool/VentoyWorker.sh @@ -625,10 +625,14 @@ else check_umount_disk "$DISK" vtoycli partresize -s $DISK $part2_start fi + - vtinfo "update esp partition attribute" - vtoycli gpt -f $DISK - sync + if [ "$PART1_TYPE" = "EE" ]; then + vtinfo "update esp partition attribute" + vtoycli gpt -f $DISK + sync + fi + echo "" vtinfo "Update Ventoy on $DISK successfully finished." diff --git a/INSTALL/tool/aarch64/V2DServer b/INSTALL/tool/aarch64/V2DServer index 64fbbbc4..a35bd7d1 100644 Binary files a/INSTALL/tool/aarch64/V2DServer and b/INSTALL/tool/aarch64/V2DServer differ diff --git a/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 b/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 index 65f84ec2..e0203a81 100644 Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 and b/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 differ diff --git a/INSTALL/tool/aarch64/Ventoy2Disk.qt5 b/INSTALL/tool/aarch64/Ventoy2Disk.qt5 index cc7630ae..4a3f5fb9 100644 Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.qt5 and b/INSTALL/tool/aarch64/Ventoy2Disk.qt5 differ diff --git a/INSTALL/tool/aarch64/vtoycli b/INSTALL/tool/aarch64/vtoycli index 0ce9c93a..7186ceb7 100644 Binary files a/INSTALL/tool/aarch64/vtoycli and b/INSTALL/tool/aarch64/vtoycli differ diff --git a/INSTALL/tool/i386/V2DServer b/INSTALL/tool/i386/V2DServer index 1f809e74..f394355a 100644 Binary files a/INSTALL/tool/i386/V2DServer and b/INSTALL/tool/i386/V2DServer differ diff --git a/INSTALL/tool/i386/Ventoy2Disk.gtk2 b/INSTALL/tool/i386/Ventoy2Disk.gtk2 index 697631b9..32fb5104 100644 Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk2 and b/INSTALL/tool/i386/Ventoy2Disk.gtk2 differ diff --git a/INSTALL/tool/i386/Ventoy2Disk.gtk3 b/INSTALL/tool/i386/Ventoy2Disk.gtk3 index 7dc3ad7c..a2ed8300 100644 Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk3 and b/INSTALL/tool/i386/Ventoy2Disk.gtk3 differ diff --git a/INSTALL/tool/i386/Ventoy2Disk.qt5 b/INSTALL/tool/i386/Ventoy2Disk.qt5 index 3ba83071..2f5efb36 100644 Binary files a/INSTALL/tool/i386/Ventoy2Disk.qt5 and b/INSTALL/tool/i386/Ventoy2Disk.qt5 differ diff --git a/INSTALL/tool/i386/vtoycli b/INSTALL/tool/i386/vtoycli index cbe2d989..02eae99e 100644 Binary files a/INSTALL/tool/i386/vtoycli and b/INSTALL/tool/i386/vtoycli differ diff --git a/INSTALL/tool/mips64el/V2DServer b/INSTALL/tool/mips64el/V2DServer index b4d9fe66..8ea50cb0 100644 Binary files a/INSTALL/tool/mips64el/V2DServer and b/INSTALL/tool/mips64el/V2DServer differ diff --git a/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 b/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 index e53bb8b7..60d7cb94 100644 Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 and b/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 differ diff --git a/INSTALL/tool/mips64el/Ventoy2Disk.qt5 b/INSTALL/tool/mips64el/Ventoy2Disk.qt5 index e919b933..903c3e0e 100644 Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.qt5 and b/INSTALL/tool/mips64el/Ventoy2Disk.qt5 differ diff --git a/INSTALL/tool/mips64el/vtoycli b/INSTALL/tool/mips64el/vtoycli index 4a0e20b1..18ecd6a4 100644 Binary files a/INSTALL/tool/mips64el/vtoycli and b/INSTALL/tool/mips64el/vtoycli differ diff --git a/INSTALL/tool/x86_64/V2DServer b/INSTALL/tool/x86_64/V2DServer index bb1235f6..aff2c386 100644 Binary files a/INSTALL/tool/x86_64/V2DServer and b/INSTALL/tool/x86_64/V2DServer differ diff --git a/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 b/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 index 4eea1035..b9aa5137 100644 Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 differ diff --git a/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 b/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 index 8e691928..27c22608 100644 Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 differ diff --git a/INSTALL/tool/x86_64/Ventoy2Disk.qt5 b/INSTALL/tool/x86_64/Ventoy2Disk.qt5 index e87fe82c..82dd6e06 100644 Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.qt5 and b/INSTALL/tool/x86_64/Ventoy2Disk.qt5 differ diff --git a/INSTALL/tool/x86_64/vtoycli b/INSTALL/tool/x86_64/vtoycli index ab36a282..1e5c1b3a 100644 Binary files a/INSTALL/tool/x86_64/vtoycli and b/INSTALL/tool/x86_64/vtoycli differ diff --git a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c index ec0c3ca9..88f0e953 100644 --- a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c +++ b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c @@ -807,6 +807,8 @@ static void * ventoy_update_thread(void *data) pstGPT->PartTbl[1].Attr, 0x8000000000000000ULL); pstGPT->PartTbl[1].Attr = 0x8000000000000000ULL; + + pstGPT->Head.PartTblCrc = ventoy_crc32(pstGPT->PartTbl, sizeof(pstGPT->PartTbl)); pstGPT->Head.Crc = 0; pstGPT->Head.Crc = ventoy_crc32(&(pstGPT->Head), pstGPT->Head.Length); ventoy_write_gpt_part_table(fd, disk->size_in_byte, pstGPT); diff --git a/vtoycli/vtoygpt.c b/vtoycli/vtoygpt.c index 1d9d2621..f0e2e62a 100644 --- a/vtoycli/vtoygpt.c +++ b/vtoycli/vtoygpt.c @@ -191,23 +191,26 @@ int vtoygpt_main(int argc, char **argv) Name = pMainGptInfo->PartTbl[1].Name; if (Name[0] == 'V' && Name[1] == 'T' && Name[2] == 'O' && Name[3] == 'Y') { - pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; - pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); - pMainGptInfo->Head.Crc = 0; - pMainGptInfo->Head.Crc = VtoyCrc32(&pMainGptInfo->Head, pMainGptInfo->Head.Length); + if (pMainGptInfo->PartTbl[1].Attr != VENTOY_EFI_PART_ATTR) + { + pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; + pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); + pMainGptInfo->Head.Crc = 0; + pMainGptInfo->Head.Crc = VtoyCrc32(&pMainGptInfo->Head, pMainGptInfo->Head.Length); - pBackGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; - pBackGptInfo->Head.PartTblCrc = VtoyCrc32(pBackGptInfo->PartTbl, sizeof(pBackGptInfo->PartTbl)); - pBackGptInfo->Head.Crc = 0; - pBackGptInfo->Head.Crc = VtoyCrc32(&pBackGptInfo->Head, pBackGptInfo->Head.Length); + pBackGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; + pBackGptInfo->Head.PartTblCrc = VtoyCrc32(pBackGptInfo->PartTbl, sizeof(pBackGptInfo->PartTbl)); + pBackGptInfo->Head.Crc = 0; + pBackGptInfo->Head.Crc = VtoyCrc32(&pBackGptInfo->Head, pBackGptInfo->Head.Length); - lseek(fd, 512, SEEK_SET); - write(fd, (UINT8 *)pMainGptInfo + 512, sizeof(VTOY_GPT_INFO) - 512); + lseek(fd, 512, SEEK_SET); + write(fd, (UINT8 *)pMainGptInfo + 512, sizeof(VTOY_GPT_INFO) - 512); - lseek(fd, DiskSize - 33 * 512, SEEK_SET); - write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); + lseek(fd, DiskSize - 33 * 512, SEEK_SET); + write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); - fsync(fd); + fsync(fd); + } } } diff --git a/vtoygpt/vtoygpt.c b/vtoygpt/vtoygpt.c index cfd99fd5..97e4f0f8 100644 --- a/vtoygpt/vtoygpt.c +++ b/vtoygpt/vtoygpt.c @@ -291,23 +291,26 @@ int main(int argc, const char **argv) Name = pMainGptInfo->PartTbl[1].Name; if (Name[0] == 'V' && Name[1] == 'T' && Name[2] == 'O' && Name[3] == 'Y') { - pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; - pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); - pMainGptInfo->Head.Crc = 0; - pMainGptInfo->Head.Crc = VtoyCrc32(&pMainGptInfo->Head, pMainGptInfo->Head.Length); + if (pMainGptInfo->PartTbl[1].Attr != VENTOY_EFI_PART_ATTR) + { + pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; + pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); + pMainGptInfo->Head.Crc = 0; + pMainGptInfo->Head.Crc = VtoyCrc32(&pMainGptInfo->Head, pMainGptInfo->Head.Length); - pBackGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; - pBackGptInfo->Head.PartTblCrc = VtoyCrc32(pBackGptInfo->PartTbl, sizeof(pBackGptInfo->PartTbl)); - pBackGptInfo->Head.Crc = 0; - pBackGptInfo->Head.Crc = VtoyCrc32(&pBackGptInfo->Head, pBackGptInfo->Head.Length); + pBackGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; + pBackGptInfo->Head.PartTblCrc = VtoyCrc32(pBackGptInfo->PartTbl, sizeof(pBackGptInfo->PartTbl)); + pBackGptInfo->Head.Crc = 0; + pBackGptInfo->Head.Crc = VtoyCrc32(&pBackGptInfo->Head, pBackGptInfo->Head.Length); - lseek(fd, 512, SEEK_SET); - write(fd, (UINT8 *)pMainGptInfo + 512, sizeof(VTOY_GPT_INFO) - 512); + lseek(fd, 512, SEEK_SET); + write(fd, (UINT8 *)pMainGptInfo + 512, sizeof(VTOY_GPT_INFO) - 512); - lseek(fd, DiskSize - 33 * 512, SEEK_SET); - write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); + lseek(fd, DiskSize - 33 * 512, SEEK_SET); + write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); - fsync(fd); + fsync(fd); + } } }