entry.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. set -Eeuo pipefail
  3. : "${APP:="Windows"}"
  4. : "${BOOT_MODE:="windows"}"
  5. : "${SUPPORT:="https://github.com/dockur/windows"}"
  6. cd /run
  7. . reset.sh # Initialize system
  8. . define.sh # Define versions
  9. . mido.sh # Download code
  10. . install.sh # Run installation
  11. . disk.sh # Initialize disks
  12. . display.sh # Initialize graphics
  13. . network.sh # Initialize network
  14. . samba.sh # Configure samba
  15. . boot.sh # Configure boot
  16. . proc.sh # Initialize processor
  17. . power.sh # Configure shutdown
  18. . config.sh # Configure arguments
  19. trap - ERR
  20. version=$(qemu-system-x86_64 --version | head -n 1 | cut -d '(' -f 1 | awk '{ print $NF }')
  21. info "Booting ${APP}${BOOT_DESC} using QEMU v$version..."
  22. { qemu-system-x86_64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
  23. (( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15
  24. terminal
  25. ( sleep 30; boot ) &
  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. [ ! -f "$QEMU_END" ] && finish 0