2014-09-10 08:11:25 +00:00
|
|
|
# Tested for nova.
|
2014-05-28 12:48:33 +00:00
|
|
|
assert_spec nova
|
2014-03-10 11:19:52 +00:00
|
|
|
|
2015-01-08 21:09:08 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
2014-09-23 11:01:47 +00:00
|
|
|
puts "\nRun script does not support Qemu.\n"
|
2015-01-08 21:09:08 +00:00
|
|
|
exit 0
|
2014-02-12 12:53:42 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 10:59:31 +00:00
|
|
|
set vdi_image "${flavor}.vdi"
|
|
|
|
set vbox_file "vm_${flavor}.vbox"
|
|
|
|
set overlay_image "overlay_${flavor}.vdi"
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2015-03-30 16:00:43 +00:00
|
|
|
set build_components {
|
|
|
|
server/input_merger
|
|
|
|
drivers/nic
|
2015-06-03 12:39:01 +00:00
|
|
|
drivers/audio
|
2015-03-30 16:00:43 +00:00
|
|
|
server/nitpicker
|
|
|
|
app/vbox_pointer
|
|
|
|
server/nit_fb
|
|
|
|
server/report_rom
|
|
|
|
}
|
|
|
|
|
|
|
|
set boot_modules {
|
|
|
|
input_merger
|
|
|
|
nic_drv
|
2015-06-03 12:39:01 +00:00
|
|
|
audio_drv
|
2015-03-30 16:00:43 +00:00
|
|
|
nitpicker
|
|
|
|
vbox_pointer
|
|
|
|
nit_fb
|
|
|
|
report_rom
|
|
|
|
}
|
2014-05-28 12:48:33 +00:00
|
|
|
|
2014-02-12 12:53:42 +00:00
|
|
|
set config_of_app {
|
2015-03-30 16:00:43 +00:00
|
|
|
|
|
|
|
<start name="input_merger">
|
|
|
|
<resource name="RAM" quantum="1M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Input" />
|
|
|
|
</provides>
|
|
|
|
<config>}
|
|
|
|
append_if [expr $use_ps2] config_of_app {
|
|
|
|
<input label="ps2" /> }
|
|
|
|
append_if [expr $use_usb] config_of_app {
|
|
|
|
<input label="usb_hid" />}
|
|
|
|
append config_of_app {
|
|
|
|
</config>
|
|
|
|
<route> }
|
|
|
|
append_if [expr $use_ps2] config_of_app {
|
|
|
|
<service name="Input">
|
|
|
|
<if-arg key="label" value="ps2" /> <child name="ps2_drv" />
|
|
|
|
</service> }
|
|
|
|
append_if [expr $use_usb] config_of_app {
|
|
|
|
<service name="Input">
|
|
|
|
<if-arg key="label" value="usb_hid" /> <child name="usb_drv" />
|
|
|
|
</service> }
|
|
|
|
append config_of_app {
|
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Note: to get network access in the VM, the virtual network adapter
|
|
|
|
needs to be enabled in the .vbox file (disabled by default)
|
|
|
|
-->
|
|
|
|
<start name="nic_drv" priority="-1">
|
|
|
|
<resource name="RAM" quantum="8M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Nic" />
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
|
2015-06-03 12:39:01 +00:00
|
|
|
<!--
|
|
|
|
Note: to use audio in the VM, the virtual audio adapter
|
|
|
|
needs to be enabled in the .vbox file (disabled by default).
|
|
|
|
(Recording is configured to use the external mic.)
|
|
|
|
-->
|
2016-04-21 12:24:16 +00:00
|
|
|
<start name="audio_drv" priority="-1">
|
2015-11-16 13:04:04 +00:00
|
|
|
<resource name="RAM" quantum="9M"/>
|
2015-06-03 12:39:01 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Audio_out"/>
|
|
|
|
<service name="Audio_in"/>
|
|
|
|
</provides>
|
|
|
|
<config recording="yes">
|
|
|
|
<mixer field="outputs.master" value="255"/>
|
|
|
|
<mixer field="record.adc-0:1_source" value="sel2"/>
|
|
|
|
<mixer field="record.adc-0:1" value="255"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2015-03-30 16:00:43 +00:00
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config>
|
|
|
|
<rom>
|
2016-01-21 16:03:31 +00:00
|
|
|
<policy label="vbox_pointer -> hover" report="nitpicker -> hover"/>
|
|
|
|
<policy label="vbox_pointer -> xray" report="nitpicker -> xray"/>
|
|
|
|
<policy label="vbox_pointer -> shape" report="vbox -> shape"/>
|
|
|
|
<policy label="usb_report_filter -> devices" report="usb_drv -> devices"/>
|
|
|
|
<policy label="usb_report_filter -> usb_drv_config" report="usb_drv -> config"/>
|
|
|
|
<policy label="vbox -> usb_devices" report="usb_report_filter -> usb_devices"/>
|
2015-03-30 16:00:43 +00:00
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nitpicker" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="Nitpicker"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="Framebuffer"> <child name="fb_drv" /> </service>
|
|
|
|
<service name="Input"> <child name="input_merger" /> </service>
|
2015-05-26 18:12:17 +00:00
|
|
|
<service name="Report"> <child name="report_rom" /> </service>
|
2015-03-30 16:00:43 +00:00
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
<config>
|
|
|
|
<report focus="yes" hover="yes" xray="yes" />
|
|
|
|
|
2015-11-18 13:35:31 +00:00
|
|
|
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
|
|
|
|
<domain name="vbox" layer="2" content="client" focus="click" hover="always" />
|
|
|
|
<domain name="" layer="2" content="client" focus="click" hover="always" />
|
2015-03-30 16:00:43 +00:00
|
|
|
|
|
|
|
<policy label="vbox_pointer" domain="pointer"/>
|
|
|
|
<policy label="nit_fb" domain="vbox"/>
|
2015-11-18 11:17:32 +00:00
|
|
|
<policy domain=""/>
|
2015-03-30 16:00:43 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="vbox_pointer" priority="-1">
|
2016-04-15 13:19:22 +00:00
|
|
|
<resource name="RAM" quantum="1200K"/>
|
2015-12-08 12:09:02 +00:00
|
|
|
<config>
|
|
|
|
<policy label="nit_fb" rom="shape"/>
|
|
|
|
</config>
|
2015-03-30 16:00:43 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
|
|
|
<service name="ROM"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nit_fb" priority="-1">
|
|
|
|
<resource name="RAM" quantum="8M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Framebuffer" />
|
|
|
|
<service name="Input" />
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="vbox" priority="-2">
|
2014-02-12 12:53:42 +00:00
|
|
|
<binary name="virtualbox" />
|
2015-02-19 10:59:31 +00:00
|
|
|
<resource name="RAM" quantum="1280M"/>}
|
|
|
|
append config_of_app "
|
2015-09-18 14:15:43 +00:00
|
|
|
<config ld_verbose=\"yes\" vbox_file=\"${vbox_file}\" vm_name=\"${flavor}\">"
|
2015-02-19 10:59:31 +00:00
|
|
|
append config_of_app {
|
2015-01-13 16:38:04 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc">
|
2015-02-19 10:59:31 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <rtc/> </dir>}
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
append_if [expr $use_ram_fs] config_of_app {
|
|
|
|
<dir name="ram"> <fs label="from_ram_fs"/> </dir>}
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2015-02-19 10:59:31 +00:00
|
|
|
append config_of_app "
|
|
|
|
<rom name=\"${vbox_file}\"/>"
|
2014-02-12 12:53:42 +00:00
|
|
|
append config_of_app {
|
2014-09-23 11:01:47 +00:00
|
|
|
<fs />
|
2014-04-14 09:57:22 +00:00
|
|
|
</vfs>
|
|
|
|
</libc>
|
2014-02-12 12:53:42 +00:00
|
|
|
</config>
|
2014-09-23 11:01:47 +00:00
|
|
|
<route>}
|
|
|
|
|
|
|
|
append_if [expr $use_ram_fs] config_of_app {
|
|
|
|
<service name="File_system">
|
|
|
|
<if-arg key="label" value="from_ram_fs" />
|
|
|
|
<child name="ram_fs"/>
|
|
|
|
</service>}
|
|
|
|
|
|
|
|
append config_of_app {
|
2014-02-12 12:53:42 +00:00
|
|
|
<service name="File_system"> <child name="rump_fs"/> </service>
|
2015-03-30 16:00:43 +00:00
|
|
|
<service name="Framebuffer"> <child name="nit_fb" /> </service>
|
|
|
|
<service name="Input"> <child name="nit_fb" /> </service>
|
2015-05-26 18:12:17 +00:00
|
|
|
<service name="Report"><child name="report_rom" /></service>
|
2015-05-08 17:19:05 +00:00
|
|
|
<service name="ROM">
|
|
|
|
<if-arg key="label" value="usb_devices"/> <child name="report_rom"/>
|
|
|
|
</service>
|
2014-02-12 12:53:42 +00:00
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
}
|
|
|
|
|
2014-05-07 09:48:19 +00:00
|
|
|
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
# copy vbox configuration to bin directory
|
2015-02-19 10:59:31 +00:00
|
|
|
exec cp ${genode_dir}/repos/ports/run/${vbox_file} bin/.
|
|
|
|
|
|
|
|
append boot_modules " ${vbox_file} "
|
2014-09-23 11:01:47 +00:00
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2015-01-15 09:55:01 +00:00
|
|
|
run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: no, hostWindowMapping: no, graphics: no} 70
|
2015-01-08 21:09:08 +00:00
|
|
|
run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 170 [output_spawn_id]
|
2014-02-12 12:53:42 +00:00
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
# cleanup bin directory - remove vbox file
|
2015-02-19 10:59:31 +00:00
|
|
|
exec rm bin/${vbox_file}
|