svn commit: r233218 - stable/9/usr.sbin/pc-sysinstall/backend-query

Josh Paetzel jpaetzel at FreeBSD.org
Mon Mar 19 22:52:20 UTC 2012


Author: jpaetzel
Date: Mon Mar 19 22:52:19 2012
New Revision: 233218
URL: http://svn.freebsd.org/changeset/base/233218

Log:
  MFC: 232681
  
  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>

Modified:
  stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
Directory Properties:
  stable/9/usr.sbin/pc-sysinstall/   (props changed)

Modified: stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
==============================================================================
--- stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh	Mon Mar 19 22:41:53 2012	(r233217)
+++ stable/9/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh	Mon Mar 19 22:52:19 2012	(r233218)
@@ -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


More information about the svn-src-stable-9 mailing list