From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 22:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6AC1065670; Mon, 19 Mar 2012 22:52:19 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7EA28FC14; Mon, 19 Mar 2012 22:52:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2JMqJcI090303; Mon, 19 Mar 2012 22:52:19 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2JMqJ30090301; Mon, 19 Mar 2012 22:52:19 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203192252.q2JMqJ30090301@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Mar 2012 22:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233218 - stable/9/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 22:52:20 -0000 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 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