Installation fixes

This commit is contained in:
Kroese
2023-03-28 22:00:23 +02:00
parent 335f0602e0
commit 61c57419d9
2 changed files with 49 additions and 25 deletions

25
run.sh
View File

@@ -7,9 +7,24 @@ set -eu
if /run/install.sh; then
echo "Starting DSM for Docker..."
else
echo "Installation failed (code $?)" && exit 2
echo "Installation failed (code $?)" && exit 80
fi
IMG="/storage"
FILE="$IMG/boot.img"
[ ! -f "$FILE" ] && echo "ERROR: Synology DSM boot-image does not exist ($FILE)" && exit 81
FILE="$IMG/system.img"
[ ! -f "$FILE" ] && echo "ERROR: Synology DSM system-image does not exist ($FILE)" && exit 82
FILE="$IMG/data.img"
if [ ! -f "$FILE" ]; then
truncate -s $DISK_SIZE $FILE
mkfs.ext4 -q $FILE
fi
[ ! -f "$FILE" ] && echo "ERROR: Synology DSM data-image does not exist ($FILE)" && exit 83
# A bridge of this name will be created to host the TAP interface created for
# the VM
QEMU_BRIDGE='qemubr0'
@@ -74,17 +89,15 @@ GUEST_SERIAL=$(/run/serial.sh)
# Stop the webserver
pkill -f server.sh
[ ! -e /dev/fuse ] && echo "Error: FUSE interface not available..." && exit 2
[ ! -e /dev/net/tun ] && echo "Error: TUN interface not available..." && exit 2
[ ! -e /dev/fuse ] && echo "Error: FUSE interface not available..." && exit 84
[ ! -e /dev/net/tun ] && echo "Error: TUN interface not available..." && exit 85
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
echo "Booting DSM image..."
else
echo "Error: KVM not available..." && exit 2
echo "Error: KVM not available..." && exit 86
fi
IMG="/storage"
# Configure QEMU for graceful shutdown
QEMU_MONPORT=7100