genode/repos/dde_linux/run/nic_router_uplinks.run

191 lines
5.9 KiB
Plaintext
Raw Normal View History

if {[expr ![have_spec nova] && ![have_spec sel4] && ![have_spec hw] && ![have_spec foc] || ![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_SSID2)" }
proc wifi_psk {} {
return "$::env(GENODE_WIFI_PSK2)" }
create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/pkg/pc_wifi \
2024-05-30 13:46:57 +00:00
[depot_user]/src/acpi \
[depot_user]/src/dynamic_rom \
[depot_user]/src/init \
2024-05-30 13:46:57 +00:00
[depot_user]/src/pc_nic \
[depot_user]/src/nic_router \
[depot_user]/src/pci_decode \
2024-05-30 13:46:57 +00:00
[depot_user]/src/platform \
[depot_user]/src/report_rom \
2024-05-30 13:46:57 +00:00
[depot_user]/src/pc_rtc
build { app/ping server/nic_router test/nic_router_uplinks }
install_config {
<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"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="report_rom" caps="200">
<resource name="RAM" quantum="4M"/>
<provides>
<service name="ROM" />
<service name="Report" />
</provides>
<config>
2024-05-30 13:46:57 +00:00
<policy label="pci_decode -> system" report="acpi -> acpi"/>
<policy label="platform -> devices" report="pci_decode -> devices"/>
<policy label="router -> config" report="test -> router_config"/>
<policy label="test -> ping_result" report="ping -> result"/>
</config>
</start>
2024-05-30 13:46:57 +00:00
<start name="acpi" caps="250">
<resource name="RAM" quantum="4M"/>
</start>
<start name="pci_decode" caps="350">
<resource name="RAM" quantum="2M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="system"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
2024-05-30 13:46:57 +00:00
<start name="platform" caps="100" managing_system="yes">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Platform"/> </provides>
<route>
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
<config>
2024-05-30 13:46:57 +00:00
<policy label_prefix="wifi" info="yes"> <pci class="WIFI"/> </policy>
<policy label_prefix="nic" info="yes"> <pci class="ETHERNET"/> </policy>
</config>
</start>
<start name="timer" priority="0">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
2024-05-30 13:46:57 +00:00
<start name="pc_rtc" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides>
<service name="Rtc"/>
</provides>
</start>
2024-05-30 13:46:57 +00:00
<start name="nic" priority="-1" caps="250">
<binary name="pc_nic"/>
<resource name="RAM" quantum="8M"/>
<route>
<service name="Uplink"> <child name="router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="wifi" caps="600" priority="-1">
<resource name="RAM" quantum="32M"/>
<config ld_verbose="no">
<vfs>
<dir name="dev"> <log/> <rtc/> <null/>
<jitterentropy name="random"/>
<jitterentropy name="urandom"/>
</dir>
<dir name="config"> <ram/> </dir>
<dir name="firmware">
<tar name="wifi_firmware.tar"/>
</dir>
</vfs>
<libc stdout="/dev/null" stderr="/dev/null" rtc="/dev/rtc"/>
</config>
<route>
<service name="Uplink"> <child name="router"/> </service>
<service name="Rtc"> <any-child/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="wifi_config"> <child name="config_rom"/> </service>
<service name="ROM" label="wifi.lib.so"> <parent label="pc_wifi.lib.so"/> </service>
<service name="ROM" label="wifi_firmware.tar"> <parent label="pc_wifi_firmware.tar"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="config_rom" priority="-2">
<binary name="dynamic_rom"/>
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config>
<rom name="wifi_config">
<inline description="CONNECT">
<wifi_config connected_scan_interval="0" scan_interval="5" rfkill="no" verbose="no" verbose_state="no">
<network ssid="} [wifi_ssid] {" protection="WPA2" passphrase="} [wifi_psk] {"/>
</wifi_config>
</inline>
<sleep milliseconds="600000"/> <!-- 10 minutes -->
</rom>
</config>
</start>
<start name="router" caps="200" priority="-2">
<binary name="nic_router"/>
<resource name="RAM" quantum="10M"/>
<provides>
<service name="Nic"/>
<service name="Uplink"/>
</provides>
<route>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="test" caps="200" priority="-2">
<binary name="test-nic_router_uplinks"/>
<resource name="RAM" quantum="1M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="ping_result"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="ping" priority="-2">
<resource name="RAM" quantum="8M"/>
<config dst_ip="1.1.1.1"
period_sec="1"
report="yes"
count="999"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="Nic"> <child name="router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>
}
append qemu_args " -nographic "
build_boot_image [build_artifacts]
run_genode_until "child \"test\" exited with exit value.*\n" 300
grep_output {\[init\] child "test" exited with exit value}
compare_output_to {[init] child "test" exited with exit value 0}