Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2012 02:00:53 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232681 - head/usr.sbin/pc-sysinstall/backend-query
Message-ID:  <201203080200.q2820rQP020447@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Mar  8 02:00:52 2012
New Revision: 232681
URL: http://svn.freebsd.org/changeset/base/232681

Log:
  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:
  head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh	Thu Mar  8 01:48:44 2012	(r232680)
+++ head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh	Thu Mar  8 02:00:52 2012	(r232681)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203080200.q2820rQP020447>