summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-03-08 02:00:52 +0000
committeremaste <emaste@FreeBSD.org>2012-03-08 02:00:52 +0000
commit9ea8ec19d57bc4a3ea7fc8b9b8e35a189b09ba29 (patch)
tree104288542bda3d89e5cd8b2954b06fdb0216b7da /usr.sbin
parent459dac9ae12ce812640844e10164607e4115645c (diff)
downloadFreeBSD-src-9ea8ec19d57bc4a3ea7fc8b9b8e35a189b09ba29.zip
FreeBSD-src-9ea8ec19d57bc4a3ea7fc8b9b8e35a189b09ba29.tar.gz
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>
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/pc-sysinstall/backend-query/sys-mem.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh b/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
index 3109aa1..a726370 100755
--- a/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
+++ b/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
@@ -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
OpenPOWER on IntegriCloud