feat: Display emulated CPU

This commit is contained in:
Kroese 2023-12-16 04:44:15 +01:00 committed by GitHub
parent 2cc1af19b1
commit 10915a601c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,14 +10,14 @@ set -Eeuo pipefail
: ${HOST_MODEL:=''}
: ${GUEST_SERIAL:=''}
if [ -z "$HOST_CPU" ] && [ "$CPU_MODEL" == "host" ]; then
if [ -z "$HOST_CPU" ] && [ "$CPU_MODEL" == "host"* ]; then
HOST_CPU=$(lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
fi
if [ -n "$HOST_CPU" ]; then
HOST_CPU="${HOST_CPU%%,*},,"
else
if [ "$CPU_MODEL" == "host" ] || [ "$CPU_MODEL" == "qemu"* ]; then
if [ "$CPU_MODEL" == "host"* ] || [ "$CPU_MODEL" == "qemu"* ]; then
HOST_CPU="QEMU"
else
HOST_CPU="${CPU_MODEL%%,*}"