fix: update GRUB2 module partition size checks 131072 -> 65536

After reducing ESP partition from 64MB to 32MB to match Ventoy, the
GRUB2 module's hardcoded partition size checks now reject the disk
with error 7 'Disk partition layout check failed.'

Updated 4 hardcoded 131072 / 67108864 (64MB) values to 65536 / 33554432
(32MB) in:
- src/grub2/hiperiso_cmd.c (3 places in hiperiso_check_official_device)
- src/grub2/hiperiso_def.h (HISO_CMD_CHECK macro partition size)

GRUB2 module rebuilt with new BOOTX64.EFI. Payload rebuilt.
This commit is contained in:
2026-07-02 06:01:52 +03:00
parent 35fef3b9c4
commit 53b2d85f98
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -629,7 +629,7 @@ static int hiperiso_check_official_device(grub_device_t dev)
{
hiperiso_gpt_part_tbl *PartTbl = g_hiperiso_part_info->PartTbl;
if (PartTbl[1].StartLBA != PartTbl[0].LastLBA + 1 ||
(PartTbl[1].LastLBA + 1 - PartTbl[1].StartLBA) != 131072)
(PartTbl[1].LastLBA + 1 - PartTbl[1].StartLBA) != 65536)
{
grub_file_close(file);
return hiperiso_set_check_result(6, "Disk partition layout check failed.");
@@ -639,7 +639,7 @@ static int hiperiso_check_official_device(grub_device_t dev)
{
hiperiso_part_table *PartTbl = g_hiperiso_part_info->MBR.PartTbl;
if (PartTbl[1].StartSectorId != PartTbl[0].StartSectorId + PartTbl[0].SectorCount ||
PartTbl[1].SectorCount != 131072)
PartTbl[1].SectorCount != 65536)
{
grub_file_close(file);
return hiperiso_set_check_result(6, "Disk partition layout check failed.");
@@ -650,7 +650,7 @@ static int hiperiso_check_official_device(grub_device_t dev)
{
offset = partition->start + partition->len;
partition = file->device->disk->partition;
if ((partition->number != 1) || (partition->len != 131072) || (offset != partition->start))
if ((partition->number != 1) || (partition->len != 65536) || (offset != partition->start))
{
grub_file_close(file);
return hiperiso_set_check_result(7, "Disk partition layout check failed.");
+1 -1
View File
@@ -1217,7 +1217,7 @@ int hiperiso_unregister_all_cmd(void);
int hiperiso_chain_file_size(const char *path);
int hiperiso_chain_file_read(const char *path, int offset, int len, void *buf);
#define HISO_CMD_CHECK(a) if (67108864 != g_hiperiso_disk_part_size[a]) hiperiso_syscall0(exit)
#define HISO_CMD_CHECK(a) if (33554432 != g_hiperiso_disk_part_size[a]) hiperiso_syscall0(exit)
#define hiso_theme_random_boot_second 0
#define hiso_theme_random_boot_day 1