2017-12-05 14:56:38 +00:00
|
|
|
#
|
|
|
|
# \brief Test of 'fetchurl
|
|
|
|
# \author Emery Hemingway
|
|
|
|
# \date 2016-06-05
|
|
|
|
#
|
|
|
|
|
2018-04-10 14:45:01 +00:00
|
|
|
if {[have_spec odroid_xu] || [have_spec linux]} {
|
|
|
|
puts "Run script does not support this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
set build_components {
|
|
|
|
app/fetchurl
|
2018-02-15 11:01:30 +00:00
|
|
|
core init
|
2017-12-05 14:56:38 +00:00
|
|
|
drivers/nic
|
|
|
|
drivers/timer
|
2018-02-15 11:01:30 +00:00
|
|
|
lib/vfs/lxip
|
2018-04-10 14:45:01 +00:00
|
|
|
server/report_rom
|
2017-12-05 14:56:38 +00:00
|
|
|
}
|
|
|
|
|
2018-04-19 10:42:59 +00:00
|
|
|
proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
|
|
|
|
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
|
|
|
|
return gpio_drv }
|
|
|
|
|
|
|
|
lappend_if [have_spec gpio] build_components drivers/gpio
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2018-04-10 14:45:01 +00:00
|
|
|
lappend_if [expr {[nic_drv_binary] == "nic_drv"}] build_components drivers/nic
|
|
|
|
lappend_if [expr {[nic_drv_binary] == "usb_drv"}] build_components drivers/usb
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
append config {
|
2018-02-15 11:01:30 +00:00
|
|
|
<config>
|
2017-12-05 14:56:38 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RAM"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="ROM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default caps="100"/>
|
|
|
|
<default-route>
|
2018-03-02 11:08:48 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2017-12-05 14:56:38 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>}
|
|
|
|
|
|
|
|
append_platform_drv_config
|
|
|
|
|
2018-04-19 10:42:59 +00:00
|
|
|
append_if [have_spec gpio] config "
|
|
|
|
<start name=\"[gpio_drv]\">
|
|
|
|
<resource name=\"RAM\" quantum=\"4M\"/>
|
|
|
|
<provides><service name=\"Gpio\"/></provides>
|
|
|
|
<config/>
|
|
|
|
</start>"
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
append config {
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start>
|
2018-04-10 14:45:01 +00:00
|
|
|
<start name="nic_drv" caps="120">
|
2018-01-12 10:34:15 +00:00
|
|
|
<binary name="} [nic_drv_binary] {"/>
|
2018-04-10 14:45:01 +00:00
|
|
|
<resource name="RAM" quantum="16M"/>
|
2017-12-05 14:56:38 +00:00
|
|
|
<provides> <service name="Nic"/> </provides>
|
2018-04-10 14:45:01 +00:00
|
|
|
} [nic_drv_config] {
|
2017-12-05 14:56:38 +00:00
|
|
|
</start>
|
2018-03-02 11:08:48 +00:00
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
2018-04-10 14:45:01 +00:00
|
|
|
<provides> <service name="ROM"/> <service name="Report"/> </provides>
|
2018-03-02 11:08:48 +00:00
|
|
|
<config verbose="yes"/>
|
|
|
|
</start>
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
<start name="fetchurl" caps="500">
|
2018-02-15 11:01:30 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2017-12-05 14:56:38 +00:00
|
|
|
<config>
|
2018-03-02 11:08:48 +00:00
|
|
|
<report progress="yes"/>
|
2017-12-20 14:56:08 +00:00
|
|
|
<vfs>
|
2018-02-15 11:01:30 +00:00
|
|
|
<dir name="etc">
|
2018-04-04 12:56:45 +00:00
|
|
|
<inline name="resolv.conf">nameserver 1.1.1.1</inline>
|
2018-02-15 11:01:30 +00:00
|
|
|
</dir>
|
2017-12-20 14:56:08 +00:00
|
|
|
<dir name="dev">
|
|
|
|
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
|
2018-02-27 09:36:17 +00:00
|
|
|
<inline name="random">01234567890123456789</inline>
|
2017-12-20 14:56:08 +00:00
|
|
|
</dir>
|
2018-02-15 11:01:30 +00:00
|
|
|
<dir name="socket"> <lxip dhcp="yes"/> </dir>
|
2017-12-20 14:56:08 +00:00
|
|
|
</vfs>
|
2018-02-15 11:01:30 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
|
2018-03-25 09:24:19 +00:00
|
|
|
<fetch url="http://genode.org/about/LICENSE" path="/dev/log" retry="3"/>
|
2017-12-05 14:56:38 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
|
|
|
core init ld.lib.so
|
|
|
|
curl.lib.so
|
|
|
|
fetchurl
|
|
|
|
libc.lib.so
|
|
|
|
libcrypto.lib.so
|
|
|
|
libssh.lib.so
|
|
|
|
libssl.lib.so
|
2018-02-15 11:01:30 +00:00
|
|
|
lxip.lib.so
|
|
|
|
pthread.lib.so
|
2017-12-05 14:56:38 +00:00
|
|
|
timer
|
2018-02-15 11:01:30 +00:00
|
|
|
vfs_lxip.lib.so
|
2017-12-05 14:56:38 +00:00
|
|
|
zlib.lib.so
|
2018-04-10 14:45:01 +00:00
|
|
|
report_rom
|
2017-12-05 14:56:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# platform-specific modules
|
|
|
|
append_platform_drv_boot_modules
|
2018-01-12 10:34:15 +00:00
|
|
|
lappend boot_modules [nic_drv_binary]
|
2017-12-05 14:56:38 +00:00
|
|
|
|
2018-04-19 10:42:59 +00:00
|
|
|
lappend_if [have_spec gpio] boot_modules [gpio_drv]
|
|
|
|
|
2017-12-05 14:56:38 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2018-04-10 14:45:01 +00:00
|
|
|
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
|
|
|
|
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
|
|
|
|
append qemu_args " -nographic -net user"
|
2017-12-05 14:56:38 +00:00
|
|
|
|
|
|
|
run_genode_until {child "fetchurl" exited with exit value 0} 120
|