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.
This commit is contained in:
Binary file not shown.
@@ -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/"
|
||||
|
||||
Reference in New Issue
Block a user