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-04-19 23:50:49 +00:00
|
|
|
info "Booting ${APP}${BOOT_DESC} on ${CPU} using QEMU v${VERS} with kernel $(uname -r)..."
|
2024-01-23 21:38:17 +00:00
|
|
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Arguments: $ARGS" && echo
|
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
|
|
|
|
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
|
2024-04-18 22:00:17 +00:00
|
|
|
( sleep 6; [ ! -f "$QEMU_END" ] && info "Windows started succesfully, visit http://localhost:8006/ to view the screen..." ) &
|
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
|