mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
972f6945b8
commit
f3e566163f
1 changed files with 9 additions and 2 deletions
|
|
@ -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 a new issue