From dfd26094613e1e6e3bb9643b1d1d6d04023e3056 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 25 Nov 2025 18:07:51 -0500 Subject: [PATCH] Basic installation now working, system comes up talking. --- x86_64/airootfs/usr/local/bin/install-stormux | 12 +- x86_64/profiledef.sh | 2 + x86_64/qemu-boot.sh | 114 +++++++++++++----- 3 files changed, 93 insertions(+), 35 deletions(-) diff --git a/x86_64/airootfs/usr/local/bin/install-stormux b/x86_64/airootfs/usr/local/bin/install-stormux index b28af16..91d9d1b 100755 --- a/x86_64/airootfs/usr/local/bin/install-stormux +++ b/x86_64/airootfs/usr/local/bin/install-stormux @@ -36,6 +36,10 @@ log_error() { echo "ERROR: $*" | tee -a "$logFile" >&2 } +log_warning() { + echo "WARNING: $*" | tee -a "$logFile" >&2 +} + log_info() { echo "INFO: $*" | tee -a "$logFile" } @@ -1529,11 +1533,6 @@ if ! install_bootloader; then exit 1 fi -# Install helper scripts -if ! install_helper_scripts; then - log_warning "Helper script installation had issues (non-fatal)" -fi - # Install game managers if ! install_game_managers; then log_warning "Game manager installation had issues (non-fatal)" @@ -1558,9 +1557,6 @@ if [[ "$desktopEnvironment" == "i3" ]]; then log " 4. Your i3 desktop is configured with I38 for accessibility" log " - I38 source is available in ~/git/I38 for customization" log " - Press Alt+Shift+F1 for I38 help after login" - log " 5. Run 'configure-stormux' for additional setup" -else - log " 4. Run 'configure-stormux' for additional setup" fi log "" diff --git a/x86_64/profiledef.sh b/x86_64/profiledef.sh index bd89f50..510deaf 100644 --- a/x86_64/profiledef.sh +++ b/x86_64/profiledef.sh @@ -26,7 +26,9 @@ file_permissions=( ["/usr/local/bin/Installation_guide"]="0:0:755" ["/usr/local/bin/livecd-sound"]="0:0:755" ["/usr/local/bin/configure-stormux"]="0:0:755" + ["/usr/local/bin/install-stormux"]="0:0:755" ["/usr/local/bin/stormux-setup.sh"]="0:0:755" ["/usr/local/bin/init-pipewire-sound.sh"]="0:0:755" ["/home/stormux"]="1000:1000:755" ) + diff --git a/x86_64/qemu-boot.sh b/x86_64/qemu-boot.sh index 327e11a..9df088c 100755 --- a/x86_64/qemu-boot.sh +++ b/x86_64/qemu-boot.sh @@ -21,10 +21,34 @@ set -e +# Parse command line arguments +bootInstalled=false +while getopts "ih" opt; do + case "$opt" in + i) bootInstalled=true ;; + h) + echo "Usage: $0 [options]" + echo + echo "Options:" + echo " -i Boot from installed system (virtual disk) instead of ISO" + echo " -h Show this help" + echo + echo "Without -i flag, boots from ISO with virtual disk attached for installation." + echo "With -i flag, boots only from virtual disk (installed system)." + exit 0 + ;; + *) + echo "Use -h for help" + exit 1 + ;; + esac +done + # Get the directory where this script is located scriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" outDir="${scriptDir}/out" logDir="${scriptDir}/logs" +diskFile="${scriptDir}/stormux-test-disk.qcow2" # Create logs directory if it doesn't exist mkdir -p "$logDir" @@ -34,31 +58,54 @@ timestamp=$(date +%Y%m%d_%H%M%S) qemuLog="${logDir}/qemu-boot_${timestamp}.log" serialLog="${logDir}/serial-console_${timestamp}.log" -# Find the most recent ISO in the out directory -if [[ ! -d "$outDir" ]]; then - echo "Error: Output directory not found: $outDir" - echo "Please build an ISO first using: sudo ./build.sh" - exit 1 +# Create virtual disk if it doesn't exist +if [[ ! -f "$diskFile" ]]; then + echo "Creating virtual disk: $diskFile (10GB)" + qemu-img create -f qcow2 "$diskFile" 10G + echo "Virtual disk created successfully" + echo fi -# Find the most recent ISO file -isoFile=$(find "$outDir" -name "*.iso" -type f -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-) +# Find ISO file (only needed if not booting installed system) +isoFile="" +if [[ "$bootInstalled" == false ]]; then + # Find the most recent ISO in the out directory + if [[ ! -d "$outDir" ]]; then + echo "Error: Output directory not found: $outDir" + echo "Please build an ISO first using: sudo ./build.sh" + exit 1 + fi -if [[ -z "$isoFile" ]]; then - echo "Error: No ISO file found in $outDir" - echo "Please build an ISO first using: sudo ./build.sh" - exit 1 + # Find the most recent ISO file + isoFile=$(find "$outDir" -name "*.iso" -type f -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-) + + if [[ -z "$isoFile" ]]; then + echo "Error: No ISO file found in $outDir" + echo "Please build an ISO first using: sudo ./build.sh" + exit 1 + fi fi -echo "Found ISO: $isoFile" -echo "Booting Stormux in QEMU with audio support..." +if [[ "$bootInstalled" == true ]]; then + echo "Booting installed system from: $diskFile" +else + echo "Found ISO: $isoFile" + echo "Booting Stormux ISO in QEMU with virtual disk attached..." + echo "Virtual disk: $diskFile" +fi echo echo "Logging to:" echo " QEMU log: $qemuLog" echo " Serial console: $serialLog" echo -echo "Note: After boot, press Ctrl+Alt+F2 to switch to tty2" -echo " where the stormux user will be logged in with Fenrir screen reader." +if [[ "$bootInstalled" == false ]]; then + echo "Note: After boot, press Ctrl+Alt+F2 to switch to tty2" + echo " where the stormux user will be logged in with Fenrir screen reader." + echo " Run 'sudo install-stormux' to install to the virtual disk." + echo " After installation, use './qemu-boot.sh -i' to boot the installed system." +else + echo "Note: Booting from installed system on virtual disk." +fi echo " You can monitor the serial console log in real-time with:" echo " tail -f $serialLog" echo @@ -66,6 +113,30 @@ echo # Export DISPLAY for console usage export DISPLAY="${DISPLAY:-:0}" +# Build QEMU command based on boot mode +# Common options for both modes +# shellcheck disable=SC2054 +qemuCmd=( + qemu-system-x86_64 + -enable-kvm + -m 2048 + -drive file="$diskFile",format=qcow2 + -audiodev pa,id=snd0 + -device intel-hda + -device hda-duplex,audiodev=snd0 + -serial file:"$serialLog" + -D "$qemuLog" + -d guest_errors,cpu_reset + -display gtk +) + +# Add ISO and boot order if booting from ISO +if [[ "$bootInstalled" == false ]]; then + qemuCmd+=(-cdrom "$isoFile" -boot order=dc) +else + qemuCmd+=(-boot c) +fi + # Boot QEMU with audio support and logging # -D: QEMU debug log (shows QEMU errors, device issues) # -d: Debug categories (guest_errors, cpu_reset) @@ -73,15 +144,4 @@ export DISPLAY="${DISPLAY:-:0}" # -audiodev: PulseAudio backend for audio # -device intel-hda: Intel HD Audio controller # -device hda-duplex: HD Audio codec with input/output, connected to audiodev -exec qemu-system-x86_64 \ - -enable-kvm \ - -m 2048 \ - -cdrom "$isoFile" \ - -boot d \ - -audiodev pa,id=snd0 \ - -device intel-hda \ - -device hda-duplex,audiodev=snd0 \ - -serial file:"$serialLog" \ - -D "$qemuLog" \ - -d guest_errors,cpu_reset \ - -display gtk +exec "${qemuCmd[@]}"