From: longpanda Date: Sat, 22 Feb 2025 03:27:18 +0000 (+0800) Subject: Fix the issue introduced in LinuxGUI version. (#3128) X-Git-Tag: v1.1.04~1 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/9a8dc42d93195f247dbff334bd342fc960cdd2d6?ds=sidebyside Fix the issue introduced in LinuxGUI version. (#3128) --- diff --git a/INSTALL/tool/VentoyWorker.sh b/INSTALL/tool/VentoyWorker.sh index fa2af33..7844b92 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 64fbbbc..a35bd7d 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 65f84ec..e0203a8 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 cc7630a..4a3f5fb 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 0ce9c93..7186ceb 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 1f809e7..f394355 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 697631b..32fb510 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 7dc3ad7..a2ed830 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 3ba8307..2f5efb3 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 cbe2d98..02eae99 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 b4d9fe6..8ea50cb 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 e53bb8b..60d7cb9 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 e919b93..903c3e0 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 4a0e20b..18ecd6a 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 bb1235f..aff2c38 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 4eea103..b9aa513 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 8e69192..27c2260 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 e87fe82..82dd6e0 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 ab36a28..1e5c1b3 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 ec0c3ca..88f0e95 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 1d9d262..f0e2e62 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); - - 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, DiskSize - 33 * 512, SEEK_SET); - write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); - - fsync(fd); + 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); + + 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)); + + fsync(fd); + } } } diff --git a/vtoygpt/vtoygpt.c b/vtoygpt/vtoygpt.c index cfd99fd..97e4f0f 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); - - 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, DiskSize - 33 * 512, SEEK_SET); - write(fd, pBackGptInfo, sizeof(VTOY_BK_GPT_INFO)); - - fsync(fd); + 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); + + 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)); + + fsync(fd); + } } }