2
0
Fork 0
genodepkgs/tests/tox-bootstrapd.dhall

134 lines
4.4 KiB
Plaintext

let Test = ./test.dhall ? env:DHALL_GENODE_TEST
let Genode = Test.Genode
let Prelude = Genode.Prelude
let XML = Prelude.XML
let Init = Genode.Init
let Child = Init.Child
let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
let toArgsXML =
Prelude.List.map
Text
XML.Type
( λ(value : Text) →
XML.leaf { name = "arg", attributes = toMap { value } }
)
let tox-bootstrap =
Init::{
, verbose = True
, routes =
[ ServiceRoute.parent "Timer"
, ServiceRoute.child "Platform" "platform_drv"
]
, children = toMap
{ tox-bootstrapd =
Child.flat
Child.Attributes::{
, binary = "tox-bootstrapd"
, exitPropagate = True
, resources = Resources::{ ram = Genode.units.MiB 16 }
, config = Init.Config::{
, content =
[ XML.text
''
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket" rng="/dev/zero"/>
<vfs>
<dir name="dev">
<log/>
<null/>
<zero/>
</dir>
<dir name="socket">
<lwip dhcp="yes"/>
</dir>
<inline name="config">
enable_motd = true
motd = "Genode Tox bootstrapd test"
</inline>
<ram/>
</vfs>
''
]
# toArgsXML
[ "tox-bootstrapd"
, "--config=/config"
, "--foreground"
, "--log-backend=stdout"
]
}
, routes = [ ServiceRoute.child "Nic" "nic_drv" ]
}
, nic_drv =
Child.flat
Child.Attributes::{
, binary = "ipxe_nic_drv"
, provides = [ "Nic" ]
, resources = Init.Resources::{
, caps = 128
, ram = Genode.units.MiB 4
}
, routes = [ ServiceRoute.child "Platform" "platform_drv" ]
}
, acpi_drv =
Child.flat
Child.Attributes::{
, binary = "acpi_drv"
, resources = Resources::{
, caps = 400
, ram = Genode.units.MiB 4
, constrainPhys = True
}
, provides = [ "Platform", "Acpi" ]
, romReports = [ label "acpi", label "smbios_table" ]
, routes =
[ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
]
}
, platform_drv =
Child.flat
Child.Attributes::{
, binary = "platform_drv"
, resources = Resources::{
, caps = 800
, ram = Genode.units.MiB 4
, constrainPhys = True
}
, reportRoms = [ label "acpi" ]
, provides = [ "Platform", "Acpi" ]
, routes =
[ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
]
, config = Init.Config::{
, policies =
[ Init.Config.Policy::{
, label = Init.LabelSelector.prefix "nic_drv"
, content =
[ XML.leaf
{ name = "pci"
, attributes = toMap { class = "ETHERNET" }
}
]
}
]
}
}
}
}
in Test::{ children = Test.initToChildren tox-bootstrap }