Skip to content

Commit

Permalink
fix MEM
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Jun 11, 2024
1 parent 15555ad commit d47c8ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion files/initrd/opt/rr/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"

DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')"
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
MEM="$(free -m 2>/dev/null | grep -i mem | awk '{print $2}') MB"
MEM="$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null) MB"

echo -e "$(TEXT "Model: ") \033[1;36m${MODEL}(${PLATFORM})\033[0m"
echo -e "$(TEXT "Version: ") \033[1;36m${PRODUCTVER}(${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
Expand Down
2 changes: 1 addition & 1 deletion files/initrd/opt/rr/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ if [ "${DSMLOGO}" = "true" -a -c "/dev/fb0" -a ! "LOCALBUILD" = "${LOADER_DISK}"
fi

# Check memory
RAM=$(free -m 2>/dev/null | awk '/Mem:/{print $2}')
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)
if [ ${RAM:-0} -le 3500 ]; then
echo -e "\033[1;33m$(TEXT "You have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of memory.")\033[0m\n"
fi
Expand Down

0 comments on commit d47c8ac

Please sign in to comment.