Merge 1188149f32
into 71f14ea053
This commit is contained in:
commit
70401edbce
1 changed files with 8 additions and 2 deletions
|
@ -219,14 +219,14 @@ sub os_setup {
|
||||||
} elsif ($os =~ /Darwin/) {
|
} elsif ($os =~ /Darwin/) {
|
||||||
$physical_memory = `sysctl -n hw.memsize` or memerror;
|
$physical_memory = `sysctl -n hw.memsize` or memerror;
|
||||||
$swap_memory = `sysctl -n vm.swapusage | awk '{print \$3}' | sed 's/\..*\$//'` or memerror;
|
$swap_memory = `sysctl -n vm.swapusage | awk '{print \$3}' | sed 's/\..*\$//'` or memerror;
|
||||||
} elsif ($os =~ /NetBSD|OpenBSD/) {
|
} elsif ($os =~ /NetBSD|OpenBSD|FreeBSD/) {
|
||||||
$physical_memory = `sysctl -n hw.physmem` or memerror;
|
$physical_memory = `sysctl -n hw.physmem` or memerror;
|
||||||
if ($physical_memory < 0) {
|
if ($physical_memory < 0) {
|
||||||
$physical_memory = `sysctl -n hw.physmem64` or memerror;
|
$physical_memory = `sysctl -n hw.physmem64` or memerror;
|
||||||
}
|
}
|
||||||
$swap_memory = `swapctl -l | grep '^/' | awk '{ s+= \$2 } END { print s }'` or memerror;
|
$swap_memory = `swapctl -l | grep '^/' | awk '{ s+= \$2 } END { print s }'` or memerror;
|
||||||
} elsif ($os =~ /BSD/) {
|
} elsif ($os =~ /BSD/) {
|
||||||
$physical_memory = `sysctl -n hw.realmem`;
|
$physical_memory = `sysctl -n hw.realmem` or memerror;
|
||||||
$swap_memory = `swapinfo | grep '^/' | awk '{ s+= \$2 } END { print s }'`;
|
$swap_memory = `swapinfo | grep '^/' | awk '{ s+= \$2 } END { print s }'`;
|
||||||
} elsif ($os =~ /SunOS/) {
|
} elsif ($os =~ /SunOS/) {
|
||||||
$physical_memory = `/usr/sbin/prtconf | grep Memory | cut -f 3 -d ' '` or memerror;
|
$physical_memory = `/usr/sbin/prtconf | grep Memory | cut -f 3 -d ' '` or memerror;
|
||||||
|
@ -473,6 +473,12 @@ sub check_architecture {
|
||||||
} elsif (`uname` =~ /AIX/ && `bootinfo -K` =~ /64/) {
|
} elsif (`uname` =~ /AIX/ && `bootinfo -K` =~ /64/) {
|
||||||
$arch = 64;
|
$arch = 64;
|
||||||
goodprint "Operating on 64-bit architecture\n";
|
goodprint "Operating on 64-bit architecture\n";
|
||||||
|
} elsif (`uname` =~ /NetBSD|OpenBSD/ && `sysctl -b hw.machine` =~ /64/) {
|
||||||
|
$arch = 64;
|
||||||
|
goodprint "Operating on 64-bit architecture\n";
|
||||||
|
} elsif (`uname` =~ /FreeBSD/ && `sysctl -b hw.machine_arch` =~ /64/) {
|
||||||
|
$arch = 64;
|
||||||
|
goodprint "Operating on 64-bit architecture\n";
|
||||||
} else {
|
} else {
|
||||||
$arch = 32;
|
$arch = 32;
|
||||||
if ($physical_memory > 2147483648) {
|
if ($physical_memory > 2147483648) {
|
||||||
|
|
Loading…
Reference in a new issue