From 9089553607d1b1f8603318dc59db5d72f37a1634 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 2 Jul 2026 06:13:03 +0300 Subject: [PATCH] fix: revert GRUB2 modsrc partition size back to 65536 (32MB) The build_grub2_204.sh script was patching Ventoy's modsrc from 65536 to 131072 sectors (bumping expected ESP size from 32MB to 64MB). After reducing our ESP size to 32MB to match Ventoy exactly, this patch now needs to be reversed (131072 -> 65536) so the GRUB2 layout check accepts our 32MB ESP. Built GRUB2 EFI binary with corrected checks. Reinstalled payload. --- grub2/bin/BOOTX64.EFI | Bin 1908736 -> 1908736 bytes scripts/build_grub2_204.sh | 13 +++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/grub2/bin/BOOTX64.EFI b/grub2/bin/BOOTX64.EFI index bde4982e04266341325bc40e93ea51b86c57cb43..b78367f8f8abcaed103a3afcb929bb5d7685c461 100644 GIT binary patch delta 105 zcmWN=$qj=r07XF=LLlIJLq#1Xu4l)W9>Y+$a#Y*&2 is_d|TZ_KuP%QtftELrixFKaez*|F!qk-u~I(=y*V2rt9{ delta 105 zcmWN=$qj=r07XIJ5CX*PJE0l+$uR}^@FfZer66&o64%0$X5962P#~j+LOm7frC5nl iy$}2Mf!TI%nK5UyPYe$L%5-}MGLPcOv) diff --git a/scripts/build_grub2_204.sh b/scripts/build_grub2_204.sh index b7bbc27..46e2c17 100644 --- a/scripts/build_grub2_204.sh +++ b/scripts/build_grub2_204.sh @@ -33,18 +33,11 @@ mkdir -p "$BUILD_DIR/SRC" "$PXE_DIR" "$RUNTIME_GRUB_DIR" tar -xf "$DL_DIR/grub-2.04.tar.xz" -C "$BUILD_DIR/SRC/" tar -xf "$MODULE_TARBALL" -C "$BUILD_DIR/SRC/" -# Patch Ventoy's modsrc to allow a 64MB ESP. The stock Ventoy ESP -# is 32MB (65536 sectors), and ventoy_check_official_device() -# hard-codes that size in the partition-layout check. hiperiso's -# payload is ~30MB and benefits from the extra 32MB of headroom -# (FAT16 overhead, future growth, larger GRUB modules). Bump the -# expected ESP size to 131072 sectors. This is the only Ventoy -# source-level change we make. find "$BUILD_DIR/SRC/grub-2.04/grub-core/ventoy" -type f \ \( -name '*.c' -o -name '*.h' \) -exec sed -i \ - -e 's/(PartTbl\[1\]\.LastLBA + 1 - PartTbl\[1\]\.StartLBA) != 65536/(PartTbl[1].LastLBA + 1 - PartTbl[1].StartLBA) != 131072/g' \ - -e 's/PartTbl\[1\]\.SectorCount != 65536/PartTbl[1].SectorCount != 131072/g' \ - -e 's/(partition->len != 65536)/(partition->len != 131072)/g' \ + -e 's/(partition->len != 131072)/(partition->len != 65536)/g' \ + -e 's/(PartTbl\[1\]\.LastLBA + 1 - PartTbl\[1\]\.StartLBA) != 131072/(PartTbl[1].LastLBA + 1 - PartTbl[1].StartLBA) != 65536/g' \ + -e 's/PartTbl\[1\]\.SectorCount != 131072/PartTbl[1].SectorCount != 65536/g' \ {} + cp "$HIPERISO_ROOT/src/grub2/grub/grub.cfg" "$SRC_DIR/"