build: extend Ventoy->hiperiso sed patches to all modsrc references
The ' www.ventoy.net' string baked into BOOTX64.EFI is NOT a URL - it's a magic GUID (16 bytes: 0x77772020 0x2e77 0x6576 ...) that spells ' www.ventoy.net' when interpreted as ASCII. It's used as a fingerprint in Ventoy's data partition structures to distinguish Ventoy-managed files from regular files. Changing it would break disk format compatibility. The actual GRUB error message URL (line 551) is correctly patched to 'redbearos.org/hiperiso to use Hiperiso'. Build script also copies chain-boot EFI binaries (hiperiso_x64.efi, iso9660_x64.efi, udf_x64.efi, vtoyutil_x64.efi, wimboot.x86_64.xz) to the ESP at /hiperiso/ so chain boot works regardless of which partition hiso_path points to.
This commit is contained in:
Binary file not shown.
@@ -38,6 +38,11 @@ find "$BUILD_DIR/SRC/grub-2.04/grub-core/ventoy" -type f \
|
||||
-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' \
|
||||
-e 's|https://www\.ventoy\.net|https://redbearos.org/hiperiso|g' \
|
||||
-e 's|www\.ventoy\.net|redbearos.org|g' \
|
||||
-e 's|admin@ventoy\.net|adminpupkin@gmail.com|g' \
|
||||
-e 's|longpanda|vasilito|g' \
|
||||
-e 's|to use Ventoy|to use Hiperiso|g' \
|
||||
{} +
|
||||
|
||||
cp "$HIPERISO_ROOT/src/grub2/grub/grub.cfg" "$SRC_DIR/"
|
||||
|
||||
@@ -160,6 +160,14 @@ cp "$PAYLOAD/EFI/hiperiso/vmlinuz" "$PAYLOAD/EFI/hiperiso/initramfs.cpio.gz" \
|
||||
cp "$PAYLOAD"/EFI/hiperiso/trace/*.events "$ESP_STAGING/EFI/hiperiso/trace/" 2>/dev/null || true
|
||||
|
||||
cp "$PAYLOAD/grub/grub.cfg" "$ESP_STAGING/grub/"
|
||||
# Copy chain-boot EFI binaries + helpers to the ESP at /hiperiso/
|
||||
# (grub.cfg looks for them at \$hiso_path which is the data partition;
|
||||
# having them also on the ESP helps when the data partition fails to
|
||||
# mount or doesn't carry the hiperiso/ directory.)
|
||||
mkdir -p "$ESP_STAGING/hiperiso"
|
||||
for efi in hiperiso_x64.efi iso9660_x64.efi udf_x64.efi vtoyutil_x64.efi wimboot.x86_64.xz; do
|
||||
[ -f "$PAYLOAD/hiperiso/$efi" ] && cp "$PAYLOAD/hiperiso/$efi" "$ESP_STAGING/hiperiso/" || true
|
||||
done
|
||||
for cfg in checksum.cfg debug.cfg hwinfo.cfg keyboard.cfg localboot.cfg menulang.cfg power.cfg; do
|
||||
[ -f "$PAYLOAD/grub/$cfg" ] && cp "$PAYLOAD/grub/$cfg" "$ESP_STAGING/grub/" || true
|
||||
done
|
||||
|
||||
@@ -2628,14 +2628,13 @@ vt_device $root hiso_dev
|
||||
if [ "$hiso_dev" = "tftp" ]; then
|
||||
set hiso_path=($root)
|
||||
for vtid in 0 1 2 3; do
|
||||
if [ -f (hd$vtid,gpt1)/hiperiso/hiperiso.cpio ]; then
|
||||
if [ -f (hd$vtid,gpt2)/hiperiso/hiperiso.cpio ]; then
|
||||
set hiso_iso_part=(hd$vtid,gpt1)
|
||||
set hiso_efi_part=(hd$vtid,gpt2)
|
||||
set hisodev=hd$vtid
|
||||
break
|
||||
fi
|
||||
done
|
||||
set hiso_path=$hiso_iso_part/hiperiso
|
||||
loadfont ascii
|
||||
|
||||
if [ -n "$hiso_efi_part" ]; then
|
||||
@@ -2653,7 +2652,7 @@ else
|
||||
if [ "$prefix" = "(hiperisodisk)/grub" ]; then
|
||||
set hiso_path=(hiperisodisk)/hiperiso
|
||||
else
|
||||
set hiso_path=($hiso_dev,1)/hiperiso
|
||||
set hiso_path=($root)/hiperiso
|
||||
fi
|
||||
|
||||
set hisodev=$hiso_dev
|
||||
|
||||
Reference in New Issue
Block a user