mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-05-09 05:32:07 -04:00
Fix the issue introduced in LinuxGUI version. (#3128)
This commit is contained in:
parent
6166a813ea
commit
9a8dc42d93
22 changed files with 41 additions and 29 deletions
|
@ -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."
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue