+
+ if (disk->vtoydata.partition_style)
+ {
+ pstGPT = (VTOY_GPT_INFO *)malloc(sizeof(VTOY_GPT_INFO));
+ memset(pstGPT, 0, sizeof(VTOY_GPT_INFO));
+
+ offset = lseek(fd, 0, SEEK_SET);
+ len = read(fd, pstGPT, sizeof(VTOY_GPT_INFO));
+ vlog("Read GPT table offset:%llu len:%llu ...\n", (_ull)offset, (_ull)len);
+
+ if (pstGPT->PartTbl[1].Attr != 0x8000000000000000ULL)
+ {
+ vlog("Update EFI part attr from 0x%016llx to 0x%016llx\n",
+ pstGPT->PartTbl[1].Attr, 0x8000000000000000ULL);
+
+ pstGPT->PartTbl[1].Attr = 0x8000000000000000ULL;
+ 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);
+ }
+ else
+ {
+ vlog("No need to update EFI part attr\n");
+ }
+ free(pstGPT);
+ }
+
+