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-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-01-20 16:03:59 +00:00
|
|
|
info "Booting $APP using $VERS..."
|
2024-01-23 21:38:17 +00:00
|
|
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Arguments: $ARGS" && echo
|
2024-01-14 13:49:42 +00:00
|
|
|
|
2024-03-11 12:30:07 +00:00
|
|
|
if [[ "$CONSOLE" == [Yy]* ]]; then
|
|
|
|
exec qemu-system-x86_64 ${ARGS:+ $ARGS}
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
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 $!
|
|
|
|
finish 0
|