[daip] install.pl - more reliable memory detection for solaris

Vincent McIntyre Vince.McIntyre at atnf.csiro.au
Tue May 2 19:01:53 EDT 2006


Hi,

on Solaris, install.pl greps through the dmesg output to find the system
memory. This is unreliable, and I think it is because for systems with 
long uptimes, the memory size will scroll out of the dmesg buffer.

'prtdiag' is more likely to give a reliable answer. See patch attached.

Cheers
Vincent McIntyre                                vmcintyr at atnf.csiro.au
Australia Telescope National Facility, CSIRO     voice:+61-2-9372-4643
PO Box 76, Epping, NSW 1710, AUSTRALIA             fax:+61-2-9372-4442
-------------- next part --------------
--- install.pl	2006-05-02 11:55:14.000000000 +1000
+++ 31DEC05/SYSTEM/UNIX/PERL/install.pl	2006-05-03 08:58:33.000000000 +1000
@@ -1891,10 +1891,10 @@
 }
 if (!$mem) {
                                         # Solaris
-    open(FOO, "dmesg 2>/dev/null | grep ^mem|");
+    open(FOO, "/usr/sbin/prtdiag 2>/dev/null | grep ^Mem|");
     while (<FOO>) {
-        if (/mem = ([0-9]+)K/) {
-            $mem = $1;
+        if (/memory size: *([0-9]+) *megabytes/i) {
+            $mem = $1 * 1024;
             last;
         }
     }


More information about the Daip mailing list