diff options
author | emaste <emaste@FreeBSD.org> | 2012-03-08 02:00:52 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2012-03-08 02:00:52 +0000 |
commit | 9ea8ec19d57bc4a3ea7fc8b9b8e35a189b09ba29 (patch) | |
tree | 104288542bda3d89e5cd8b2954b06fdb0216b7da /usr.sbin/pc-sysinstall | |
parent | 459dac9ae12ce812640844e10164607e4115645c (diff) | |
download | FreeBSD-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/pc-sysinstall')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/sys-mem.sh | 11 |
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 |