entry.sh 959 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. set -Eeuo pipefail
  3. : "${BOOT_MODE:="windows"}"
  4. APP="Windows"
  5. SUPPORT="https://github.com/dockur/windows"
  6. cd /run
  7. . reset.sh # Initialize system
  8. . install.sh # Run installation
  9. . disk.sh # Initialize disks
  10. . display.sh # Initialize graphics
  11. . network.sh # Initialize network
  12. . samba.sh # Configure samba
  13. . boot.sh # Configure boot
  14. . proc.sh # Initialize processor
  15. . power.sh # Configure shutdown
  16. . config.sh # Configure arguments
  17. trap - ERR
  18. info "Booting $APP using $VERS..."
  19. [[ "$DEBUG" == [Yy1]* ]] && echo "Arguments: $ARGS" && echo
  20. if [[ "$CONSOLE" == [Yy]* ]]; then
  21. exec qemu-system-x86_64 ${ARGS:+ $ARGS}
  22. fi
  23. { qemu-system-x86_64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
  24. (( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15
  25. terminal
  26. tail -fn +0 "$QEMU_LOG" 2>/dev/null &
  27. cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" &
  28. wait $! || :
  29. sleep 1 & wait $!
  30. finish 0