mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-28 09:38:53 +00:00
6402182815
This commit adds a new configuration option, `dst_addr` to the 'sntp_client' that accepts either an IP address or a DNS hostname. If a DNS hostname is provided, the 'sntp_client' will resolve the IP address before each SNTP request. The 'dst_ip' configuration option is deprecated but kept for compatibility until 'dst_addr' is fully adopted. xsd/net_types.xsd: add Net_address type sntp_dummy_rtc: adjust configuration to use pool.ntp.org Fixes genodelabs/genode#5003
112 lines
2.9 KiB
Plaintext
112 lines
2.9 KiB
Plaintext
if { [get_cmd_switch --autopilot] } { assert_spec x86 }
|
|
|
|
if { [have_spec linux] } {
|
|
puts "Run script is not supported on this platform."
|
|
exit 0
|
|
}
|
|
|
|
create_boot_directory
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
|
[depot_user]/src/nic_router \
|
|
[depot_user]/src/init \
|
|
[depot_user]/src/report_rom
|
|
|
|
build { app/sntp_client }
|
|
|
|
install_config {
|
|
<config>
|
|
<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">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
<config verbose="yes">
|
|
<policy label_suffix="set_rtc" report="sntp_client -> set_rtc"/>
|
|
</config>
|
|
</start>
|
|
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Timer"/></provides>
|
|
</start>
|
|
|
|
<start name="drivers" caps="1200" managing_system="yes">
|
|
<resource name="RAM" quantum="32M"/>
|
|
<binary name="init"/>
|
|
<route>
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
|
<any-service> <parent/> </any-service>
|
|
</route>
|
|
</start>
|
|
|
|
<start name="nic_router" caps="200">
|
|
<resource name="RAM" quantum="10M"/>
|
|
<provides>
|
|
<service name="Nic"/>
|
|
<service name="Uplink"/>
|
|
</provides>
|
|
<config verbose_domain_state="yes">
|
|
|
|
<policy label_prefix="sntp_client" domain="downlink"/>
|
|
<policy label_prefix="drivers" domain="uplink"/>
|
|
|
|
<domain name="uplink">
|
|
|
|
<nat domain="downlink"
|
|
tcp-ports="16384"
|
|
udp-ports="16384"
|
|
icmp-ids="16384"/>
|
|
|
|
</domain>
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24">
|
|
|
|
<dhcp-server ip_first="10.0.3.2"
|
|
ip_last="10.0.3.2"
|
|
dns_config_from="uplink"/>
|
|
|
|
<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>
|
|
</start>
|
|
|
|
<start name="sntp_client">
|
|
<resource name="RAM" quantum="8M"/>
|
|
<config verbose="no" dst_addr="pool.ntp.org" period_min="1"/>
|
|
<route>
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
</config>}
|
|
|
|
build_boot_image [build_artifacts]
|
|
|
|
append qemu_args " -nographic "
|
|
append_qemu_nic_args
|
|
|
|
set done_string "report_rom] <set_rtc year.*?report_rom] <set_rtc year.*?\n"
|
|
|
|
run_genode_until $done_string 90
|