# Tested for nova and muen.
if {(![have_spec nova] && ![have_spec muen])} {
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"
}
set build_components {
server/input_merger
drivers/nic
drivers/audio
server/nitpicker
app/pointer
server/nit_fb
server/report_rom
server/dynamic_rom
}
set boot_modules {
input_merger
nic_drv
audio_drv
nitpicker
pointer
nit_fb
report_rom
dynamic_rom
}
set virtualbox_binary "virtualbox-rem"
set virtualbox5_binary "virtualbox5-rem"
if {[have_spec muen]} { set virtualbox_binary "virtualbox-muen" }
if {[have_spec nova]} {
set virtualbox_binary "virtualbox-nova"
set virtualbox5_binary "virtualbox5-nova"
}
set config_of_app {
}
append_if [expr $use_ps2] config_of_app {
}
append_if [expr $use_usb] config_of_app {
}
append config_of_app {
}
append_if [expr $use_ps2] config_of_app {
}
append_if [expr $use_usb] config_of_app {
}
append config_of_app {
}
append config_of_app {
}
append_if [expr $use_cpu_load] config_of_app {
}
append config_of_app {
}
append config_of_app {
}
for { set i 1} { $i <= $use_vms } { incr i} {
append config_of_app "
"
append config_of_app {
}
append config_of_app "
"
append config_of_app {
}
append config_of_app "
"
append config_of_app {
}
}
append config_of_app {
}
for { set i 1} { $i <= $use_vms } { incr i} {
append config_of_app "
"
append config_of_app {
}
if { $use_vms > 1 } {
append config_of_app "
"
} else {
append config_of_app {
}
}
append config_of_app {
}
append_if [expr !$use_rumpfs] config_of_app {
}
append config_of_app {
}
}
append config_of_app {
}
for { set i 1} { $i <= $use_vms } { incr i} {
append config_of_app "
"
append_if [expr $use_vbox4] 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 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_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 "
shape\"/>
"
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 {!$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
run_genode_until {\[init -\> vbox.*].*Guest Additions capability report:.*seamless: no, hostWindowMapping: no, graphics: no} 70
# 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}
}