mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-12 17:48:27 +08:00
修复部分机器因为信息识别有误导致无法正常启动虚拟机的问题
This commit is contained in:
parent
b7b798d491
commit
78de66961e
11
StartVM.sh
11
StartVM.sh
@ -29,7 +29,16 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
CpuCoreNum=`grep 'core id' /proc/cpuinfo | sort -u | wc -l`
|
||||
# 查看逻辑CPU的个数
|
||||
CpuCount=`cat /proc/cpuinfo| grep "processor"| wc -l`
|
||||
|
||||
# 判断是否检测异常,如果异常则使用默认值
|
||||
if [[ $CpuSocketNum == 0 ]]; then
|
||||
CpuSocketNum=1
|
||||
fi
|
||||
if [[ $CpuCoreNum == 0 ]]; then
|
||||
CpuCoreNum=1
|
||||
fi
|
||||
if [[ $CpuCount == 0 ]]; then
|
||||
CpuCount=2
|
||||
fi
|
||||
# 总内存大小GB
|
||||
MemTotal=`awk '($1 == "MemTotal:"){printf "%.2f\n",$2/1024/1024}' /proc/meminfo`
|
||||
use=$(echo "scale=4; $MemTotal / 3" | bc)
|
||||
|
Loading…
Reference in New Issue
Block a user