windows/src/entry.sh

40 lines
1.0 KiB
Bash
Raw Normal View History

2024-01-14 14:49:42 +01:00
#!/usr/bin/env bash
set -Eeuo pipefail
: "${BOOT_MODE:="windows"}"
2024-01-20 17:03:59 +01:00
APP="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
. reset.sh # Initialize system
. define.sh # Define versions
2024-05-18 16:33:12 +02:00
. mido.sh # Download code
. 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 10; boot ) &
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" &
wait $! || :
sleep 1 & wait $!
2024-05-27 12:40:19 +02:00
[ ! -f "$QEMU_END" ] && finish 0