1
0
liminix/boot.expect

42 lines
933 B
Plaintext
Raw Normal View History

2024-05-26 16:32:29 +00:00
# This is for use with minicom, but needs you to configure it to
# use expect as its "Script program" instead of runscript. Try
# Ctrl+A O -> Filenames and paths -> D
fconfigure stderr -buffering none
fconfigure stdout -buffering none
proc waitprompt { } {
expect {
"BusyBox" { puts stderr "DONE\r"; exit 0 }
"READY" { puts stderr ";;; READY\r"; }
timeout { puts stderr ";;; timed out waiting after $line\r" }
}
}
proc sendline { line } {
send "$line; echo \$ready \r"
sleep 0.1
}
2024-05-26 16:32:29 +00:00
log_user 0
log_file -a -open stderr
2024-05-26 16:32:29 +00:00
set f [open "result/boot.scr"]
send "setenv ready REA\r"
sleep 0.1
send "setenv ready \${ready}DY\r"
sleep 0.1
set timeout 300
expect_before timeout abort
2024-05-26 16:32:29 +00:00
while {[gets $f line] >= 0} {
puts stderr ";;; next line $line\r"
puts stderr ";;; waiting for prompt\r"
puts stderr ";;; sending\r"
sendline $line
waitprompt
2024-05-26 16:32:29 +00:00
}
2024-05-26 16:32:29 +00:00
puts stderr "done\r\n"
close $f