Added support for Mac OS X 10.4.11

This commit is contained in:
Aaron Blakely 2022-07-04 23:36:47 -05:00
parent ccd5d9f526
commit 993cfbc627

View file

@ -1260,7 +1260,14 @@ get_model() {
if [[ $(kextstat | grep -F -e "FakeSMC" -e "VirtualSMC") != "" ]]; then
model="Hackintosh (SMBIOS: $(sysctl -n hw.model))"
else
model=$(sysctl -n hw.model)
if [[ $osx_version =~ "10.4" ]]; then
model="$(system_profiler SPHardwareDataType | grep Machine\ Name\:)"
model=${model/Machine\ Name\:/}
model="$model ($(sysctl -n hw.model))"
else
model=$(sysctl -n hw.model)
fi
fi
;;
@ -2282,7 +2289,12 @@ get_cpu() {
;;
"Mac OS X"|"macOS")
cpu="$(sysctl -n machdep.cpu.brand_string)"
if [[ $osx_version =~ "10.4" ]]; then
cpu="$(system_profiler SPHardwareDataType | grep CPU\ Type)"
cpu="${cpu/CPU\ Type\:/}"
else
cpu="$(sysctl -n machdep.cpu.brand_string)"
fi
# Get CPU cores.
case $cpu_cores in
@ -2704,13 +2716,25 @@ get_memory() {
;;
"Mac OS X" | "macOS" | "iPhone OS")
hw_pagesize="$(sysctl -n hw.pagesize)"
mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
pages_compressed="${pages_compressed:-0}"
mem_used="$(((${pages_app} + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
if [[ $osx_version =~ "10.4" ]]; then
mem_total="$(system_profiler SPHardwareDataType | grep Memory:)"
mem_total="${mem_total/Memory\: /}"
mem_total="${mem_total/ MB/}"
mem_used="$(vm_stat | grep Pages\ active\:)"
mem_used="${mem_used/Pages active\: /}"
mem_used="${mem_used/\./}"
mem_used=$((mem_used * 4096 / 1048576))
else
hw_pagesize="$(sysctl -n hw.pagesize)"
mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
pages_compressed="${pages_compressed:-0}"
mem_used="$(((${pages_app} + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
fi
;;
"BSD" | "MINIX")