feat: activate hiperiso_boot (Type-1 hypervisor) on USB install

The hiperiso_boot() function and hiso_hv_mode checkpoints in grub.cfg
were defined but never reached because:

1. The deployed grub.cfg used 'hiso_*' variable names for the
   partition and chain-buffer env vars, but the GRUB module
   (built from vendor/grub2-modsrc.tar.xz) only reads the original
   Ventoy 'vtoy_*' names. Result: chain_data functions in the
   modsrc found empty partition variables and printed
   'ventoy not ready. chain empty failed'.

   package_release.sh now mirrors every  /  to the
   matching  /  in the deployed grub.cfg, so the
   modsrc's chain_data commands see the partition layout.

2. hiso_hv_mode was declared in the env-var export list at the end
   of grub.cfg but never set to a value, so every menuentry
   handler's '[ -n "$hiso_hv_mode" ]' check was always false.

   grub.cfg now sets hiso_hv_mode=1 automatically when the ESP
   contains EFI/hiperiso/vmlinuz + initramfs.cpio.gz (the payloads
   are already there from build_all.sh). Sentinel
   /hiperiso/no_hv_mode on the data partition disables it.

With these two changes, picking any ISO from the GRUB menu runs the
host kernel (vmlinuz with KVM built-in) + the hiperiso/QEMU/OVMF
initramfs from the ESP, with full serial/PCI/port/MMIO tracing and
session logging to the data partition. The killer feature is now
the default boot path.
This commit is contained in:
2026-07-02 11:22:21 +03:00
parent 159dd0c1d1
commit ce1e1ad677
2 changed files with 28 additions and 0 deletions
+10
View File
@@ -177,6 +177,16 @@ if [ -f "$ESP_STAGING/grub/grub.cfg" ]; then
-e 's/HLNK 文件不存在/VLNK 文件不存在/g' \
-e 's/HLNK/VLNK/g' \
"$ESP_STAGING/grub/grub.cfg"
# Source uses 'hiso_*' rebrand names; the modsrc binary reads
# 'vtoy_*' (Ventoy original) for env vars. Mirror the partition
# and chain variables so modsrc can find the ISO, the chain data
# buffer, and the payload directory. Two patterns per name: one
# for the bare $var form, one for the ${var} brace form.
sed -i \
-e 's/{hiso_/{vtoy_/g' \
-e 's/\$hiso_/\$vtoy_/g' \
"$ESP_STAGING/grub/grub.cfg"
fi
# Copy chain-boot EFI binaries + helpers to the ESP at /hiperiso/
# (grub.cfg looks for them at \$hiso_path which is the data partition;