From 409d052aef4bce232f0d9ff62307a6f5d4eee30e Mon Sep 17 00:00:00 2001 From: markmental Date: Thu, 10 Sep 2026 22:09:10 -0400 Subject: [PATCH] Fix GRUB config to prevent live CDs from always booting into a pre-existing mnlinux install if it exists --- board/mentalnet/INSTALL-GUIDE.md | 3 ++- board/mentalnet/grub-embedded.cfg | 2 +- fs/iso9660/grub.cfg | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/mentalnet/INSTALL-GUIDE.md b/board/mentalnet/INSTALL-GUIDE.md index 97771c6..89e9bf8 100644 --- a/board/mentalnet/INSTALL-GUIDE.md +++ b/board/mentalnet/INSTALL-GUIDE.md @@ -250,6 +250,7 @@ The installed GRUB menu has a 5s timeout and boots automatically. | Symptom | Likely cause / fix | |---------|--------------------| | **How to tell which build a VM is actually running** | At the login prompt the build stamp is printed (`Mentalnet GNU/Linux build YYYYMMDD-HHMMSS`); inside the guest check `cat /etc/os-release` (`BUILD_ID=`) or `cat /proc/version`. Useful kernel build markers: `#3 ... 18:45:02` predates the rtl8139 fix, `#4 ... 20:24:17` is the first build with 8139cp. | +| **Booting the CD runs an older install instead of the live system** | Fixed: the live medium is identified by `/boot/grub/grub-eltorito.img` (a file only the ISO carries), so an existing Mentalnet install on disk no longer hijacks the boot. On builds older than this fix, the CD's GRUB searched for `/boot/bzImage`, found the disk first (BIOS enumerates disks before the CD) and chained into the installed system. | | **Proxmox: VM boots an older build despite uploading a new ISO** | Proxmox keeps every upload as a separate storage volume, and a VM's CD/DVD drive points at a specific **volume** — renaming or re-uploading a file never updates an existing drive (checksums of the new file do not help either). Delete the stale volume, upload the unique-named ISO from the build log, attach it in Hardware, and check Boot Order (an installed disk can also shadow the CD). | | GRUB menu does not appear, or the machine reboots before booting, in QEMU | Try more RAM (`-m 256`). Memory pressure during development was the culprit more than once. | | Kernel panic: `Unable to mount root fs` | The CD drive is on an unsupported controller. The kernel targets PIIX-era IDE/ATA; modern SATA-only setups are out of scope. | @@ -267,7 +268,7 @@ Everything Mentalnet-specific lives here: | File | Purpose | |------|---------| -| `board/mentalnet/grub-embedded.cfg` | config embedded into the GRUB core image: searches for the medium containing `/boot/bzImage` instead of hardcoding a device | +| `board/mentalnet/grub-embedded.cfg` | config embedded into the GRUB core image: finds the live medium via `/boot/grub/grub-eltorito.img` (a file only the ISO carries), so the CD always boots the live system even with an installed disk attached. NB: GRUB early configs support plain commands only - no comment lines, no `\` continuations, no `\|\|` operators. | | `board/mentalnet/linux-slim.config` | kernel config fragment: keeps the classic PCI NICs, ATA/ATAPI, USB HID/storage, serial and VGA console; drops wireless, sound, DRM, RAID, PCMCIA, debug | | `board/mentalnet/overlay/usr/sbin/mentalnet-install` | the hard disk installer | | `board/mentalnet/overlay/usr/share/mentalnet/grub-disk.cfg` | boot menu template written to installed systems (`@ROOTDEV@` is replaced) | diff --git a/board/mentalnet/grub-embedded.cfg b/board/mentalnet/grub-embedded.cfg index b5a00db..3036aaf 100644 --- a/board/mentalnet/grub-embedded.cfg +++ b/board/mentalnet/grub-embedded.cfg @@ -1,3 +1,3 @@ -search --no-floppy --set=root --file /boot/bzImage +search --no-floppy --file /boot/grub/grub-eltorito.img --set=root set prefix=($root)/boot/grub normal diff --git a/fs/iso9660/grub.cfg b/fs/iso9660/grub.cfg index 24383e4..be59407 100644 --- a/fs/iso9660/grub.cfg +++ b/fs/iso9660/grub.cfg @@ -2,7 +2,6 @@ set default="0" set timeout="10" menuentry "Mentalnet GNU/Linux" { - search --no-floppy --set=root --file /boot/bzImage linux /boot/bzImage root=/dev/sr0 ro }