summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2011-11-12 19:02:55 +0000
committeremaste <emaste@FreeBSD.org>2011-11-12 19:02:55 +0000
commit7b2871f94782df9d29d66a36ee22e9332c343868 (patch)
tree8d2ad81f3c25fcb8426aa5fd9cd34e93ca792c2a
parent9317b122766124f01cf13a5a45e21e4f95f60cfc (diff)
downloadFreeBSD-src-7b2871f94782df9d29d66a36ee22e9332c343868.zip
FreeBSD-src-7b2871f94782df9d29d66a36ee22e9332c343868.tar.gz
Report the amount of memory from smbios data if provided.
This should get the correct memory size even if a 32-bit image is running on a machine with > 4GB of memory. This can be useful is using a 32-bit installer on a machine which will eventually run a 64-bit image. Reviewed by: kmoore
-rwxr-xr-xusr.sbin/pc-sysinstall/backend-query/sys-mem.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh b/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
index bc0e3a2..3109aa1 100755
--- a/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
+++ b/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
@@ -25,4 +25,8 @@
#
# $FreeBSD$
-expr $(sysctl -n hw.realmem) / 1048576
+if smbios_mem=$(kenv -q smbios.memory.enabled); then
+ expr $smbios_mem / 1024
+else
+ expr $(sysctl -n hw.realmem) / 1048576
+fi
OpenPOWER on IntegriCloud