This commit is contained in:
Kroese 2023-04-21 12:46:06 +02:00 committed by GitHub
parent c39f22e7c1
commit 5de55ee04a

View file

@ -3,12 +3,12 @@ set -eu
# Docker environment variabeles
: ${BOOT:=''}. # URL of the ISO file
: ${BOOT:=''}. # URL of the ISO file
: ${DEBUG:=''}. # Enable debug mode
: ${ALLOCATE:='Y'} # Preallocate diskspace
: ${CPU_CORES:='1'} # vCPU count
: ${DISK_SIZE:='16G'} # Initial disk size
: ${RAM_SIZE:='512M'} # Amount of RAM
: ${CPU_CORES:='1'} # Amount of CPU cores
: ${DISK_SIZE:='16G'} # Initial data disk size
: ${RAM_SIZE:='512M'} # Maximum RAM amount
echo "Starting QEMU for Docker v${VERSION}..."
@ -32,7 +32,7 @@ fi
KVM_OPTS=""
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
if [[ $(grep -e vmx -e svm /proc/cpuinfo) ]]; then
if grep -q -e vmx -e svm /proc/cpuinfo; then
KVM_OPTS=",accel=kvm -enable-kvm -cpu host"
fi
fi
@ -52,7 +52,7 @@ ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_OPTS} ${MON_OPTS} ${SERIAL_OPTS}
set -m
(
qemu-system-x86_64 ${ARGS} & echo $! > ${_QEMU_PID}
qemu-system-x86_64 ${ARGS:+ $ARGS} & echo $! > "${_QEMU_PID}"
)
set +m