Files
OrionOS/iso/build-base.sh
T
nmemmertandClaude Sonnet 4.6 33c2f3b66d Fix remaining sky* references missed in Phase 7 rename
- Dockerfile: WORKDIR /skyos → /orionos, ENTRYPOINT path, image name
- Makefile: skyos-default.png → orionos-default.png in install target
- iso/build-base.sh: all sky*/SkyOS → orion*/OrionOS
- iso/mac-install-notes.md: update install instructions for OrionOS
- themes/OrionOS: finish renaming sky* strings in gtkrc, gtk.css, index.theme

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 13:45:00 -04:00

168 lines
4.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# OrionOS base system builder
# Builds a bootable ISO from an Arch Linux base with the SkyWM desktop.
# Run this on an existing Arch Linux install or in a Docker container.
#
# Usage: sudo ./build-base.sh
# Output: orionos.iso
set -euo pipefail
WORK=/tmp/orionos-build
ISO_NAME=orionos.iso
SKYOS_PKGS=(
# base
base linux linux-firmware
# bootloader (EFI + BIOS — covers Intel Macs via rEFInd)
grub efibootmgr refind
# X11 stack (no display manager, just startx)
xorg-server xorg-xinit xorg-xrandr xorg-xsetroot
xterm
# fonts
ttf-dejavu ttf-liberation noto-fonts
# hardware support for Intel Macs
broadcom-wl-dkms # WiFi
xf86-video-intel # GPU (older iGPU Macs)
xf86-input-libinput
alsa-utils # audio
# tools
thunar # file manager
mousepad # text editor (GTK, lightweight)
feh # desktop wallpaper setter
picom # compositor (optional shadows)
networkmanager # networking
sudo git nano
)
echo ">>> Creating chroot at $WORK"
mkdir -p "$WORK"
echo ">>> Bootstrapping Arch base"
pacstrap "$WORK" "${SKYOS_PKGS[@]}"
echo ">>> Configuring system"
arch-chroot "$WORK" /bin/bash -s <<'CHROOT'
# locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
# hostname
echo "orionos" > /etc/hostname
cat > /etc/hosts <<EOF
127.0.0.1 localhost
::1 localhost
127.0.1.1 orionos.localdomain orionos
EOF
# timezone
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc
# default user
useradd -m -G wheel,audio,video,storage -s /bin/bash sky
echo "orion:orionos" | chpasswd
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
# enable services
systemctl enable NetworkManager
# initramfs
mkinitcpio -P
CHROOT
echo ">>> Installing SkyWM & Deskbar binaries"
cp "$(dirname "$0")/../wm/orionwm" "$WORK/usr/local/bin/orionwm"
cp "$(dirname "$0")/../deskbar/oriondeskbar" "$WORK/usr/local/bin/oriondeskbar"
chmod 755 "$WORK/usr/local/bin/orionwm" "$WORK/usr/local/bin/oriondeskbar"
echo ">>> Writing xinitrc"
cat > "$WORK/home/sky/.xinitrc" <<'XINITRC'
#!/bin/sh
# Set wallpaper (restores saved choice, or uses default)
skywallpaper
# Apply GTK theme
export GTK_THEME=OrionOS
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
cat > "$HOME/.gtkrc-2.0" <<EOF
include "/usr/share/themes/OrionOS/gtk-2.0/gtkrc"
EOF
mkdir -p "$HOME/.config/gtk-3.0"
cat > "$HOME/.config/gtk-3.0/settings.ini" <<EOF
[Settings]
gtk-theme-name=OrionOS
gtk-font-name=Sans 10
gtk-icon-theme-name=Adwaita
gtk-cursor-theme-name=DMZ-White
gtk-button-images=false
gtk-menu-images=false
EOF
# Compositor (subtle shadows, fast fade)
picom --config /etc/orionos/picom.conf &
# Alt+F1 global hotkey for launcher (via xbindkeys)
xbindkeys &
# Launch Deskbar
oriondeskbar &
# Launch window manager (last, takes over the session)
exec orionwm
XINITRC
chmod 755 "$WORK/home/sky/.xinitrc"
arch-chroot "$WORK" chown sky:sky /home/sky/.xinitrc
echo ">>> Writing xbindkeys config (Alt+F1 = launcher)"
cat > "$WORK/home/sky/.xbindkeysrc" <<'XBK'
"orionlauncher"
Mod1 + F1
XBK
arch-chroot "$WORK" chown sky:sky /home/sky/.xbindkeysrc
echo ">>> Installing picom config"
mkdir -p "$WORK/etc/skyos"
cp "$(dirname "$0")/../themes/picom.conf" "$WORK/etc/orionos/picom.conf"
echo ">>> Installing GTK theme"
mkdir -p "$WORK/usr/share/themes"
cp -r "$(dirname "$0")/../themes/OrionOS" "$WORK/usr/share/themes/"
echo ">>> Installing skywallpaper helper"
cp "$(dirname "$0")/../themes/skywallpaper" "$WORK/usr/local/bin/skywallpaper"
chmod 755 "$WORK/usr/local/bin/skywallpaper"
echo ">>> Generating default wallpaper"
mkdir -p "$WORK/usr/share/orionos/wallpapers"
(cd "$WORK/usr/share/orionos/wallpapers" && bash "$(dirname "$0")/../themes/wallpapers/generate-default.sh") || true
echo ">>> Installing rEFInd bootloader config for Intel Macs"
mkdir -p "$WORK/boot/EFI/refind"
cat > "$WORK/boot/EFI/refind/refind.conf" <<'REFIND'
timeout 5
use_graphics_for linux
scanfor manual
menuentry "OrionOS" {
icon /EFI/refind/icons/os_linux.png
volume "OrionOS"
loader /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
options "root=LABEL=OrionOS rw quiet splash"
}
REFIND
echo ">>> Creating ISO"
# mkarchiso requires archiso package
if command -v mkarchiso &>/dev/null; then
# Minimal archiso profile pointing to our chroot
mkarchiso -v -w /tmp/orionos-iso-work -o . "$WORK"
mv *.iso "$ISO_NAME"
else
echo "WARNING: archiso not installed. To build the ISO:"
echo " pacman -S archiso && rerun this script"
echo " OR: use the chroot at $WORK to install manually."
fi
echo ">>> Done. Output: $ISO_NAME (or chroot at $WORK)"