M1 system_profiler "Upgradeable Memory" workaround

This commit is contained in:
tantonw
2022-02-25 16:35:33 -08:00
committed by GitHub
parent 391d345b64
commit 4233b7a72d

View File

@@ -139,7 +139,12 @@ os_check() {
}
check_ram_upgradeable() {
/usr/sbin/system_profiler SPMemoryDataType | /usr/bin/awk -F "Upgradeable Memory: " '{print $2}' | /usr/bin/xargs 2&> /dev/null
ram_upgradeable=$( /usr/sbin/system_profiler SPMemoryDataType | /usr/bin/awk -F "Upgradeable Memory: " '{print $2}' | /usr/bin/xargs 2&> /dev/null )
# M1 Macs don't return the "Upgradeable Memory:" attribute as of early 2022
if [[ -z ${ram_upgradeable} ]]; then
ram_upgradeable="No"
fi
echo "${ram_upgradeable}"
}
# Check if the current RAM meets specs