fix: Support read-only images
This commit is contained in:
parent
a7dbd7ada8
commit
74bab44c71
1 changed files with 10 additions and 8 deletions
18
src/power.sh
18
src/power.sh
|
|
@ -6,13 +6,14 @@ set -Eeuo pipefail
|
||||||
QEMU_TERM=""
|
QEMU_TERM=""
|
||||||
QEMU_PORT=7100
|
QEMU_PORT=7100
|
||||||
QEMU_TIMEOUT=110
|
QEMU_TIMEOUT=110
|
||||||
QEMU_PID="/run/shm/qemu.pid"
|
QEMU_DIR="/run/shm"
|
||||||
QEMU_PTY="/run/shm/qemu.pty"
|
QEMU_PID="$QEMU_DIR/qemu.pid"
|
||||||
QEMU_LOG="/run/shm/qemu.log"
|
QEMU_PTY="$QEMU_DIR/qemu.pty"
|
||||||
QEMU_OUT="/run/shm/qemu.out"
|
QEMU_LOG="$QEMU_DIR/qemu.log"
|
||||||
QEMU_END="/run/shm/qemu.end"
|
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"
|
touch "$QEMU_LOG"
|
||||||
|
|
||||||
_trap() {
|
_trap() {
|
||||||
|
|
@ -58,8 +59,9 @@ finish() {
|
||||||
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$STORAGE/$BASE" ]; then
|
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$STORAGE/$BASE" ]; then
|
||||||
# Remove CD-ROM ISO after install
|
# Remove CD-ROM ISO after install
|
||||||
if ready; then
|
if ready; then
|
||||||
rm -f "$STORAGE/$BASE"
|
if rm -f "$STORAGE/$BASE" 2>/dev/null; then
|
||||||
touch "$STORAGE/windows.boot"
|
touch "$STORAGE/windows.boot"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue