#!/bin/bash set -e # AeThex Multi-ISO Builder # Builds all 5 ISO variants for Ventoy deployment BUILD_DIR="$(pwd)/aethex-linux-build" ISO_OUTPUT="$BUILD_DIR/ventoy-isos" BASE_ISO="$BUILD_DIR/base-system.iso" echo "🚀 Building All AeThex-OS ISO Variants..." echo "================================================" # Create output directory mkdir -p "$ISO_OUTPUT" # Function to build custom ISO from base build_custom_iso() { local variant=$1 local display_name=$2 local packages=$3 local config_script=$4 echo "" echo "📦 Building AeThex-$variant.iso..." echo "==================================" # Create working directory WORK_DIR="/tmp/aethex-$variant" sudo rm -rf "$WORK_DIR" mkdir -p "$WORK_DIR" # Extract base ISO echo " Extracting base system..." sudo mount -o loop "$BASE_ISO" /mnt 2>/dev/null || true sudo cp -a /mnt/* "$WORK_DIR/" 2>/dev/null || true sudo umount /mnt 2>/dev/null || true # Customize with chroot echo " Installing packages: $packages" sudo chroot "$WORK_DIR" /bin/bash < "$WORK_DIR/isolinux/splash.txt" < "AeThex-$variant.iso.sha256" cd - > /dev/null echo " ✅ AeThex-$variant.iso complete!" ls -lh "$ISO_OUTPUT/AeThex-$variant.iso" } # ============================================ # Step 1: Build Base System (if not exists) # ============================================ if [ ! -f "$BASE_ISO" ]; then echo "📦 Building base system ISO..." ./script/build-iso.sh cp "$BUILD_DIR/AeThex-Linux-amd64.iso" "$BASE_ISO" fi # ============================================ # Step 2: Build AeThex-Core (Minimal) # ============================================ build_custom_iso "Core" "Base OS" \ "firefox chromium-browser neofetch htop" \ " # Set hostname echo 'aethex-core' > /etc/hostname # Create default user useradd -m -s /bin/bash -G sudo aethex echo 'aethex:aethex' | chpasswd # Auto-login mkdir -p /etc/lightdm/lightdm.conf.d cat > /etc/lightdm/lightdm.conf.d/50-aethex.conf < /home/aethex/.config/autostart/aethex-launcher.desktop <