run: capture kernel msg to detect boot errors

Handle boot errors like the old run tool did by checking a kernel
specific string on boot up and start the run script timeout afterwards.

Issue #1395.
This commit is contained in:
Josef Söntgen
2015-02-06 18:02:55 +01:00
committed by Christian Helmuth
parent 2b69310adf
commit 7617833365
8 changed files with 53 additions and 15 deletions

View File

@@ -22,21 +22,25 @@ proc log_serial_cmd { } {
proc run_log { wait_for_re timeout_value } {
global output_spawn_id
set timeout 60
while {true} {
eval spawn [log_serial_cmd]
set output_spawn_id $spawn_id
expect {
"Genode \[0-9]\[0-9]\.\[0-9]\[0-9]" {
wait_for_output $wait_for_re $timeout_value $output_spawn_id;
return true;
}
eof { continue; }
timeout {
puts stderr "Boot process timed out";
close;
return false;
}
set kernel_msg [run_boot_string]
eval spawn [log_serial_cmd]
set output_spawn_id $spawn_id
set timeout 210
expect {
$kernel_msg { }
eof {
puts stderr "Serial command process died unexpectedly"
return false
}
timeout {
puts stderr "Boot process timed out"
close
return false
}
}
wait_for_output $wait_for_re $timeout_value $output_spawn_id
return true
}