This commit is contained in:
randogoth 2025-10-18 23:29:41 +03:00
parent a802babae9
commit 026da2dfa0
3 changed files with 33 additions and 3 deletions

View file

@ -5,7 +5,6 @@ ENV DEBIAN_FRONTEND=noninteractive
# Install base packages and enable the dosemu2 PPA # Install base packages and enable the dosemu2 PPA
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
software-properties-common \
gnupg \ gnupg \
openssh-server \ openssh-server \
busybox-static \ busybox-static \
@ -15,6 +14,7 @@ RUN apt-get update && \
mtools \ mtools \
unzip \ unzip \
file \ file \
xauth \
&& add-apt-repository -y ppa:dosemu2/ppa && \ && add-apt-repository -y ppa:dosemu2/ppa && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
dosemu2 \ dosemu2 \

View file

@ -6,7 +6,9 @@ PermitRootLogin no
PasswordAuthentication yes PasswordAuthentication yes
ChallengeResponseAuthentication no ChallengeResponseAuthentication no
UsePAM yes UsePAM yes
X11Forwarding no X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
PrintMotd no PrintMotd no
AcceptEnv LANG LC_* AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp /usr/lib/openssh/sftp-server

View file

@ -31,7 +31,32 @@ fi
DOSEMU_DIR="${DOS_HOME}/.dosemu" DOSEMU_DIR="${DOS_HOME}/.dosemu"
C_DRIVE="${DOSEMU_DIR}/drive_c" C_DRIVE="${DOSEMU_DIR}/drive_c"
INSTALL_MARKER="${DOSEMU_DIR}/${INSTALL_SENTINEL}" INSTALL_MARKER="${DOSEMU_DIR}/${INSTALL_SENTINEL}"
DOSEMU_ARGS=(-dumb -K "${C_DRIVE}") detect_dosemu_args() {
local mode="${DOS_TERMINAL_MODE:-auto}"
if [ "${mode}" = "auto" ]; then
if [ -n "${DISPLAY:-}" ]; then
mode="x"
else
mode="terminal"
fi
fi
case "${mode,,}" in
x|sdl|window|gui)
DOSEMU_ARGS=(-X -K "${C_DRIVE}")
;;
terminal|tty|text)
DOSEMU_ARGS=(-td -K "${C_DRIVE}")
;;
dumb)
DOSEMU_ARGS=(-dumb -K "${C_DRIVE}")
;;
*)
echo "Unknown DOS_TERMINAL_MODE '${mode}', defaulting to terminal mode." >&2
DOSEMU_ARGS=(-td -K "${C_DRIVE}")
;;
esac
}
allowed_entries=() allowed_entries=()
mkdir -p "${DOSEMU_DIR}" "${C_DRIVE}" mkdir -p "${DOSEMU_DIR}" "${C_DRIVE}"
@ -180,11 +205,14 @@ if needs_install; then
if run_headless_install; then if run_headless_install; then
set_install_marker set_install_marker
echo "SvarDOS provisioning complete." echo "SvarDOS provisioning complete."
echo "Disconnecting. Reconnect via SSH to start the SvarDOS shell."
exit 0
else else
exit 1 exit 1
fi fi
fi fi
detect_dosemu_args
sync_allowed_content sync_allowed_content
apply_templates apply_templates