Files
OrionOS/build-iso.sh
T
nmemmertandClaude Sonnet 4.6 18d3675368 Fix ISO build pipeline for Docker on macOS
- Disable pacman alpm sandbox in Dockerfile (seccomp blocks it in BuildKit)
- Move mkarchiso from RUN to CMD so it runs with --privileged at docker run time
- Fix output path: mkarchiso now writes to /dist (matches volume mount)
- Add syslinux + imlib2 to Docker build packages and live ISO package list
- Copy syslinux/ and efiboot/ boot configs from archiso releng into profile
- Switch deprecated UEFI grub bootmodes to uefi-x64.systemd-boot
- Fix wrong package names: libpam→pam, light→brightnessctl, remove pkexec
- Set SigLevel=Never and hardcode reliable mirrors in profile pacman.conf
- Add mkinitcpio.conf with archiso hook so initrd can mount the live squashfs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-31 08:27:16 -04:00

95 lines
3.7 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# OrionOS ISO builder — run this on your Mac to produce a bootable ISO.
# Requires: Docker Desktop (https://docker.com/products/docker-desktop)
#
# Usage: ./build-iso.sh
# Output: dist/orionos-<date>.iso
set -euo pipefail
REPO="$(cd "$(dirname "$0")" && pwd)"
DIST="$REPO/dist"
IMAGE="orionos-builder"
ISO_TAG="orionos-$(date +%Y%m%d)"
# ── preflight ─────────────────────────────────────────────────────────
if ! command -v docker &>/dev/null; then
echo ""
echo " Docker is not installed."
echo ""
echo " Install Docker Desktop for Mac:"
echo " https://www.docker.com/products/docker-desktop/"
echo ""
echo " After installing, open Docker Desktop once to let it start,"
echo " then re-run this script."
exit 1
fi
if ! docker info &>/dev/null; then
echo ""
echo " Docker is installed but not running."
echo " Open Docker Desktop and wait for it to start, then re-run."
exit 1
fi
echo ""
echo "┌─────────────────────────────────────────────┐"
echo "│ OrionOS ISO Builder │"
echo "│ Building a BeOS-inspired Linux desktop... │"
echo "└─────────────────────────────────────────────┘"
echo ""
# ── build the builder image ───────────────────────────────────────────
echo "Step 1/3: Building Docker image (downloads ~600MB Arch base, once)"
echo " This will be fast on subsequent runs."
echo ""
docker build \
--platform linux/amd64 \
-t "$IMAGE" \
-f "$REPO/iso/docker/Dockerfile" \
"$REPO"
# ── run the ISO build inside the container ────────────────────────────
echo ""
echo "Step 2/3: Building ISO inside Arch Linux container..."
echo " (5–15 min depending on internet speed and CPU)"
echo ""
mkdir -p "$DIST"
docker run \
--rm \
--privileged \
--platform linux/amd64 \
--security-opt seccomp=unconfined \
-v "$DIST:/dist" \
-e DIST=/dist \
"$IMAGE"
# ── rename with date tag ──────────────────────────────────────────────
echo ""
echo "Step 3/3: Finalizing..."
ISO="$(find "$DIST" -iname "*.iso" | head -1)"
if [[ -z "$ISO" ]]; then
echo "ERROR: ISO not found in $DIST — check the build output above."
exit 1
fi
FINAL="$DIST/$ISO_TAG.iso"
mv "$ISO" "$FINAL"
SIZE="$(du -sh "$FINAL" | cut -f1)"
echo ""
echo "┌─────────────────────────────────────────────┐"
echo "│ Done! │"
echo "│ │"
echo "│ ISO: dist/$ISO_TAG.iso"
echo "│ Size: $SIZE"
echo "│ │"
echo "│ Flash to USB: │"
echo "│ sudo dd if=$FINAL of=/dev/diskN bs=4m │"
echo "│ (replace /dev/diskN with your USB drive) │"
echo "│ │"
echo "│ Or use Balena Etcher (GUI): │"
echo "│ https://etcher.balena.io │"
echo "└─────────────────────────────────────────────┘"
echo ""