docker-windows/src/entry.sh

43 lines
1.2 KiB
Bash
Raw Normal View History

2024-01-14 14:49:42 +01:00
#!/usr/bin/env bash
set -Eeuo pipefail
: "${APP:="Windows"}"
2025-03-20 11:09:40 +01:00
: "${PLATFORM:="x64"}"
: "${BOOT_MODE:="windows"}"
: "${SUPPORT:="https://github.com/dockur/windows"}"
2024-01-14 15:19:58 +01:00
2024-01-14 14:49:42 +01:00
cd /run
2025-03-18 14:02:31 +01:00
. utils.sh # Load functions
2024-01-14 14:49:42 +01:00
. reset.sh # Initialize system
. define.sh # Define versions
2025-03-18 14:02:31 +01:00
. mido.sh # Download Windows
. install.sh # Run installation
2024-01-14 14:49:42 +01:00
. disk.sh # Initialize disks
. display.sh # Initialize graphics
. network.sh # Initialize network
2024-02-07 23:48:38 +01:00
. samba.sh # Configure samba
2024-01-14 14:49:42 +01:00
. boot.sh # Configure boot
. proc.sh # Initialize processor
. power.sh # Configure shutdown
2024-01-14 14:49:42 +01:00
. config.sh # Configure arguments
trap - ERR
2024-06-09 23:17:42 +02: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 14:49:42 +01:00
{ qemu-system-x86_64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
(( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15
terminal
( sleep 30; boot ) &
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
2025-03-20 00:41:09 +01:00
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" | \
2025-03-20 01:19:05 +01:00
sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \
-e 's/failed to load Boot/skipped Boot/g' \
-e 's/0): Not Found/0)/g' & wait $! || :
sleep 1 & wait $!
2024-05-27 12:40:19 +02:00
[ ! -f "$QEMU_END" ] && finish 0