Bump dhall-genode
• update dhall-genode revision • render top-level init config with lib.renderDhallInit • convert Init.Start.config to optionals • lib.validate renderDhallInit XML
This commit is contained in:
parent
20594a9962
commit
ef9f76744f
|
@ -6,6 +6,6 @@
|
||||||
|
|
||||||
fetchgit {
|
fetchgit {
|
||||||
url = "https://git.sr.ht/~ehmry/dhall-genode";
|
url = "https://git.sr.ht/~ehmry/dhall-genode";
|
||||||
rev = "4e05e7bf88e53c81a8f00460673fd48e858c6dfc";
|
rev = "c9a9c18dc8dd45198dbf0a53732ca02079fee0fd";
|
||||||
sha256 = "0y92jinqr26wlrychk8mi58kqwmy4y25c2ffks3r3m78i8andi8y";
|
sha256 = "1fcfyfcnm6snpagf3ii70p8vdy7na9lv6c3izlckyp6gvgadyyjn";
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ in {
|
||||||
renderDhallInit = path: args:
|
renderDhallInit = path: args:
|
||||||
hostPkgs.runCommand "init.xml" {
|
hostPkgs.runCommand "init.xml" {
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
buildInputs = [ hostPkgs.dhall ];
|
buildInputs = with hostPkgs; [ dhall libxml2 ];
|
||||||
initConfig = path;
|
initConfig = path;
|
||||||
initArgs = args;
|
initArgs = args;
|
||||||
DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
|
DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
|
||||||
|
@ -32,8 +32,9 @@ in {
|
||||||
} ''
|
} ''
|
||||||
export XDG_CACHE_HOME=$NIX_BUILD_TOP
|
export XDG_CACHE_HOME=$NIX_BUILD_TOP
|
||||||
dhall text \
|
dhall text \
|
||||||
<<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \
|
<<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (env:initConfig env:initArgs)' \
|
||||||
> $out
|
> $out
|
||||||
|
xmllint --noout $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
x86_64-genode.buildNovaIso = { name, rom }:
|
x86_64-genode.buildNovaIso = { name, rom }:
|
||||||
|
|
|
@ -1,24 +1,33 @@
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
in λ(_ : {})
|
in λ ( _
|
||||||
→ { test-libc =
|
: {}
|
||||||
Genode.Init.Start::{
|
)
|
||||||
, binary = "test-libc"
|
→ Genode.Init::{
|
||||||
, resources = { caps = 200, ram = Genode.units.MiB 400 }
|
, verbose = True
|
||||||
, routes = [ Genode.ServiceRoute.parent "Timer" ]
|
, children =
|
||||||
, config =
|
toMap
|
||||||
Genode.Prelude.XML.text
|
{ test-libc =
|
||||||
''
|
Genode.Init.Start::{
|
||||||
<config>
|
, binary = "test-libc"
|
||||||
<vfs>
|
, resources = { caps = 200, ram = Genode.units.MiB 400 }
|
||||||
<dir name="dev">
|
, routes = [ Genode.ServiceRoute.parent "Timer" ]
|
||||||
<log/>
|
, config =
|
||||||
<inline name="rtc">2019-08-20 15:01</inline>
|
Some
|
||||||
</dir>
|
( Genode.Prelude.XML.text
|
||||||
</vfs>
|
''
|
||||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
<config>
|
||||||
</config>
|
<vfs>
|
||||||
''
|
<dir name="dev">
|
||||||
|
<log/>
|
||||||
|
<inline name="rtc">2019-08-20 15:01</inline>
|
||||||
|
</dir>
|
||||||
|
</vfs>
|
||||||
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||||
|
</config>
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}
|
||||||
|
: Genode.Init.Start.Type
|
||||||
}
|
}
|
||||||
: Genode.Init.Start.Type
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
|
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
|
||||||
|
|
||||||
in λ(_ : {}) → { test-log = Genode.Init.Start::{ binary = "test-log" } }
|
in λ(_ : {})
|
||||||
|
→ Genode.Init::{
|
||||||
|
, verbose = True
|
||||||
|
, children =
|
||||||
|
toMap { test-log = Genode.Init.Start::{ binary = "test-log" } }
|
||||||
|
}
|
||||||
|
|
126
tests/pci.dhall
126
tests/pci.dhall
|
@ -3,62 +3,72 @@ let Genode = env:DHALL_GENODE
|
||||||
in λ ( _
|
in λ ( _
|
||||||
: {}
|
: {}
|
||||||
)
|
)
|
||||||
→ { test-pci =
|
→ Genode.Init::{
|
||||||
Genode.Init.Start::{
|
, verbose = True
|
||||||
, binary = "test-pci"
|
, children =
|
||||||
, resources = { caps = 96, ram = Genode.units.MiB 2 }
|
toMap
|
||||||
, routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ]
|
{ test-pci =
|
||||||
}
|
Genode.Init.Start::{
|
||||||
, acpi_report_rom =
|
, binary = "test-pci"
|
||||||
Genode.Init.Start::{
|
, resources = { caps = 96, ram = Genode.units.MiB 2 }
|
||||||
, binary = "report_rom"
|
, routes =
|
||||||
, resources = { caps = 96, ram = Genode.units.MiB 2 }
|
[ Genode.ServiceRoute.child "Platform" "platform_drv" ]
|
||||||
, provides = [ "ROM", "Report" ]
|
}
|
||||||
, config =
|
, acpi_report_rom =
|
||||||
Genode.Prelude.XML.text
|
Genode.Init.Start::{
|
||||||
''
|
, binary = "report_rom"
|
||||||
<config system="yes">
|
, resources = { caps = 96, ram = Genode.units.MiB 2 }
|
||||||
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
|
, provides = [ "ROM", "Report" ]
|
||||||
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
|
, config =
|
||||||
</config>
|
Some
|
||||||
''
|
( Genode.Prelude.XML.text
|
||||||
}
|
''
|
||||||
, acpi_drv =
|
<config system="yes">
|
||||||
Genode.Init.Start::{
|
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
|
||||||
, binary = "acpi_drv"
|
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
|
||||||
, resources = { caps = 400, ram = Genode.units.MiB 4 }
|
</config>
|
||||||
, constrainPhys = True
|
''
|
||||||
, provides = [ "Platform", "Acpi" ]
|
)
|
||||||
, routes =
|
}
|
||||||
[ Genode.ServiceRoute.child "Report" "acpi_report_rom"
|
, acpi_drv =
|
||||||
, Genode.ServiceRoute.parent "IRQ"
|
Genode.Init.Start::{
|
||||||
, Genode.ServiceRoute.parent "IO_MEM"
|
, binary = "acpi_drv"
|
||||||
, Genode.ServiceRoute.parent "IO_PORT"
|
, resources = { caps = 400, ram = Genode.units.MiB 4 }
|
||||||
]
|
, constrainPhys = True
|
||||||
}
|
, provides = [ "Platform", "Acpi" ]
|
||||||
, platform_drv =
|
, routes =
|
||||||
Genode.Init.Start::{
|
[ Genode.ServiceRoute.child "Report" "acpi_report_rom"
|
||||||
, binary = "platform_drv"
|
, Genode.ServiceRoute.parent "IRQ"
|
||||||
, resources = { caps = 800, ram = Genode.units.MiB 4 }
|
, Genode.ServiceRoute.parent "IO_MEM"
|
||||||
, constrainPhys = True
|
, Genode.ServiceRoute.parent "IO_PORT"
|
||||||
, provides = [ "Platform", "Acpi" ]
|
]
|
||||||
, routes =
|
}
|
||||||
[ Genode.ServiceRoute.parent "Timer"
|
, platform_drv =
|
||||||
, Genode.ServiceRoute.parent "IRQ"
|
Genode.Init.Start::{
|
||||||
, Genode.ServiceRoute.parent "IO_MEM"
|
, binary = "platform_drv"
|
||||||
, Genode.ServiceRoute.parent "IO_PORT"
|
, resources = { caps = 800, ram = Genode.units.MiB 4 }
|
||||||
, Genode.ServiceRoute.childLabel
|
, constrainPhys = True
|
||||||
"ROM"
|
, provides = [ "Platform", "Acpi" ]
|
||||||
"acpi_report_rom"
|
, routes =
|
||||||
(Some "acpi")
|
[ Genode.ServiceRoute.parent "Timer"
|
||||||
(None Text)
|
, Genode.ServiceRoute.parent "IRQ"
|
||||||
]
|
, Genode.ServiceRoute.parent "IO_MEM"
|
||||||
, config =
|
, Genode.ServiceRoute.parent "IO_PORT"
|
||||||
Genode.Prelude.XML.text
|
, Genode.ServiceRoute.childLabel
|
||||||
''
|
"ROM"
|
||||||
<config>
|
"acpi_report_rom"
|
||||||
<policy label_prefix="test-pci"> <pci class="ALL"/> </policy>
|
(Some "acpi")
|
||||||
</config>
|
(None Text)
|
||||||
''
|
]
|
||||||
}
|
, config =
|
||||||
|
Some
|
||||||
|
( Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config>
|
||||||
|
<policy label_prefix="test-pci"> <pci class="ALL"/> </policy>
|
||||||
|
</config>
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
|
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
|
||||||
|
|
||||||
in λ(_ : {})
|
in λ(_ : {})
|
||||||
→ { test-signal =
|
→ Genode.Init::{
|
||||||
Genode.Init.Start::{
|
, verbose = True
|
||||||
, binary = "test-signal"
|
, children =
|
||||||
, resources = { caps = 500, ram = Genode.units.MiB 10 }
|
toMap
|
||||||
, routes = [ Genode.ServiceRoute.parent "Timer" ]
|
{ test-signal =
|
||||||
|
Genode.Init.Start::{
|
||||||
|
, binary = "test-signal"
|
||||||
|
, resources = { caps = 500, ram = Genode.units.MiB 10 }
|
||||||
|
, routes = [ Genode.ServiceRoute.parent "Timer" ]
|
||||||
|
}
|
||||||
|
: Genode.Init.Start.Type
|
||||||
}
|
}
|
||||||
: Genode.Init.Start.Type
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue