fix(iso): restore memtest menu entries and validate ISO

This commit is contained in:
2026-04-01 07:04:48 +03:00
parent c9ee078622
commit 60cb8f889a
3 changed files with 70 additions and 0 deletions

View File

@@ -111,6 +111,61 @@ resolve_iso_version() {
resolve_audit_version
}
validate_iso_memtest() {
iso_path="$1"
echo "=== validating memtest in ISO ==="
[ -f "$iso_path" ] || { echo "ERROR: ISO not found for validation: $iso_path" >&2; exit 1; }
command -v bsdtar >/dev/null 2>&1 || { echo "ERROR: bsdtar is required for ISO validation" >&2; exit 1; }
bsdtar -tf "$iso_path" | grep -q '^boot/memtest86+x64\.bin$' || {
echo "ERROR: memtest BIOS binary missing in ISO: boot/memtest86+x64.bin" >&2
exit 1
}
bsdtar -tf "$iso_path" | grep -q '^boot/memtest86+x64\.efi$' || {
echo "ERROR: memtest EFI binary missing in ISO: boot/memtest86+x64.efi" >&2
exit 1
}
grub_cfg="$(mktemp)"
isolinux_cfg="$(mktemp)"
trap 'rm -f "$grub_cfg" "$isolinux_cfg"' EXIT INT TERM
bsdtar -xOf "$iso_path" boot/grub/grub.cfg > "$grub_cfg" || {
echo "ERROR: failed to extract boot/grub/grub.cfg from ISO" >&2
exit 1
}
bsdtar -xOf "$iso_path" isolinux/live.cfg > "$isolinux_cfg" || {
echo "ERROR: failed to extract isolinux/live.cfg from ISO" >&2
exit 1
}
grep -q 'Memory Test (memtest86+)' "$grub_cfg" || {
echo "ERROR: GRUB menu entry for memtest is missing" >&2
exit 1
}
grep -q '/boot/memtest86+x64\.efi' "$grub_cfg" || {
echo "ERROR: GRUB memtest EFI path is missing" >&2
exit 1
}
grep -q '/boot/memtest86+x64\.bin' "$grub_cfg" || {
echo "ERROR: GRUB memtest BIOS path is missing" >&2
exit 1
}
grep -q 'Memory Test (memtest86+)' "$isolinux_cfg" || {
echo "ERROR: isolinux menu entry for memtest is missing" >&2
exit 1
}
grep -q '/boot/memtest86+x64\.bin' "$isolinux_cfg" || {
echo "ERROR: isolinux memtest path is missing" >&2
exit 1
}
rm -f "$grub_cfg" "$isolinux_cfg"
trap - EXIT INT TERM
echo "=== memtest validation OK ==="
}
AUDIT_VERSION_EFFECTIVE="$(resolve_audit_version)"
ISO_VERSION_EFFECTIVE="$(resolve_iso_version)"
@@ -522,6 +577,7 @@ fi
ISO_RAW="${LB_DIR}/live-image-amd64.hybrid.iso"
ISO_OUT="${DIST_DIR}/easy-bee-${BEE_GPU_VENDOR}-v${ISO_VERSION_EFFECTIVE}-amd64.iso"
if [ -f "$ISO_RAW" ]; then
validate_iso_memtest "$ISO_RAW"
cp "$ISO_RAW" "$ISO_OUT"
echo ""
echo "=== done (${BEE_GPU_VENDOR}) ==="

View File

@@ -29,6 +29,16 @@ menuentry "EASY-BEE (fail-safe)" {
initrd @INITRD_LIVE@
}
if [ "${grub_platform}" = "efi" ]; then
menuentry "Memory Test (memtest86+)" {
chainloader /boot/memtest86+x64.efi
}
else
menuentry "Memory Test (memtest86+)" {
linux16 /boot/memtest86+x64.bin
}
fi
if [ "${grub_platform}" = "efi" ]; then
menuentry "UEFI Firmware Settings" {
fwsetup

View File

@@ -22,3 +22,7 @@ label live-@FLAVOUR@-failsafe
linux @LINUX@
initrd @INITRD@
append @APPEND_LIVE@ bee.nvidia.mode=gsp-off memtest noapic noapm nodma nomce nolapic nosmp vga=normal
label memtest
menu label ^Memory Test (memtest86+)
linux /boot/memtest86+x64.bin