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:
parent
459dac9ae1
commit
9ea8ec19d5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user