2017-12-08 15:44:44 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board linux] || [have_board rpi3] || [have_board imx53_qsb_tz]} {
|
2018-04-10 14:45:01 +00:00
|
|
|
puts "Run script does not support this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2021-02-18 08:04:39 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && [have_board riscv_qemu]} {
|
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-02-19 13:24:52 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
2019-04-24 13:09:49 +00:00
|
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
2019-02-19 13:24:52 +00:00
|
|
|
[depot_user]/src/report_rom \
|
|
|
|
[depot_user]/src/fs_rom \
|
|
|
|
[depot_user]/src/vfs \
|
|
|
|
[depot_user]/src/vfs_lxip \
|
|
|
|
[depot_user]/src/fetchurl \
|
|
|
|
[depot_user]/src/libc \
|
|
|
|
[depot_user]/src/libssh \
|
2020-03-18 15:27:28 +00:00
|
|
|
[depot_user]/src/openssl \
|
2019-02-19 13:24:52 +00:00
|
|
|
[depot_user]/src/zlib \
|
|
|
|
[depot_user]/src/curl \
|
|
|
|
[depot_user]/src/init \
|
|
|
|
[depot_user]/src/chroot \
|
|
|
|
[depot_user]/src/extract \
|
2021-01-08 16:27:24 +00:00
|
|
|
[depot_user]/src/nic_router \
|
2019-02-19 13:24:52 +00:00
|
|
|
[depot_user]/src/libarchive \
|
|
|
|
[depot_user]/src/liblzma \
|
|
|
|
[depot_user]/src/verify
|
2017-12-08 15:44:44 +00:00
|
|
|
|
|
|
|
set 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"/>}
|
|
|
|
|
2019-02-20 08:51:55 +00:00
|
|
|
proc depot_user_download { user } {
|
|
|
|
return [exec cat [genode_dir]/depot/$user/download] }
|
2017-12-08 15:44:44 +00:00
|
|
|
|
2019-02-20 08:51:55 +00:00
|
|
|
proc depot_user_pubkey { user } {
|
|
|
|
return [exec cat [genode_dir]/depot/$user/pubkey] }
|
2017-12-08 15:44:44 +00:00
|
|
|
|
|
|
|
append config {
|
|
|
|
<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-04-24 13:09:49 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2019-04-24 13:09:49 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
2021-01-08 16:27:24 +00:00
|
|
|
</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="depot_download" 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">
|
|
|
|
|
2021-08-05 11:31:13 +00:00
|
|
|
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2" dns_config_from="uplink"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<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>
|
2019-04-24 13:09:49 +00:00
|
|
|
</start>
|
|
|
|
|
2017-12-08 15:44:44 +00:00
|
|
|
<start name="vfs">
|
|
|
|
<resource name="RAM" quantum="20M"/>
|
|
|
|
<provides> <service name="File_system"/> </provides>
|
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<dir name="depot">
|
2019-02-20 08:51:55 +00:00
|
|
|
<dir name="genodelabs">
|
|
|
|
<ram/>
|
|
|
|
<inline name="download">} [depot_user_download genodelabs] {</inline>
|
|
|
|
<inline name="pubkey">} [depot_user_pubkey genodelabs] {</inline>
|
2017-12-08 15:44:44 +00:00
|
|
|
</dir>
|
|
|
|
</dir>
|
|
|
|
<dir name="public"> <ram/> </dir>
|
|
|
|
</vfs>
|
2018-02-16 09:29:32 +00:00
|
|
|
<policy label="depot_download -> depot" root="/depot" writeable="yes"/>
|
|
|
|
<policy label="depot_download -> public" root="/public" writeable="yes"/>
|
2017-12-08 15:44:44 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="depot_download" caps="2000">
|
|
|
|
<binary name="init"/>
|
2018-04-19 13:04:43 +00:00
|
|
|
<resource name="RAM" quantum="70M"/>
|
2017-12-08 15:44:44 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config">
|
|
|
|
<parent label="depot_download.config"/> </service>
|
2018-05-19 15:52:48 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2017-12-08 15:44:44 +00:00
|
|
|
<service name="File_system"> <child name="vfs"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2017-12-08 15:44:44 +00:00
|
|
|
</config>}
|
|
|
|
|
|
|
|
|
|
|
|
set fd [open [run_dir]/genode/installation w]
|
2019-02-20 08:51:55 +00:00
|
|
|
puts $fd {
|
|
|
|
<installation arch="x86_64">
|
2021-09-06 13:21:53 +00:00
|
|
|
<archive path="genodelabs/pkg/wm/2019-03-17"/>
|
|
|
|
<index path="genodelabs/index/19.02"/>
|
|
|
|
<index path="genodelabs/index/19.03"/>
|
2019-02-20 08:51:55 +00:00
|
|
|
</installation>}
|
2017-12-08 15:44:44 +00:00
|
|
|
close $fd
|
|
|
|
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2021-04-14 08:10:25 +00:00
|
|
|
copy_file [genode_dir]/repos/gems/recipes/raw/depot_download/depot_download.config \
|
|
|
|
[run_dir]/genode/depot_download.config
|
2017-12-08 15:44:44 +00:00
|
|
|
|
|
|
|
build { app/depot_download_manager app/depot_query }
|
|
|
|
|
|
|
|
append boot_modules { depot_download_manager depot_query }
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
append qemu_args " -nographic "
|
2020-04-02 19:20:50 +00:00
|
|
|
append_qemu_nic_args
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2017-12-08 15:44:44 +00:00
|
|
|
|
2019-02-20 08:51:55 +00:00
|
|
|
# watch the state reports generated by the depot-download manager
|
|
|
|
set expected_pattern {}
|
2021-09-06 13:21:53 +00:00
|
|
|
append expected_pattern {.*path="genodelabs/pkg/wm/2019-03-17" state="done".*}
|
|
|
|
append expected_pattern {.*path="genodelabs/index/19.02" state="done".*}
|
|
|
|
append expected_pattern {.*path="genodelabs/index/19.03" state="failed".*}
|
2019-02-20 08:51:55 +00:00
|
|
|
|
|
|
|
run_genode_until $expected_pattern 150
|