feat: custom boot branding, MBR fix, Plymouth theme, CI smoke tests
Boot fix: - Ship proven Debian Live MBR (4552) as branding/isohdpfx.bin — the ISOLINUX package MBR (33ed) doesn't boot on all hardware. This was the root cause of "machine doesn't pick up the USB". Branding: - Custom GRUB background: pixel-art floating island (1024x574) - Archipelago pixel-art logo for Plymouth boot splash - GRUB theme: dark background, orange selected item, no broken font refs - Plymouth theme: script-based with progress bar, LUKS prompt support - Plymouth + splash added to target rootfs packages - GRUB theme installed on both installer ISO and target system - Serial console (ttyS0) added to kernel params for QEMU debugging CI improvements: - Smoke test step: mounts ISO, verifies all critical files, checks initrd has live-boot, confirms boot=live in grub.cfg. Fails build before copying to Builds if any check fails. Dev workflow: - dev-branding.sh: extract ISO, swap branding, repackage, boot in QEMU (~10 seconds vs 20 min full rebuild) - generate-grub-background.py: procedural cyberpunk background generator - generate-plymouth-logo.py: procedural logo generator - Improved test-iso-qemu.sh: --bios/--nographic flags, serial logging Build: - Simplified live-boot install (clean chroot, no complex fallbacks) - Static branding images preferred, generators as fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e8c80263f3
commit
f3f7b8b72f
Executable
+173
@@ -0,0 +1,173 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Quick-iterate on boot branding without rebuilding the ISO.
|
||||
#
|
||||
# Usage:
|
||||
# ./dev-branding.sh <base-iso>
|
||||
#
|
||||
# What it does:
|
||||
# 1. Regenerates GRUB background and Plymouth logo from Python scripts
|
||||
# 2. Extracts the existing ISO
|
||||
# 3. Swaps in updated branding files (theme, background, Plymouth)
|
||||
# 4. Repackages as a new ISO
|
||||
# 5. Boots it in QEMU for testing
|
||||
#
|
||||
# This takes ~10 seconds instead of 20 minutes.
|
||||
#
|
||||
# For design-only iteration (no QEMU boot):
|
||||
# python3 branding/generate-grub-background.py /tmp/grub-bg.png && open /tmp/grub-bg.png
|
||||
#
|
||||
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ISO="${1:-}"
|
||||
|
||||
if [ -z "$ISO" ] || [ ! -f "$ISO" ]; then
|
||||
# Auto-detect latest dev ISO on Desktop
|
||||
ISO=$(ls -t ~/Desktop/archipelago-dev-*.iso 2>/dev/null | head -1)
|
||||
fi
|
||||
if [ -z "$ISO" ] || [ ! -f "$ISO" ]; then
|
||||
ISO=$(ls -t "$SCRIPT_DIR/results/archipelago-*.iso" 2>/dev/null | head -1)
|
||||
fi
|
||||
if [ -z "$ISO" ] || [ ! -f "$ISO" ]; then
|
||||
echo "No ISO found. Provide a path or place one on Desktop/results."
|
||||
echo "Usage: $0 <base-iso>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WORK="/tmp/archipelago-dev-branding"
|
||||
PATCHED="$SCRIPT_DIR/results/archipelago-dev-patched.iso"
|
||||
|
||||
echo "=== Archipelago Branding Dev ==="
|
||||
echo " Base ISO: $ISO"
|
||||
echo ""
|
||||
|
||||
# Step 1: Regenerate assets
|
||||
echo "[1/4] Generating assets..."
|
||||
python3 "$SCRIPT_DIR/branding/generate-grub-background.py" /tmp/grub-bg.png 2>/dev/null && \
|
||||
echo " GRUB background: OK" || echo " GRUB background: FAILED"
|
||||
python3 "$SCRIPT_DIR/branding/generate-plymouth-logo.py" /tmp/plymouth-logo.png 2>/dev/null && \
|
||||
echo " Plymouth logo: OK" || echo " Plymouth logo: FAILED"
|
||||
|
||||
# Also show the background for quick visual check
|
||||
if command -v open >/dev/null 2>&1; then
|
||||
open /tmp/grub-bg.png 2>/dev/null &
|
||||
fi
|
||||
|
||||
# Step 2: Extract ISO
|
||||
echo "[2/4] Extracting ISO..."
|
||||
rm -rf "$WORK"
|
||||
mkdir -p "$WORK"
|
||||
xorriso -osirrox on -indev "$ISO" -extract / "$WORK" 2>/dev/null || {
|
||||
# Fallback: mount + copy
|
||||
MNT=$(mktemp -d)
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
hdiutil attach "$ISO" -mountpoint "$MNT" -readonly -nobrowse 2>/dev/null
|
||||
else
|
||||
sudo mount -o loop,ro "$ISO" "$MNT"
|
||||
fi
|
||||
cp -a "$MNT"/* "$WORK/" 2>/dev/null || true
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
hdiutil detach "$MNT" 2>/dev/null
|
||||
else
|
||||
sudo umount "$MNT"
|
||||
fi
|
||||
rmdir "$MNT" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# Step 3: Patch branding
|
||||
echo "[3/4] Patching branding..."
|
||||
THEME_DST="$WORK/boot/grub/themes/archipelago"
|
||||
mkdir -p "$THEME_DST"
|
||||
|
||||
# GRUB theme
|
||||
cp "$SCRIPT_DIR/branding/grub-theme/theme.txt" "$THEME_DST/" 2>/dev/null && \
|
||||
echo " theme.txt: OK"
|
||||
cp /tmp/grub-bg.png "$THEME_DST/background.png" 2>/dev/null && \
|
||||
echo " background.png: OK"
|
||||
|
||||
# Plymouth theme
|
||||
if [ -d "$WORK/archipelago/plymouth-theme" ]; then
|
||||
cp "$SCRIPT_DIR/branding/plymouth-theme/"* "$WORK/archipelago/plymouth-theme/" 2>/dev/null
|
||||
cp /tmp/plymouth-logo.png "$WORK/archipelago/plymouth-theme/logo.png" 2>/dev/null
|
||||
echo " Plymouth theme: OK"
|
||||
fi
|
||||
|
||||
# GRUB config (in case you edited it)
|
||||
if [ -f "$SCRIPT_DIR/branding/grub.cfg" ]; then
|
||||
cp "$SCRIPT_DIR/branding/grub.cfg" "$WORK/boot/grub/grub.cfg"
|
||||
echo " grub.cfg: OK (custom)"
|
||||
fi
|
||||
|
||||
# ISOLINUX config
|
||||
if [ -f "$SCRIPT_DIR/branding/isolinux.cfg" ]; then
|
||||
cp "$SCRIPT_DIR/branding/isolinux.cfg" "$WORK/isolinux/isolinux.cfg"
|
||||
echo " isolinux.cfg: OK (custom)"
|
||||
fi
|
||||
|
||||
# Step 4: Repackage ISO
|
||||
echo "[4/4] Repackaging ISO..."
|
||||
mkdir -p "$SCRIPT_DIR/results"
|
||||
|
||||
# Find isohdpfx.bin
|
||||
ISOHDPFX=""
|
||||
for p in "$WORK/isolinux/isohdpfx.bin" \
|
||||
/usr/lib/ISOLINUX/isohdpfx.bin \
|
||||
/usr/share/syslinux/isohdpfx.bin \
|
||||
/opt/homebrew/share/syslinux/isohdpfx.bin; do
|
||||
[ -f "$p" ] && ISOHDPFX="$p" && break
|
||||
done
|
||||
|
||||
# Check for EFI image
|
||||
EFI_IMG="$WORK/boot/grub/efi.img"
|
||||
|
||||
if [ -n "$ISOHDPFX" ] && [ -f "$EFI_IMG" ]; then
|
||||
xorriso -as mkisofs -o "$PATCHED" \
|
||||
-volid "ARCHIPELAGO" \
|
||||
-iso-level 3 \
|
||||
-J -joliet-long -R \
|
||||
-isohybrid-mbr "$ISOHDPFX" \
|
||||
-c isolinux/boot.cat \
|
||||
-b isolinux/isolinux.bin \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-eltorito-alt-boot \
|
||||
-e boot/grub/efi.img \
|
||||
-no-emul-boot \
|
||||
-isohybrid-gpt-basdat \
|
||||
-partition_offset 16 \
|
||||
"$WORK" 2>/dev/null
|
||||
elif [ -n "$ISOHDPFX" ]; then
|
||||
xorriso -as mkisofs -o "$PATCHED" \
|
||||
-volid "ARCHIPELAGO" \
|
||||
-iso-level 3 \
|
||||
-J -joliet-long -R \
|
||||
-isohybrid-mbr "$ISOHDPFX" \
|
||||
-c isolinux/boot.cat \
|
||||
-b isolinux/isolinux.bin \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-partition_offset 16 \
|
||||
"$WORK" 2>/dev/null
|
||||
else
|
||||
echo "Cannot repackage: no isohdpfx.bin found."
|
||||
echo "Install xorriso and isolinux: brew install xorriso"
|
||||
echo ""
|
||||
echo "You can still preview the assets:"
|
||||
echo " open /tmp/grub-bg.png"
|
||||
echo " open /tmp/plymouth-logo.png"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo " Patched ISO: $PATCHED ($(du -h "$PATCHED" | cut -f1))"
|
||||
echo ""
|
||||
|
||||
# Auto-boot in QEMU if available
|
||||
if command -v qemu-system-x86_64 >/dev/null 2>&1; then
|
||||
read -p "Boot in QEMU? [Y/n] " -n 1 -r
|
||||
echo ""
|
||||
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
|
||||
exec "$SCRIPT_DIR/test-iso-qemu.sh" "$PATCHED" --bios
|
||||
fi
|
||||
else
|
||||
echo "Install QEMU to test: brew install qemu"
|
||||
fi
|
||||
Reference in New Issue
Block a user