Add dual-path ISO build scripts (Arch + Debian) with README
- iso/build.sh: Debian/Ubuntu host builder using debootstrap + xorriso Bootstraps Debian bookworm, compiles OrionOS in chroot, produces bootable hybrid ISO with GRUB (BIOS + EFI), auto-login root on tty1 - iso/build-arch.sh: Arch Linux host builder using mkarchiso Compiles OrionOS, installs into archiso profile, runs mkarchiso - iso/README.md: instructions for all three paths (Docker/Debian/Arch) including dd and Ventoy USB flashing - Makefile: iso target auto-detects available tool (docker/debootstrap/mkarchiso)
This commit is contained in:
4 files changed
+272
-4
No files matched your search
@@ -102,7 +102,18 @@ install: all
|
||||
@echo " exec orionwm"
|
||||
|
||||
iso:
|
||||
@echo "Building OrionOS ISO via Docker..."
|
||||
docker build -t orionos-iso-builder -f iso/docker/Dockerfile .
|
||||
mkdir -p iso/output
|
||||
docker run --rm --privileged -v "$(PWD)/iso/output:/output" orionos-iso-builder
|
||||
@if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then \
|
||||
echo "Building OrionOS ISO via Docker (Arch)..."; \
|
||||
docker build -t orionos-iso-builder -f iso/docker/Dockerfile .; \
|
||||
mkdir -p iso/output; \
|
||||
docker run --rm --privileged -v "$$(pwd)/iso/output:/output" orionos-iso-builder; \
|
||||
elif command -v debootstrap >/dev/null 2>&1; then \
|
||||
echo "Building OrionOS ISO via debootstrap (Debian/Ubuntu)..."; \
|
||||
sudo bash iso/build.sh; \
|
||||
elif command -v mkarchiso >/dev/null 2>&1; then \
|
||||
echo "Building OrionOS ISO via mkarchiso (Arch native)..."; \
|
||||
sudo bash iso/build-arch.sh; \
|
||||
else \
|
||||
echo "No ISO build tool found. See iso/README.md for options."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@@ -0,0 +1,51 @@
|
||||
# OrionOS ISO Builder
|
||||
|
||||
Two build paths are provided. Pick the one that matches your host.
|
||||
|
||||
## Path A — Arch Linux host (native, recommended)
|
||||
|
||||
Requires `archiso` and `pacman-contrib`.
|
||||
|
||||
```bash
|
||||
sudo pacman -S archiso
|
||||
sudo make iso # runs iso/build-arch.sh
|
||||
```
|
||||
|
||||
## Path B — Debian / Ubuntu host
|
||||
|
||||
Requires `xorriso`, `squashfs-tools`, `debootstrap`, `grub-pc-bin`, `grub-efi-amd64-bin`.
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y xorriso squashfs-tools debootstrap \
|
||||
grub-pc-bin grub-efi-amd64-bin mtools
|
||||
sudo bash iso/build.sh
|
||||
```
|
||||
|
||||
Output lands in `iso/output/OrionOS-YYYYMMDD.iso`.
|
||||
|
||||
## Path C — Docker (any host with Docker)
|
||||
|
||||
```bash
|
||||
make iso
|
||||
```
|
||||
|
||||
The Dockerfile (`iso/docker/Dockerfile`) builds inside `archlinux:latest`,
|
||||
compiles OrionOS, and runs `mkarchiso`. Output is written to `iso/output/`.
|
||||
|
||||
## Writing the ISO to a USB drive
|
||||
|
||||
```bash
|
||||
# Find your USB device (e.g. /dev/sdb) — be careful
|
||||
lsblk
|
||||
sudo dd if=iso/output/OrionOS-*.iso of=/dev/sdX bs=4M status=progress oflag=sync
|
||||
```
|
||||
|
||||
Or use [Ventoy](https://ventoy.net) — just copy the `.iso` onto the Ventoy USB.
|
||||
|
||||
## First boot
|
||||
|
||||
- Logs in automatically as root on tty1 and starts X / OrionOS.
|
||||
- Super+F1 or bottom-left hot corner → launcher
|
||||
- Super+V → clipboard manager
|
||||
- Print → screenshot (Shift+Print → region)
|
||||
- Top-left hot corner → Exposé overview
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
# OrionOS ISO builder — Arch Linux host using mkarchiso
|
||||
# Run as root from the repo root: sudo bash iso/build-arch.sh
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
OUT="$REPO/iso/output"
|
||||
|
||||
echo "==> Building OrionOS binaries..."
|
||||
cd "$REPO"
|
||||
make all
|
||||
|
||||
echo "==> Installing OrionOS binaries into profile airootfs..."
|
||||
install -Dm755 wm/orionwm iso/profile/airootfs/usr/local/bin/orionwm
|
||||
install -Dm755 deskbar/oriondeskbar iso/profile/airootfs/usr/local/bin/oriondeskbar
|
||||
install -Dm755 launcher/orionlauncher iso/profile/airootfs/usr/local/bin/orionlauncher
|
||||
install -Dm755 orionnotify/orionnotify iso/profile/airootfs/usr/local/bin/orionnotify
|
||||
install -Dm755 orionlock/orionlock iso/profile/airootfs/usr/local/bin/orionlock
|
||||
install -Dm755 orionshot/orionshot iso/profile/airootfs/usr/local/bin/orionshot
|
||||
install -Dm755 orionclip/orionclip iso/profile/airootfs/usr/local/bin/orionclip
|
||||
install -Dm755 orionpkg/orionpkg iso/profile/airootfs/usr/local/bin/orionpkg
|
||||
install -Dm755 themes/orionwallpaper iso/profile/airootfs/usr/local/bin/orionwallpaper
|
||||
mkdir -p iso/profile/airootfs/usr/share/themes
|
||||
cp -r themes/OrionOS iso/profile/airootfs/usr/share/themes/
|
||||
install -Dm644 themes/picom.conf iso/profile/airootfs/etc/orionos/picom.conf
|
||||
mkdir -p iso/profile/airootfs/usr/share/orionos/wallpapers
|
||||
bash themes/wallpapers/generate-default.sh 2>/dev/null || true
|
||||
cp -f themes/wallpapers/orionos-default.png \
|
||||
iso/profile/airootfs/usr/share/orionos/wallpapers/ 2>/dev/null || true
|
||||
|
||||
echo "==> Running mkarchiso..."
|
||||
mkdir -p "$OUT"
|
||||
mkarchiso -v -w /tmp/orionos-arch-work -o "$OUT" iso/profile
|
||||
|
||||
echo ""
|
||||
echo "✓ ISO built in $OUT"
|
||||
ls -lh "$OUT"/*.iso 2>/dev/null || true
|
||||
Executable
+169
@@ -0,0 +1,169 @@
|
||||
#!/usr/bin/env bash
|
||||
# OrionOS ISO builder (Debian-based live system)
|
||||
# Run as root from the repo root: sudo bash iso/build.sh
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
WORK="/tmp/orionos-build"
|
||||
OUT="$REPO/iso/output"
|
||||
FS="$WORK/rootfs"
|
||||
ISO_STAGE="$WORK/iso"
|
||||
|
||||
echo "==> OrionOS ISO builder"
|
||||
echo " repo: $REPO"
|
||||
echo " work: $WORK"
|
||||
echo " output: $OUT"
|
||||
|
||||
mkdir -p "$FS" "$ISO_STAGE/live" "$ISO_STAGE/boot/grub" "$OUT"
|
||||
|
||||
# ── 1. Bootstrap minimal Debian base ────────────────────────────────────
|
||||
echo "==> [1/7] Bootstrapping Debian bookworm..."
|
||||
if [[ ! -f "$FS/bin/bash" ]]; then
|
||||
debootstrap --arch=amd64 \
|
||||
--include=linux-image-amd64,live-boot,systemd-sysv,sudo,bash,\
|
||||
coreutils,util-linux,procps,grep,gawk,sed,tar,gzip,less,vim,git,\
|
||||
xorg,xinit,xterm,feh,picom,alsa-utils,libx11-6,libxft2,libxfixes3,\
|
||||
libxext6,libpng16-16,dbus,libpam0g,fontconfig,fonts-dejavu,\
|
||||
fonts-noto,libdbus-1-3,notify-send,bash-completion,network-manager \
|
||||
bookworm "$FS" 2>&1 | grep -E '(I:|W:|E:|error|warn)' || true
|
||||
else
|
||||
echo " (rootfs already exists, skipping bootstrap)"
|
||||
fi
|
||||
|
||||
# ── 2. Compile OrionOS inside chroot ────────────────────────────────────
|
||||
echo "==> [2/7] Compiling OrionOS components..."
|
||||
mkdir -p "$FS/build"
|
||||
cp -r "$REPO"/{wm,deskbar,launcher,orionnotify,orionlock,orionshot,orionclip,orionpkg,themes} "$FS/build/" 2>/dev/null || true
|
||||
|
||||
chroot "$FS" /bin/bash -c '
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get install -y --no-install-recommends \
|
||||
gcc make pkg-config \
|
||||
libx11-dev libxft-dev libxfixes-dev libxext-dev \
|
||||
libpng-dev libdbus-1-dev libpam0g-dev \
|
||||
2>&1 | tail -3
|
||||
|
||||
cd /build
|
||||
for dir in wm deskbar launcher orionnotify orionlock orionshot orionclip orionpkg; do
|
||||
if [[ -d "$dir" ]]; then
|
||||
echo " building $dir..."
|
||||
make -C "$dir" 2>&1 | tail -2 || echo " WARNING: $dir build failed"
|
||||
fi
|
||||
done
|
||||
' 2>&1
|
||||
|
||||
# ── 3. Install OrionOS binaries ──────────────────────────────────────────
|
||||
echo "==> [3/7] Installing OrionOS binaries..."
|
||||
chroot "$FS" /bin/bash -c '
|
||||
set -e
|
||||
install_if() { [[ -f "/build/$1" ]] && install -Dm755 "/build/$1" "/usr/local/bin/$2"; }
|
||||
install_if wm/orionwm orionwm
|
||||
install_if deskbar/oriondeskbar oriondeskbar
|
||||
install_if launcher/orionlauncher orionlauncher
|
||||
install_if orionnotify/orionnotify orionnotify
|
||||
install_if orionlock/orionlock orionlock
|
||||
install_if orionshot/orionshot orionshot
|
||||
install_if orionclip/orionclip orionclip
|
||||
install_if orionpkg/orionpkg orionpkg
|
||||
install -Dm755 /build/themes/orionwallpaper /usr/local/bin/orionwallpaper
|
||||
mkdir -p /usr/share/themes
|
||||
cp -r /build/themes/OrionOS /usr/share/themes/ 2>/dev/null || true
|
||||
mkdir -p /etc/orionos
|
||||
cp /build/themes/picom.conf /etc/orionos/ 2>/dev/null || true
|
||||
mkdir -p /usr/share/orionos/wallpapers
|
||||
bash /build/themes/wallpapers/generate-default.sh 2>/dev/null || true
|
||||
cp -f /build/themes/wallpapers/orionos-default.png /usr/share/orionos/wallpapers/ 2>/dev/null || true
|
||||
' 2>&1
|
||||
|
||||
# ── 4. Configure live session ────────────────────────────────────────────
|
||||
echo "==> [4/7] Configuring live session..."
|
||||
|
||||
cat > "$FS/etc/orionos/xinitrc" <<'XINITRC'
|
||||
#!/bin/bash
|
||||
picom --config /etc/orionos/picom.conf &
|
||||
orionwallpaper &
|
||||
orionnotify &
|
||||
orionclip &
|
||||
oriondeskbar &
|
||||
exec orionwm
|
||||
XINITRC
|
||||
chmod 755 "$FS/etc/orionos/xinitrc"
|
||||
|
||||
cat > "$FS/root/.xinitrc" <<'XINIRC'
|
||||
#!/bin/bash
|
||||
source /etc/orionos/xinitrc
|
||||
XINIRC
|
||||
chmod 755 "$FS/root/.xinitrc"
|
||||
|
||||
# Auto-login and startx on tty1
|
||||
mkdir -p "$FS/etc/systemd/system/getty@tty1.service.d"
|
||||
cat > "$FS/etc/systemd/system/getty@tty1.service.d/autologin.conf" <<'UNIT'
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
|
||||
UNIT
|
||||
|
||||
cat > "$FS/root/.bash_profile" <<'PROFILE'
|
||||
[[ -z "$DISPLAY" && "$XDG_VTNR" == 1 ]] && exec startx
|
||||
PROFILE
|
||||
|
||||
# hostname
|
||||
echo "orionos" > "$FS/etc/hostname"
|
||||
|
||||
# Clean up build artifacts to save space
|
||||
chroot "$FS" /bin/bash -c '
|
||||
apt-get remove -y gcc make pkg-config \
|
||||
libx11-dev libxft-dev libxfixes-dev libxext-dev \
|
||||
libpng-dev libdbus-1-dev libpam0g-dev 2>&1 | tail -2 || true
|
||||
apt-get autoremove -y 2>&1 | tail -2 || true
|
||||
apt-get clean
|
||||
rm -rf /build /var/cache/apt /tmp/*
|
||||
' 2>&1
|
||||
|
||||
# ── 5. Build squashfs ────────────────────────────────────────────────────
|
||||
echo "==> [5/7] Building squashfs filesystem..."
|
||||
mksquashfs "$FS" "$ISO_STAGE/live/filesystem.squashfs" \
|
||||
-comp zstd -Xcompression-level 6 \
|
||||
-e boot -noappend 2>&1 | tail -3
|
||||
|
||||
# ── 6. Copy kernel + initrd ──────────────────────────────────────────────
|
||||
echo "==> [6/7] Copying kernel and initrd..."
|
||||
VMLINUZ="$(ls "$FS/boot/vmlinuz-"* 2>/dev/null | head -1)"
|
||||
INITRD="$(ls "$FS/boot/initrd.img-"* 2>/dev/null | head -1)"
|
||||
|
||||
if [[ -z "$VMLINUZ" || -z "$INITRD" ]]; then
|
||||
echo "ERROR: kernel or initrd not found in $FS/boot/"
|
||||
ls "$FS/boot/" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp "$VMLINUZ" "$ISO_STAGE/boot/vmlinuz"
|
||||
cp "$INITRD" "$ISO_STAGE/boot/initrd.img"
|
||||
|
||||
# ── 7. GRUB bootloader + ISO ─────────────────────────────────────────────
|
||||
echo "==> [7/7] Building bootable ISO with GRUB..."
|
||||
|
||||
cat > "$ISO_STAGE/boot/grub/grub.cfg" <<'GRUB'
|
||||
set default=0
|
||||
set timeout=5
|
||||
|
||||
menuentry "OrionOS Live" {
|
||||
linux /boot/vmlinuz boot=live quiet splash
|
||||
initrd /boot/initrd.img
|
||||
}
|
||||
|
||||
menuentry "OrionOS Live (safe mode)" {
|
||||
linux /boot/vmlinuz boot=live nomodeset
|
||||
initrd /boot/initrd.img
|
||||
}
|
||||
GRUB
|
||||
|
||||
ISOFILE="$OUT/OrionOS-$(date +%Y%m%d).iso"
|
||||
|
||||
grub-mkrescue -o "$ISOFILE" "$ISO_STAGE" \
|
||||
--modules="normal iso9660 linux ext2 squash4 biosdisk" \
|
||||
2>&1 | grep -v "^$" | tail -10
|
||||
|
||||
SIZE="$(du -sh "$ISOFILE" | cut -f1)"
|
||||
echo ""
|
||||
echo "✓ ISO built: $ISOFILE ($SIZE)"
|
||||
Reference in new issue
Block a user