mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-02 10:47:19 +08:00
feat: Check CPU vendor (#982)
This commit is contained in:
parent
1dc15ce2e0
commit
d5805b4e08
@ -8,7 +8,9 @@ set -Eeuo pipefail
|
|||||||
: "${DISPLAY:="none"}" # Display type
|
: "${DISPLAY:="none"}" # Display type
|
||||||
: "${RENDERNODE:="/dev/dri/renderD128"}" # Render node
|
: "${RENDERNODE:="/dev/dri/renderD128"}" # Render node
|
||||||
|
|
||||||
if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then
|
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
||||||
|
|
||||||
|
if [[ "$GPU" != [Yy1]* ]] || [[ "$CPU_VENDOR" != "GenuineIntel" ]] || [[ "$ARCH" != "amd64" ]]; then
|
||||||
|
|
||||||
[[ "${DISPLAY,,}" == "none" ]] && VGA="none"
|
[[ "${DISPLAY,,}" == "none" ]] && VGA="none"
|
||||||
DISPLAY_OPTS="-display $DISPLAY -vga $VGA"
|
DISPLAY_OPTS="-display $DISPLAY -vga $VGA"
|
||||||
|
@ -113,15 +113,15 @@ cpu() {
|
|||||||
local cpu=""
|
local cpu=""
|
||||||
|
|
||||||
ret=$(lscpu)
|
ret=$(lscpu)
|
||||||
|
|
||||||
if grep -qi "model name" <<< "$ret"; then
|
if grep -qi "model name" <<< "$ret"; then
|
||||||
cpu=$(echo "$ret" | grep -m 1 -i 'model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
|
cpu=$(echo "$ret" | grep -m 1 -i '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
|
fi
|
||||||
|
|
||||||
if [ -z "${cpu// /}" ] && grep -qi "model:" <<< "$ret"; then
|
if [ -z "${cpu// /}" ] && grep -qi "model:" <<< "$ret"; then
|
||||||
cpu=$(echo "$ret" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
|
cpu=$(echo "$ret" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cpu="${cpu// CPU/}"
|
cpu="${cpu// CPU/}"
|
||||||
cpu="${cpu// 4 Core/}"
|
cpu="${cpu// 4 Core/}"
|
||||||
cpu="${cpu// 6 Core/}"
|
cpu="${cpu// 6 Core/}"
|
||||||
@ -148,7 +148,7 @@ cpu() {
|
|||||||
cpu="${cpu// with Radeon Graphics/}"
|
cpu="${cpu// with Radeon Graphics/}"
|
||||||
cpu="${cpu// with Radeon Vega Graphics/}"
|
cpu="${cpu// with Radeon Vega Graphics/}"
|
||||||
cpu="${cpu// with Radeon Vega Mobile Gfx/}"
|
cpu="${cpu// with Radeon Vega Mobile Gfx/}"
|
||||||
|
|
||||||
[ -z "${cpu// /}" ] && cpu="Unknown"
|
[ -z "${cpu// /}" ] && cpu="Unknown"
|
||||||
|
|
||||||
echo "$cpu"
|
echo "$cpu"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user