From 6408fa85f1d183b5ee71dc1cba9aa7ca769e2348 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 19 Oct 2024 00:42:30 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=9F=A5=E8=AF=A2=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E5=86=85=E5=AD=98=E6=97=B6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20free=20=E5=85=9C=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #179 --- reinstall.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reinstall.sh b/reinstall.sh index 3013caa..3ae30c7 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -1730,6 +1730,12 @@ check_ram() { 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 error_and_exit "Could not detect RAM size." fi