From 0058cc39ab8f3d0eda4056cf5153ccfbb9b4a799 Mon Sep 17 00:00:00 2001 From: Vasilito Date: Fri, 17 Apr 2026 21:24:13 +0100 Subject: [PATCH] Update GRUB plan with Phase 2 testing instructions Reorganized testing section to cover both Phase 1 (post-build script) and Phase 2 (installer-native) workflows. Added unit test commands. Removed mtools dependency from limitations. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- local/docs/GRUB-INTEGRATION-PLAN.md | 51 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/local/docs/GRUB-INTEGRATION-PLAN.md b/local/docs/GRUB-INTEGRATION-PLAN.md index b7d3a942..17b82a71 100644 --- a/local/docs/GRUB-INTEGRATION-PLAN.md +++ b/local/docs/GRUB-INTEGRATION-PLAN.md @@ -259,35 +259,64 @@ Two issues required workarounds: - GRUB cannot read RedoxFS (no module exists) - Cannot pass kernel parameters directly (chainloading bypasses this) -- BIOS boot is not supported in Phase 1 (only UEFI) -- Requires `mtools` on the host for Phase 1 post-build script -- ESP must be manually sized to ≥ 8 MiB in config +- BIOS boot is not supported (only UEFI) +- ESP must be sized to ≥ 8 MiB in config (16 MiB recommended) ## Testing +### Phase 1: Post-build script (standalone) + ```bash # Build GRUB recipe make r.grub -# Verify GRUB binary was produced -find repo -name "grub.efi" -path "*/usr/lib/boot/*" - -# Build full image with larger ESP -# (Add efi_partition_size = 16 to config first) +# Build image (any config with efi_partition_size >= 16) make all CONFIG_NAME=redbear-full -# Install GRUB +# Install GRUB into disk image (uses fat_tool.py, no mtools needed) ./local/scripts/install-grub.sh build/x86_64/harddrive.img # Verify ESP contents -mdir -i build/x86_64/harddrive.img@1048576 -/ ::/ +python3 local/scripts/fat_tool.py ls build/x86_64/harddrive.img 1048576 / # Boot in QEMU make qemu - # Expected: GRUB menu appears, "Red Bear OS" entry boots successfully ``` +### Phase 2: Installer-native (automatic) + +```bash +# Build GRUB recipe (must be built before installer runs) +make r.grub + +# Build image with GRUB config (installer fetches GRUB automatically) +make all CONFIG_NAME=redbear-full-grub + +# Or via CLI flag +make all CONFIG_NAME=redbear-full INSTALLER_OPTS="--bootloader grub" + +# Verify ESP contents +python3 local/scripts/fat_tool.py ls build/x86_64/harddrive.img 1048576 / + +# Boot in QEMU +make qemu +# Expected: GRUB menu appears, "Red Bear OS" entry boots successfully +``` + +### Unit tests (no full build required) + +```bash +# Verify GRUB recipe builds +CI=1 ./target/release/repo cook grub + +# Verify host-side installer accepts --bootloader flag +build/fstools/bin/redox_installer --bootloader=grub --config=config/redbear-full-grub.toml --list-packages + +# Verify fat_tool.py operations +python3 local/scripts/fat_tool.py --help +``` + ## References - GNU GRUB Manual: https://www.gnu.org/software/grub/manual/grub/grub.html