2021-01-13 09:15:10 +00:00
|
|
|
if {[have_spec foc] || [have_spec linux] || [have_board rpi3] ||
|
|
|
|
[have_board imx53_qsb_tz]} {
|
2019-05-22 11:29:50 +00:00
|
|
|
puts "Run script is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2022-08-09 11:32:38 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-05-22 11:29:50 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
|
|
|
[depot_user]/src/init \
|
|
|
|
[depot_user]/src/nic_bridge \
|
|
|
|
[depot_user]/src/nic_router \
|
|
|
|
|
|
|
|
build { app/ping server/nic_dump }
|
|
|
|
|
2023-06-13 13:18:44 +00:00
|
|
|
proc dst_ip { } {
|
2019-05-22 11:29:50 +00:00
|
|
|
if {![have_include power_on/qemu]} {
|
|
|
|
return "10.0.0.2"
|
|
|
|
} else {
|
|
|
|
return "10.0.2.2"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
append config {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-05-22 11:29:50 +00:00
|
|
|
<config>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-05-22 11:29:50 +00:00
|
|
|
<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>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-05-22 11:29:50 +00:00
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2019-05-22 11:29:50 +00:00
|
|
|
<default caps="100"/>
|
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
|
2023-07-07 10:58:38 +00:00
|
|
|
<start name="drivers" caps="1200" managing_system="yes">
|
2020-07-10 11:04:12 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2019-05-22 11:29:50 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2023-06-13 13:18:44 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2019-05-22 11:29:50 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
<provides> <service name="Nic"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
2023-06-13 13:18:44 +00:00
|
|
|
<start name="nic_router" caps="200">
|
2021-01-08 16:27:24 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config dhcp_discover_timeout_sec="1">
|
|
|
|
|
|
|
|
<policy label_prefix="nic_dump" domain="downlink"/>
|
|
|
|
<policy label_prefix="drivers" domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink">
|
|
|
|
|
|
|
|
<nat domain="downlink" icmp-ids="100" udp-ports="100"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24">
|
|
|
|
|
|
|
|
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2"/>
|
2023-06-13 13:18:44 +00:00
|
|
|
<icmp dst="} [dst_ip] {/24" domain="uplink"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_dump" caps="200">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
2019-05-22 11:29:50 +00:00
|
|
|
<provides><service name="Nic"/></provides>
|
2021-01-08 16:27:24 +00:00
|
|
|
<config uplink="uplink"
|
|
|
|
downlink="downlink"
|
2019-05-22 11:29:50 +00:00
|
|
|
time="yes"
|
|
|
|
default="name"
|
|
|
|
eth="name"
|
|
|
|
arp="all"
|
|
|
|
ipv4="default"
|
|
|
|
dhcp="no"
|
|
|
|
udp="no"
|
|
|
|
icmp="all"
|
|
|
|
tcp="default" />
|
|
|
|
<route>
|
2023-06-13 13:18:44 +00:00
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2019-05-22 11:29:50 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2023-06-13 13:18:44 +00:00
|
|
|
<start name="ping">
|
2019-05-22 11:29:50 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config interface="10.0.3.2/24"
|
|
|
|
gateway="10.0.3.1"
|
2023-06-13 13:18:44 +00:00
|
|
|
dst_ip="} [dst_ip] {"
|
2019-05-22 11:29:50 +00:00
|
|
|
period_sec="1"
|
|
|
|
verbose="no"/>
|
|
|
|
<route>
|
2023-06-13 13:18:44 +00:00
|
|
|
<service name="Nic"> <child name="nic_dump"/> </service>
|
2019-05-22 11:29:50 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2023-06-13 13:18:44 +00:00
|
|
|
</config>
|
|
|
|
}
|
2019-05-22 11:29:50 +00:00
|
|
|
|
|
|
|
install_config $config
|
2023-05-04 14:18:04 +00:00
|
|
|
|
|
|
|
build_boot_image [build_artifacts]
|
2019-05-22 11:29:50 +00:00
|
|
|
|
|
|
|
append qemu_args " -nographic "
|
2020-04-02 19:20:50 +00:00
|
|
|
append_qemu_nic_args
|
2019-05-22 11:29:50 +00:00
|
|
|
|
2023-06-13 13:18:44 +00:00
|
|
|
run_genode_until ".*child \"ping\" exited with exit value 0.*\n" 60
|