1
0
mirror of https://github.com/bin456789/reinstall.git synced 2025-08-18 07:11:49 +00:00

core: 查询不到准确内存时使用 free 兜底

fixes 
This commit is contained in:
bin456789
2024-10-19 00:42:30 +08:00
parent a45aa86b7d
commit 6408fa85f1

@@ -1730,6 +1730,12 @@ check_ram() {
fi fi
fi fi
# 用于兜底,不太准确
if [ -z $ram_size ]; then
ram_size=$(free -m | grep ^Mem: | awk '{print $2}')
ram_size=$((ram_size + 64 + 4))
fi
if [ -z $ram_size ] || [ $ram_size -le 0 ]; then if [ -z $ram_size ] || [ $ram_size -le 0 ]; then
error_and_exit "Could not detect RAM size." error_and_exit "Could not detect RAM size."
fi fi