2019-10-15 18:34:47 +00:00
|
|
|
if { [get_cmd_switch --autopilot] } { assert_spec x86 }
|
2019-07-12 13:13:40 +00:00
|
|
|
|
|
|
|
if { [have_spec linux] } {
|
|
|
|
puts "Run script is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-10-09 12:31:30 +00:00
|
|
|
set host_tool [installed_command host]
|
|
|
|
set ntp_ip [exec $host_tool -t A pool.ntp.org | head -1 | cut -d " " -f 4]
|
|
|
|
|
|
|
|
puts "Using NTP server $ntp_ip"
|
|
|
|
|
2019-07-12 13:13:40 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
2019-09-09 10:15:07 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
|
|
|
[depot_user]/src/init
|
2019-07-12 13:13:40 +00:00
|
|
|
|
2019-09-09 10:15:07 +00:00
|
|
|
build { app/sntp_client server/report_rom }
|
2019-07-12 13:13:40 +00:00
|
|
|
|
|
|
|
append 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>
|
|
|
|
|
2020-07-10 11:04:12 +00:00
|
|
|
<start name="drivers" caps="1000" managing_system="yes">
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
2019-07-12 13:13:40 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
<provides> <service name="Nic"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="sntp_client">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
2019-10-09 12:31:30 +00:00
|
|
|
<config verbose="no" dst_ip="} $ntp_ip {" period_min="1"/>
|
2019-07-12 13:13:40 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
build_boot_image { core ld.lib.so init timer sntp_client report_rom }
|
|
|
|
|
|
|
|
append qemu_args " -nographic "
|
2020-04-02 19:20:50 +00:00
|
|
|
append_qemu_nic_args
|
2019-07-12 13:13:40 +00:00
|
|
|
|
|
|
|
set done_string "report_rom] <set_rtc year.*?report_rom] <set_rtc year.*?\n"
|
|
|
|
|
|
|
|
run_genode_until $done_string 90
|