assert_spec x86
if {(![have_spec nova] && ![have_spec foc])} {
puts "Platform is unsupported."
exit 0
}
if {[have_include "power_on/qemu"]} {
puts "\nRun script does not support Qemu.\n"
exit 0
}
if {[expr !$use_rumpfs && $use_vms > 1] } {
puts "\nConfiguration bug - have only one raw block partition.\n"
exit 1
}
set vdi_image "${flavor}.vdi"
set raw_image "${flavor}.vmdk"
set vbox_file "vm_${flavor}.vbox"
set overlay_image "overlay_${flavor}.vdi"
if {[info exists flavor_extension]} {
set vbox_file "vm_${flavor}${flavor_extension}.vbox"
}
if {![info exists use_webcam]} {
set use_webcam 0
}
if {![info exists webcam_vflip]} {
set webcam_vflip true
if {$use_webcam} {
if {[string match "win*" $flavor] } {
set webcam_vflip false
}
}
}
set build_components {
server/nic_router
server/event_filter
drivers/nic/pc
drivers/audio
server/report_rom
server/dynamic_rom
}
set boot_modules {
nic_router
event_filter
pc_nic_drv
pci_audio_drv
report_rom
dynamic_rom
}
set virtualbox5_binary "virtualbox5"
if {$use_vbox5_nova} { set virtualbox5_binary "virtualbox5-nova" }
set config_of_app {
}
append config_of_app {
}
append_if [expr $use_cpu_load] config_of_app {
}
append config_of_app {
}
if { $use_vms > 1 } {
append config_of_app {
}
}
append config_of_app {
}
append_if [expr !$use_rumpfs] config_of_app {
}
append config_of_app {
}
for { set i 1} { $i <= $use_vms } { incr i} {
append config_of_app "
"
append_if [expr $use_vbox5] config_of_app "
"
append config_of_app {
}
if { $use_vms eq 1 } {
append config_of_app "
"
} else {
append config_of_app "
"
}
append_if [expr $use_webcam] config_of_app {
}
append config_of_app {
}
append_if [expr $use_serial] config_of_app { }
append_if [expr !$use_rumpfs] config_of_app {
}
append config_of_app {
}
append_if [expr $use_ram_fs] config_of_app {
}
append config_of_app "
"
append_if [expr !$use_rumpfs] config_of_app "
"
append_if [expr $use_rumpfs || $use_ram_fs] config_of_app {
}
append config_of_app {
}
append_if [expr ($use_vms > 1)] config_of_app {
}
append_if [expr $use_ram_fs] config_of_app {
}
append_if [expr $use_rumpfs] config_of_app {
}
append_if [expr !$use_rumpfs] config_of_app {
}
append config_of_app {
}
}
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
# copy vbox configuration to bin directory
exec cp ${genode_dir}/repos/ports/run/${vbox_file} bin/.
if {[info exists use_vcpus]} {
exec sed -i "s/CPU count=\".*\"/CPU count=\"${use_vcpus}\"/g" bin/${vbox_file}
}
if {!$use_rumpfs} {
exec cp ${genode_dir}/repos/ports/run/${raw_image} bin/.
}
append boot_modules " ${vbox_file} "
append_if [expr !$use_rumpfs] boot_modules " ${raw_image} "
build_boot_image $boot_modules
set wait_timeout 70
if {[have_spec foc]} { set wait_timeout 120 }
if {![info exists use_check_result]} {
set use_check_result 0
}
if {$use_check_result} {
run_genode_until {\[init -\> vbox.*].*Guest Additions capability report:.*seamless: no, hostWindowMapping: no, graphics: no} $wait_timeout
# run_genode_until forever 0 [output_spawn_id]
if {$use_rumpfs} {
set wait_timeout 170
for { set i 1 } { $i <= $use_vms } { incr i } {
if { [string match "ubuntu*" $flavor] || [string match "win10*" $flavor] } {
run_genode_until {\[init -\> vbox.*].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: no} $wait_timeout [output_spawn_id]
} else {
run_genode_until {\[init -\> vbox.*].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} $wait_timeout [output_spawn_id]
}
}
} else {
run_genode_until {\[init\] child "vbox1" exited with exit value 0} 60 [output_spawn_id]
# give block driver bit time to write data to disk
sleep 5
}
# cleanup bin directory - remove vbox file
exec rm bin/${vbox_file}
if {!$use_rumpfs} {
exec rm bin/${raw_image}
}
}