2018-05-04 13:38:07 +00:00
|
|
|
if {[expr ![have_spec nova] || ![have_spec x86] || [have_include power_on/qemu] ]} {
|
|
|
|
puts "\n Run script is not supported on this platform. \n"; exit 0 }
|
|
|
|
|
|
|
|
proc wifi_ssid {} {
|
|
|
|
return "$::env(GENODE_WIFI_SSID)" }
|
2017-10-06 11:00:05 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
proc wifi_psk {} {
|
|
|
|
return "$::env(GENODE_WIFI_PSK)" }
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
proc platform_drv_priority {} { return { priority="-1"} }
|
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
append build_components { core }
|
|
|
|
append build_components { init }
|
|
|
|
append build_components { drivers/framebuffer }
|
2019-01-03 17:01:49 +00:00
|
|
|
append build_components { timer }
|
2018-05-04 13:38:07 +00:00
|
|
|
append build_components { server/nic_router }
|
|
|
|
append build_components { virtualbox }
|
|
|
|
append build_components { server/dynamic_rom }
|
|
|
|
append build_components { server/report_rom }
|
|
|
|
append build_components { drivers/wifi }
|
|
|
|
append build_components { server/log_terminal }
|
|
|
|
append build_components { lib/vfs/jitterentropy }
|
|
|
|
append build_components { drivers/input }
|
|
|
|
append build_components { drivers/rtc }
|
|
|
|
append build_components { drivers/usb }
|
|
|
|
append build_components { drivers/nic }
|
|
|
|
append build_components { server/input_merger }
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
append config {
|
|
|
|
|
2017-10-06 11:00:05 +00:00
|
|
|
<config prio_levels="4">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
2018-05-04 13:38:07 +00:00
|
|
|
<service name="LOG"/>
|
2017-10-06 11:00:05 +00:00
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2018-05-04 13:38:07 +00:00
|
|
|
<default caps="100"/>}
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
append_platform_drv_config
|
2018-05-04 13:38:07 +00:00
|
|
|
append config {
|
|
|
|
|
|
|
|
<start name="timer" priority="0">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
<start name="ps2_drv" priority="-1">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
2018-05-04 13:38:07 +00:00
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
<start name="fb_drv" priority="-1" caps="150">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Framebuffer"/></provides>
|
2018-05-04 13:38:07 +00:00
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
<start name="rtc_drv" priority="-1">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Rtc"/>
|
|
|
|
</provides>
|
2018-05-04 13:38:07 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="usb_drv" priority="-1" caps="200">
|
|
|
|
<resource name="RAM" quantum="20M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
|
|
|
<config uhci="yes" ehci="yes" xhci="yes"> <hid/> </config>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
<start name="nic_drv" priority="-1">
|
2019-04-24 13:09:49 +00:00
|
|
|
<binary name="ipxe_nic_drv"/>
|
2017-10-06 11:00:05 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
</start>
|
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="wifi_drv" priority="-1" caps="300">
|
|
|
|
<resource name="RAM" quantum="54M"/>
|
|
|
|
<provides> <service name="Nic"/> </provides>
|
|
|
|
<config ld_verbose="yes" verbose="yes" use_11n="no" connected_scan_interval="0">
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <rtc/> <null/>
|
|
|
|
<jitterentropy name="random"/>
|
|
|
|
<jitterentropy name="urandom"/>
|
|
|
|
</dir>
|
|
|
|
<dir name="config"> <ram/> </dir>
|
|
|
|
</vfs>
|
|
|
|
<libc stdout="/dev/null" stderr="/dev/log" rtc="/dev/rtc"/>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Rtc"> <any-child/> </service>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="wlan_configuration"> <child name="config_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="input_merger" priority="-2">
|
|
|
|
<resource name="RAM" quantum="1M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Input" />
|
|
|
|
</provides>
|
|
|
|
<config>
|
|
|
|
<input label="ps2" />
|
|
|
|
<input label="usb_hid" />
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Input" label="ps2"> <child name="ps2_drv" /> </service>
|
|
|
|
<service name="Input" label="usb_hid"> <child name="usb_drv" /> </service>
|
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="report_rom" priority="-2">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config/>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="config_rom" priority="-2">
|
|
|
|
<binary name="dynamic_rom"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/></provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="wlan_configuration">
|
|
|
|
<inline description="CONNECT">
|
|
|
|
<selected_network ssid="} [wifi_ssid] {"
|
|
|
|
protection="WPA-PSK"
|
|
|
|
psk="} [wifi_psk] {"/>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="600000"/> <!-- 10 minutes -->
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="dynamic_rom" priority="-2">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="router1.config">
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config verbose_domain_state="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose="no"
|
|
|
|
dhcp_discover_timeout_sec="1">
|
|
|
|
|
|
|
|
<policy label_prefix="vbox" domain="downlink"/>
|
2018-06-05 16:31:40 +00:00
|
|
|
<uplink domain="uplink" />
|
2018-05-04 13:38:07 +00:00
|
|
|
|
|
|
|
<domain name="uplink" label="wifi">
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="999"
|
|
|
|
udp-ports="999"
|
|
|
|
icmp-ids="999"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.1.79/24">
|
|
|
|
<dhcp-server ip_first="10.0.1.80"
|
|
|
|
ip_last="10.0.1.100"
|
|
|
|
ip_lease_time_sec="20"
|
|
|
|
dns_server="1.1.1.1"/>
|
|
|
|
<tcp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</tcp>
|
|
|
|
<udp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="15000"/>
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config verbose_domain_state="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose="no"
|
|
|
|
dhcp_discover_timeout_sec="1">
|
|
|
|
|
|
|
|
<policy label_prefix="vbox" domain="downlink"/>
|
|
|
|
|
|
|
|
<domain name="uplink" label="wifi">
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="999"
|
|
|
|
udp-ports="999"
|
|
|
|
icmp-ids="999"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.1.79/24">
|
|
|
|
<dhcp-server ip_first="10.0.1.80"
|
|
|
|
ip_last="10.0.1.100"
|
|
|
|
ip_lease_time_sec="20"
|
|
|
|
dns_server="1.1.1.1"/>
|
|
|
|
<tcp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</tcp>
|
|
|
|
<udp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="15000"/>
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config verbose_domain_state="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose="no"
|
|
|
|
dhcp_discover_timeout_sec="1">
|
|
|
|
|
|
|
|
<policy label_prefix="vbox" domain="downlink"/>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.1.79/24">
|
|
|
|
<dhcp-server ip_first="10.0.1.80"
|
|
|
|
ip_last="10.0.1.100"
|
|
|
|
ip_lease_time_sec="20"
|
|
|
|
dns_server="1.1.1.1"/>
|
|
|
|
<tcp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</tcp>
|
|
|
|
<udp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="15000"/>
|
|
|
|
</rom>
|
|
|
|
<rom name="router2.config">
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config verbose_domain_state="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose="no">
|
|
|
|
|
|
|
|
<policy label_prefix="vbox" domain="downlink"/>
|
|
|
|
|
|
|
|
<domain name="uplink">
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="999"
|
|
|
|
udp-ports="999"
|
|
|
|
icmp-ids="999"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.1.79/24">
|
|
|
|
<dhcp-server ip_first="10.0.1.80"
|
|
|
|
ip_last="10.0.1.100"
|
|
|
|
ip_lease_time_sec="20"
|
|
|
|
dns_server="1.1.1.1"/>
|
|
|
|
<tcp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</tcp>
|
|
|
|
<udp dst="0.0.0.0/0">
|
|
|
|
<permit-any domain="uplink"/>
|
|
|
|
</udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="3600000"/>
|
|
|
|
</rom>
|
2017-10-06 11:00:05 +00:00
|
|
|
</config>
|
2018-05-04 13:38:07 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="router1" caps="200" priority="-2">
|
|
|
|
<binary name="nic_router"/>
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
2017-10-06 11:00:05 +00:00
|
|
|
<route>
|
2018-05-04 13:38:07 +00:00
|
|
|
<service name="Nic" label="wifi">
|
|
|
|
<child name="wifi_drv"/>
|
|
|
|
</service>
|
|
|
|
<service name="Nic" label="nic">
|
|
|
|
<child name="nic_drv"/>
|
|
|
|
</service>
|
|
|
|
<service name="ROM" label="config">
|
|
|
|
<child name="dynamic_rom" label="router1.config"/>
|
|
|
|
</service>
|
2017-10-06 11:00:05 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2017-10-16 10:49:03 +00:00
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="router2" caps="200" priority="-2">
|
2017-10-16 10:49:03 +00:00
|
|
|
<binary name="nic_router"/>
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<route>
|
2018-05-04 13:38:07 +00:00
|
|
|
<service name="ROM" label="config">
|
|
|
|
<child name="dynamic_rom" label="router2.config"/>
|
|
|
|
</service>
|
2017-10-16 10:49:03 +00:00
|
|
|
<service name="Nic"> <child name="router1"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2017-10-06 11:00:05 +00:00
|
|
|
|
|
|
|
<start name="log_terminal" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Terminal"/>
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
<start name="vbox" priority="-2" caps="500">
|
|
|
|
<binary name="virtualbox-nova"/>
|
2017-10-06 11:00:05 +00:00
|
|
|
<resource name="RAM" quantum="2G"/>
|
|
|
|
<config vbox_file="virtualbox_nic_router.vbox" vm_name="TestVM">
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
|
|
|
<vfs>
|
2018-05-04 13:38:07 +00:00
|
|
|
<dir name="dev"> <log/> <rtc/> </dir>
|
|
|
|
<dir name="dev"> <terminal/> </dir>
|
2017-10-06 11:00:05 +00:00
|
|
|
<rom name="virtualbox_nic_router.vbox" />
|
|
|
|
<rom name="test.iso" />
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
2018-05-04 13:38:07 +00:00
|
|
|
<service name="Input"><child name="input_merger" /></service>
|
2017-10-16 10:49:03 +00:00
|
|
|
<service name="Nic"> <child name="router2"/> </service>
|
2018-05-04 13:38:07 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2017-10-06 11:00:05 +00:00
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
exec cp ${genode_dir}/repos/ports/run/virtualbox_nic_router.vbox bin/.
|
|
|
|
|
2018-05-04 13:38:07 +00:00
|
|
|
append boot_modules { virtualbox-nova }
|
|
|
|
append boot_modules { iwlwifi-6000-4.ucode }
|
|
|
|
append boot_modules { iwlwifi-6000g2a-6.ucode }
|
|
|
|
append boot_modules { iwlwifi-6000g2b-6.ucode }
|
|
|
|
append boot_modules { iwlwifi-7260-16.ucode }
|
|
|
|
append boot_modules { iwlwifi-7265-16.ucode }
|
|
|
|
append boot_modules { iwlwifi-7265D-16.ucode }
|
|
|
|
append boot_modules { iwlwifi-8000C-16.ucode }
|
|
|
|
append boot_modules { report_rom }
|
|
|
|
append boot_modules { vfs_jitterentropy.lib.so }
|
|
|
|
append boot_modules { libcrypto.lib.so }
|
|
|
|
append boot_modules { libssl.lib.so }
|
|
|
|
append boot_modules { wpa_driver_nl80211.lib.so }
|
|
|
|
append boot_modules { wpa_supplicant.lib.so }
|
|
|
|
append boot_modules { wifi.lib.so }
|
|
|
|
append boot_modules { wifi_drv }
|
|
|
|
append boot_modules { core }
|
|
|
|
append boot_modules { nic_router }
|
|
|
|
append boot_modules { ld.lib.so }
|
|
|
|
append boot_modules { init }
|
|
|
|
append boot_modules { timer }
|
|
|
|
append boot_modules { test.iso }
|
|
|
|
append boot_modules { virtualbox_nic_router.vbox }
|
|
|
|
append boot_modules { ld.lib.so }
|
|
|
|
append boot_modules { libc.lib.so }
|
|
|
|
append boot_modules { libm.lib.so }
|
|
|
|
append boot_modules { libc_pipe.lib.so }
|
|
|
|
append boot_modules { libc_terminal.lib.so }
|
|
|
|
append boot_modules { libiconv.lib.so }
|
|
|
|
append boot_modules { stdcxx.lib.so }
|
|
|
|
append boot_modules { qemu-usb.lib.so }
|
|
|
|
append boot_modules { dynamic_rom }
|
|
|
|
append boot_modules { ps2_drv }
|
|
|
|
append boot_modules { fb_drv }
|
|
|
|
append boot_modules { rtc_drv }
|
|
|
|
append boot_modules { usb_drv }
|
|
|
|
append boot_modules { vfs.lib.so }
|
2019-04-24 13:09:49 +00:00
|
|
|
append boot_modules { ipxe_nic_drv }
|
2018-05-04 13:38:07 +00:00
|
|
|
append boot_modules { input_merger }
|
|
|
|
append boot_modules { log_terminal }
|
2017-10-06 11:00:05 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
run_genode_until forever
|