fix: Support read-only images (#432)

This commit is contained in:
Kroese 2024-04-27 12:05:28 +02:00 committed by GitHub
parent 9b35c0e3a5
commit 80ae80ae10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -6,9 +6,7 @@ body:
- type: markdown
attributes:
value: |
Have a general question about Windows for Docker?
Please do not use this form for technical issues.
And make sure to check the [FAQ](https://github.com/dockur/windows/blob/master/readme.md) first!
Please do not use this form for technical issues, and make sure to check the [FAQ](https://github.com/dockur/windows/blob/master/readme.md) first!
- type: textarea
id: question
attributes:

View File

@ -6,13 +6,14 @@ set -Eeuo pipefail
QEMU_TERM=""
QEMU_PORT=7100
QEMU_TIMEOUT=110
QEMU_PID="/run/shm/qemu.pid"
QEMU_PTY="/run/shm/qemu.pty"
QEMU_LOG="/run/shm/qemu.log"
QEMU_OUT="/run/shm/qemu.out"
QEMU_END="/run/shm/qemu.end"
QEMU_DIR="/run/shm"
QEMU_PID="$QEMU_DIR/qemu.pid"
QEMU_PTY="$QEMU_DIR/qemu.pty"
QEMU_LOG="$QEMU_DIR/qemu.log"
QEMU_OUT="$QEMU_DIR/qemu.out"
QEMU_END="$QEMU_DIR/qemu.end"
rm -f /run/shm/qemu.*
rm -f "$QEMU_DIR/qemu.*"
touch "$QEMU_LOG"
_trap() {
@ -68,8 +69,9 @@ finish() {
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$STORAGE/$BASE" ]; then
# Remove CD-ROM ISO after install
if ready; then
rm -f "$STORAGE/$BASE"
touch "$STORAGE/windows.boot"
if rm -f "$STORAGE/$BASE" 2>/dev/null; then
touch "$STORAGE/windows.boot"
fi
fi
fi