mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-22 16:44:32 +01: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232681
@ -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