Work around broken BIOS memory reporting

Andrzej has a machine with 32GB of RAM, but only 16GB is reported by the
smbios.memory.enabled.  Thus, use the greater of hw.realmem and the smbios
value.

Reported by:	Andrzej Tobola <ato of iem pw edu pl>
This commit is contained in:
Ed Maste 2012-03-08 02:00:52 +00:00
parent 972f6945b8
commit f3e566163f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232681

View File

@ -26,7 +26,14 @@
# $FreeBSD$
if smbios_mem=$(kenv -q smbios.memory.enabled); then
expr $smbios_mem / 1024
smbios_mem=$(expr $smbios_mem / 1024)
else
expr $(sysctl -n hw.realmem) / 1048576
smbios_mem=0
fi
realmem=$(expr $(sysctl -n hw.realmem) / 1048576)
if [ $smbios_mem -gt $realmem ]; then
echo $smbios_mem
else
echo $realmem
fi