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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-17 21:24:13 +01:00
parent 7e7647c4b8
commit 0058cc39ab
+40 -11
View File
@@ -259,35 +259,64 @@ Two issues required workarounds:
- GRUB cannot read RedoxFS (no module exists) - GRUB cannot read RedoxFS (no module exists)
- Cannot pass kernel parameters directly (chainloading bypasses this) - Cannot pass kernel parameters directly (chainloading bypasses this)
- BIOS boot is not supported in Phase 1 (only UEFI) - BIOS boot is not supported (only UEFI)
- Requires `mtools` on the host for Phase 1 post-build script - ESP must be sized to ≥ 8 MiB in config (16 MiB recommended)
- ESP must be manually sized to ≥ 8 MiB in config
## Testing ## Testing
### Phase 1: Post-build script (standalone)
```bash ```bash
# Build GRUB recipe # Build GRUB recipe
make r.grub make r.grub
# Verify GRUB binary was produced # Build image (any config with efi_partition_size >= 16)
find repo -name "grub.efi" -path "*/usr/lib/boot/*"
# Build full image with larger ESP
# (Add efi_partition_size = 16 to config first)
make all CONFIG_NAME=redbear-full 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 ./local/scripts/install-grub.sh build/x86_64/harddrive.img
# Verify ESP contents # 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 # Boot in QEMU
make qemu make qemu
# Expected: GRUB menu appears, "Red Bear OS" entry boots successfully # 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 ## References
- GNU GRUB Manual: https://www.gnu.org/software/grub/manual/grub/grub.html - GNU GRUB Manual: https://www.gnu.org/software/grub/manual/grub/grub.html