2024-01-14 13:49:42 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
|
2024-03-13 09:20:18 +00:00
|
|
|
: "${BOOT_MODE:="windows"}"
|
|
|
|
|
2024-01-20 16:03:59 +00:00
|
|
|
APP="Windows"
|
|
|
|
SUPPORT="https://github.com/dockur/windows"
|
2024-01-14 14:19:58 +00:00
|
|
|
|
2024-01-14 13:49:42 +00:00
|
|
|
cd /run
|
|
|
|
|
|
|
|
. reset.sh # Initialize system
|
2024-04-30 20:57:44 +00:00
|
|
|
. define.sh # Define versions
|
2024-05-18 14:33:12 +00:00
|
|
|
. mido.sh # Download code
|
2024-01-23 21:38:17 +00:00
|
|
|
. install.sh # Run installation
|
2024-01-14 13:49:42 +00:00
|
|
|
. disk.sh # Initialize disks
|
|
|
|
. display.sh # Initialize graphics
|
|
|
|
. network.sh # Initialize network
|
2024-02-07 22:48:38 +00:00
|
|
|
. samba.sh # Configure samba
|
2024-01-14 13:49:42 +00:00
|
|
|
. boot.sh # Configure boot
|
|
|
|
. proc.sh # Initialize processor
|
2024-01-23 21:38:17 +00:00
|
|
|
. power.sh # Configure shutdown
|
2024-01-14 13:49:42 +00:00
|
|
|
. config.sh # Configure arguments
|
|
|
|
|
|
|
|
trap - ERR
|
|
|
|
|
2024-06-09 21:17:42 +00:00
|
|
|
version=$(qemu-system-x86_64 --version | head -n 1 | cut -d '(' -f 1 | awk '{ print $NF }')
|
|
|
|
info "Booting ${APP}${BOOT_DESC} using QEMU v$version..."
|
2024-01-14 13:49:42 +00:00
|
|
|
|
2024-01-23 21:38:17 +00:00
|
|
|
{ qemu-system-x86_64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
|
|
|
|
(( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15
|
|
|
|
|
|
|
|
terminal
|
2024-04-30 20:57:44 +00:00
|
|
|
( sleep 10; boot ) &
|
2024-01-23 21:38:17 +00:00
|
|
|
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
|
2024-01-24 04:38:16 +00:00
|
|
|
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" &
|
|
|
|
wait $! || :
|
2024-01-23 21:38:17 +00:00
|
|
|
|
2024-03-11 12:30:07 +00:00
|
|
|
sleep 1 & wait $!
|
2024-05-27 10:40:19 +00:00
|
|
|
[ ! -f "$QEMU_END" ] && finish 0
|