mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
run: avoid buffering of output for expect
Due to commit "run: relax IP power plug recognition + serial EOF", when piping the serial command through 'tr', some characters might get buffered, thereby preventing some run scripts to finish correctly. This commit removes the 'tr' hack. Instead, to circumvent the 'expect' problem, which kills under special conditions spawned childs used to obtain serial line content, whenever EOF of the serial command is recognized during the boot phase, the child process gets re-spawned.
This commit is contained in:
parent
68abf0616a
commit
3367fd27e4
32
tool/run
32
tool/run
@ -887,24 +887,28 @@ proc spawn_serial { wait_for_re timeout_value kernel_msg } {
|
||||
jtag_load
|
||||
}
|
||||
|
||||
# pipe the serial output through 'tr', sometimes expect steps out due to
|
||||
# unexpected pipe behaviour and reports EOF although the pipe is still active
|
||||
eval spawn sh -c \"$serial_cmd | tr a a\"
|
||||
set serial_spawn_id $spawn_id
|
||||
|
||||
set timeout 210
|
||||
expect {
|
||||
$kernel_msg { break; }
|
||||
eof { puts stderr "Serial command process died unexpectedly"; incr retry -1; }
|
||||
timeout { puts stderr "Boot process timed out"; close; incr retry -1; }
|
||||
while {true} {
|
||||
eval spawn $serial_cmd
|
||||
set serial_spawn_id $spawn_id
|
||||
expect {
|
||||
$kernel_msg {
|
||||
wait_for_output $wait_for_re $timeout_value $serial_spawn_id;
|
||||
return;
|
||||
}
|
||||
eof { continue; }
|
||||
timeout {
|
||||
puts stderr "Boot process timed out";
|
||||
close;
|
||||
incr retry -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if { $retry == 0 } {
|
||||
puts stderr "Boot process failed 3 times in series. I give up!";
|
||||
exit -1;
|
||||
}
|
||||
|
||||
wait_for_output $wait_for_re $timeout_value $serial_spawn_id
|
||||
puts stderr "Boot process failed 3 times in series. I give up!";
|
||||
exit -1;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user