44 lines
761 B
Plaintext
Executable File
44 lines
761 B
Plaintext
Executable File
#!/usr/sgitcl/bin/expect
|
|
|
|
# This script will change the maximum memory of the target machine.
|
|
# Written by Jason Hunter
|
|
|
|
source script.exp
|
|
|
|
if {$argc < 1} {
|
|
send_error "Usage: $argv0 \[4096 | 6144 | 8192\]\n"
|
|
exit
|
|
}
|
|
|
|
log_file -a maxpmem.log
|
|
|
|
set timeout -1
|
|
for {} {1} {} {
|
|
spawn cu -l /dev/ttyd2
|
|
expect {
|
|
"Connect failed: DEVICE LOCKED" {sleep 60}
|
|
"Connected" {break}
|
|
default {break}
|
|
}
|
|
}
|
|
set timeout 60
|
|
|
|
# if we're in PROM, stay there
|
|
# otherwise, get there
|
|
checkinprom
|
|
if {$inprom != 1} {
|
|
2u_root
|
|
u_root2p_mon
|
|
}
|
|
|
|
prom_cmd "unsetenv maxpmem"
|
|
prom_cmd "setenv -p maxpmem [lindex $argv 0]"
|
|
|
|
|
|
# Fix this ugly hack when I know more Expect :-)
|
|
proc prom_end promcmd {
|
|
send "$promcmd \r"
|
|
expect { }
|
|
}
|
|
prom_end "auto"
|