From d43a9aeec7d7c96ab7f0b3ee831abdaa4bd35d20 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Tue, 31 Mar 2026 22:10:28 +0300 Subject: [PATCH] fix(iso): restore live-build memtest integration --- bible-local/docs/iso-build-rules.md | 9 ++- iso/builder/auto/config | 2 +- .../config/bootloaders/grub-pc/grub.cfg | 10 --- .../hooks/normal/9100-memtest.hook.binary | 76 ------------------- .../config/package-lists/bee.list.chroot | 1 - 5 files changed, 6 insertions(+), 92 deletions(-) delete mode 100755 iso/builder/config/hooks/normal/9100-memtest.hook.binary diff --git a/bible-local/docs/iso-build-rules.md b/bible-local/docs/iso-build-rules.md index 61d4d5e..8318698 100644 --- a/bible-local/docs/iso-build-rules.md +++ b/bible-local/docs/iso-build-rules.md @@ -13,9 +13,10 @@ Use one of: This applies to: - `iso/builder/config/package-lists/*.list.chroot` -- Any package referenced in `grub.cfg`, hooks, or overlay scripts (e.g. file paths like `/boot/memtest86+x64.bin`) +- Any package referenced in bootloader configs, hooks, or overlay scripts -## Example of what goes wrong without this +## Memtest rule -`memtest86+` in Debian bookworm installs `/boot/memtest86+x64.bin`, not `/boot/memtest86+.bin`. -Guessing the filename caused a broken GRUB entry that only surfaced at boot time, after a full rebuild. +Prefer live-build's built-in memtest integration over custom hooks or hardcoded +bootloader paths. If you ever need to reference memtest files manually, verify +the exact package file list first for the target Debian release. diff --git a/iso/builder/auto/config b/iso/builder/auto/config index a3cc0d3..662181c 100755 --- a/iso/builder/auto/config +++ b/iso/builder/auto/config @@ -29,7 +29,7 @@ lb config noauto \ --security true \ --linux-flavours "amd64" \ --linux-packages "${LB_LINUX_PACKAGES}" \ - --memtest none \ + --memtest memtest86+ \ --iso-volume "EASY_BEE_${BEE_GPU_VENDOR_UPPER:-NVIDIA}" \ --iso-application "EASY-BEE-${BEE_GPU_VENDOR_UPPER:-NVIDIA}" \ --bootappend-live "boot=live components video=1920x1080 console=tty0 console=ttyS0,115200n8 loglevel=7 username=bee user-fullname=Bee modprobe.blacklist=nouveau" \ diff --git a/iso/builder/config/bootloaders/grub-pc/grub.cfg b/iso/builder/config/bootloaders/grub-pc/grub.cfg index 3d33e47..997e06c 100644 --- a/iso/builder/config/bootloaders/grub-pc/grub.cfg +++ b/iso/builder/config/bootloaders/grub-pc/grub.cfg @@ -29,16 +29,6 @@ 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 diff --git a/iso/builder/config/hooks/normal/9100-memtest.hook.binary b/iso/builder/config/hooks/normal/9100-memtest.hook.binary deleted file mode 100755 index c9acf9f..0000000 --- a/iso/builder/config/hooks/normal/9100-memtest.hook.binary +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# Copy memtest86+ binaries from chroot /boot into the ISO boot directory -# so GRUB can chainload them directly (they must be on the ISO filesystem, -# not inside the squashfs). -# -# Primary: copy from chroot/boot/ (populated by package postinst). -# Naming fallbacks: -# Debian Bookworm: /boot/memtest86+ — EFI PE64 (no extension) -# /boot/memtest86+.bin — legacy binary -# Upstream/Ubuntu: /boot/memtest86+x64.efi, /boot/memtest86+x64.bin, etc. -# Last resort: extract directly from the cached .deb if postinst didn't place -# the files (happens in chroot environments without grub triggers). -set -e - -MEMTEST_FILES="memtest86+x64.bin memtest86+x64.efi memtest86+ia32.bin memtest86+ia32.efi" - -# Ensure destination directory exists (absence caused silent copy failures). -mkdir -p binary/boot - -echo "memtest: scanning chroot/boot/ for memtest files:" -ls chroot/boot/memtest* 2>/dev/null || echo "memtest: WARNING: no memtest files in chroot/boot/" - -# Primary path: copy upstream-named files from chroot/boot/ -for f in ${MEMTEST_FILES}; do - src="chroot/boot/${f}" - if [ -f "${src}" ]; then - cp "${src}" "binary/boot/${f}" - echo "memtest: copied ${f} from chroot/boot/" - fi -done - -# Debian Bookworm naming fallback: /boot/memtest86+ (no extension) is the EFI binary. -if [ ! -f "binary/boot/memtest86+x64.efi" ] && [ -f "chroot/boot/memtest86+" ]; then - cp "chroot/boot/memtest86+" "binary/boot/memtest86+x64.efi" - echo "memtest: copied /boot/memtest86+ as memtest86+x64.efi (Debian naming)" -fi -if [ ! -f "binary/boot/memtest86+x64.bin" ] && [ -f "chroot/boot/memtest86+.bin" ]; then - cp "chroot/boot/memtest86+.bin" "binary/boot/memtest86+x64.bin" - echo "memtest: copied /boot/memtest86+.bin as memtest86+x64.bin (Debian naming)" -fi - -# Last resort: if EFI binary still missing, extract from cached .deb -if [ ! -f "binary/boot/memtest86+x64.efi" ]; then - echo "memtest: EFI binary missing — attempting extraction from .deb cache" - deb=$(find chroot/var/cache/apt/archives/ chroot/var/lib/apt/lists/ \ - -name 'memtest86+_*.deb' -o -name 'memtest86+*.deb' 2>/dev/null \ - | head -1) - if [ -z "$deb" ]; then - deb=$(find cache/ -name 'memtest86+_*.deb' -o -name 'memtest86+*.deb' 2>/dev/null | head -1) - fi - if [ -n "$deb" ]; then - echo "memtest: extracting from ${deb}" - EXTRACT_DIR="$(mktemp -d)" - dpkg-deb -x "${deb}" "${EXTRACT_DIR}" - echo "memtest: files found in .deb:" - find "${EXTRACT_DIR}/boot" -type f 2>/dev/null || echo " (none in /boot)" - for f in ${MEMTEST_FILES}; do - src="${EXTRACT_DIR}/boot/${f}" - if [ -f "${src}" ]; then - cp "${src}" "binary/boot/${f}" - echo "memtest: extracted ${f} from .deb" - fi - done - # Debian naming fallback inside .deb as well - if [ ! -f "binary/boot/memtest86+x64.efi" ] && [ -f "${EXTRACT_DIR}/boot/memtest86+" ]; then - cp "${EXTRACT_DIR}/boot/memtest86+" "binary/boot/memtest86+x64.efi" - echo "memtest: extracted /boot/memtest86+ as memtest86+x64.efi from .deb" - fi - rm -rf "${EXTRACT_DIR}" - else - echo "memtest: WARNING: no memtest86+ .deb found in cache — memtest will not be available" - fi -fi - -echo "memtest: binary/boot/ contents:" -ls binary/boot/memtest* 2>/dev/null || echo " (none)" diff --git a/iso/builder/config/package-lists/bee.list.chroot b/iso/builder/config/package-lists/bee.list.chroot index a2fa50b..4879eff 100644 --- a/iso/builder/config/package-lists/bee.list.chroot +++ b/iso/builder/config/package-lists/bee.list.chroot @@ -51,7 +51,6 @@ sudo zstd mstflint memtester -memtest86+ stress-ng stressapptest