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

@ -59,6 +59,11 @@ proc bin_dir { } {
set fiasco_serial_esc_arg "-serial_esc " set fiasco_serial_esc_arg "-serial_esc "
proc run_boot_string { } {
return "L4 Bootstrapper"
}
## ##
# Populate boot directory with binaries on fiasco # Populate boot directory with binaries on fiasco
# #

View File

@ -240,6 +240,11 @@ proc run_boot_dir_arm {binaries} {
} }
proc run_boot_string { } {
return "L4 Bootstrapper"
}
## ##
# Populate boot directory with binaries on fiasco.OC # Populate boot directory with binaries on fiasco.OC
# #

View File

@ -10,6 +10,11 @@ proc run_boot_dir_hook { } {
} }
proc run_boot_string { } {
return "kernel initialized"
}
## ##
# Populate boot directory with binaries on hw # Populate boot directory with binaries on hw
# #

View File

@ -24,6 +24,11 @@ proc nova_external { } {
} }
proc run_boot_string { } {
return "NOVA Microhypervisor"
}
## ##
# Populate directory with binaries on NOVA # Populate directory with binaries on NOVA
# #

View File

@ -101,6 +101,11 @@ set weaver_xml_template {
} }
proc run_boot_string { } {
return "OKL4 -"
}
## ##
# Populate directory with binaries on OKL4 # Populate directory with binaries on OKL4
# #

View File

@ -63,6 +63,11 @@ proc kernel_external { } {
} }
proc run_boot_string { } {
return "L4Ka::Pistachio -"
}
## ##
# Populdate boot directory with binaries on pistachio # Populdate boot directory with binaries on pistachio
# #

View File

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

View File

@ -489,6 +489,10 @@ proc wait_for_output { wait_for_re timeout_value running_spawn_id } {
## Fall-back implementations of all run module procedures ## Fall-back implementations of all run module procedures
## ##
##
# Dummy boot_string procedure
proc run_boot_string { } { return ""; }
## ##
# Dummy boot_dir maodule # Dummy boot_dir maodule
proc run_boot_dir { } { return true; } proc run_boot_dir { } { return true; }