launchers/kvm : suppression variables inutiles

This commit is contained in:
Ahurac 2024-03-12 10:48:32 +01:00
parent 84722e404f
commit 428ceb7738

View file

@ -1,22 +1,18 @@
#!/usr/bin/env sh
# What processor architecture to use
arch=$QEMUSH_ARCH
[ -z "$arch" ] && arch=$(uname -m)
[ -z "$QEMUSH_ARCH" ] && QEMUSH_ARCH=$(uname -m)
# How many CPU cores to use
nproc=$QEMUSH_NPROC
[ -z "$nproc" ] && nproc=$(($(nproc) / 2))
[ -z "$QEMUSH_NPROC" ] && QEMUSH_NPROC=$(($(nproc) / 2))
# How much RAM to use
ram=$QEMUSH_RAM
[ -z "$ram" ] && ram=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
[ -z "$QEMUSH_RAM" ] && QEMUSH_RAM=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
# Set the arguments
set -- "qemu-system-${arch}" \
set -- "qemu-system-${QEMUSH_ARCH}" \
-enable-kvm \
-M q35 \
-cpu host -smp "$nproc" \
-m "$ram" \
-cpu host -smp "$QEMUSH_NPROC" \
-m "$QEMUSH_RAM" \
"$@"
# Start the machine