windows/src/entry.sh

38 lines
1007 B
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
. 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-04-25 14:39:15 +02:00
info "Booting ${APP}${BOOT_DESC}..."
[[ "$DEBUG" == [Yy1]* ]] && echo "Arguments: $ARGS" && echo
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
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
( sleep 10; [ ! -f "$QEMU_END" ] && info "Windows started succesfully, visit http://localhost:8006/ to view the screen..." ) &
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" &
wait $! || :
sleep 1 & wait $!
finish 0