2
0
Fork 0

Use "record override" syntatic-sugar in Dhall test configs

This commit is contained in:
Ehmry - 2019-10-23 02:09:28 +02:00
parent 1df76e3bca
commit 9410b836c2
12 changed files with 228 additions and 225 deletions

View File

@ -6,6 +6,6 @@
fetchgit { fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode"; url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "031fb4ef77dc8a2dbe71fd806129b4eacfe0606a"; rev = "4e05e7bf88e53c81a8f00460673fd48e858c6dfc";
sha256 = "1hvy21w406fy01b9fag3pmz22zlnfdkz17fmrv2h8xxj5lci9z5n"; sha256 = "0y92jinqr26wlrychk8mi58kqwmy4y25c2ffks3r3m78i8andi8y";
} }

View File

@ -22,6 +22,18 @@ let
lib = hostPkgs.lib // { lib = hostPkgs.lib // {
dhallText = name: source:
hostPkgs.runCommand name {
inherit name source;
preferLocalBuild = true;
buildInputs = [ hostPkgs.dhall ];
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
} ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
dhall text < $source > $out
'';
renderDhallInit = path: args: renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" { hostPkgs.runCommand "init.xml" {
preferLocalBuild = true; preferLocalBuild = true;
@ -32,8 +44,8 @@ let
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall"; DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
} '' } ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP export XDG_CACHE_HOME=$NIX_BUILD_TOP
echo 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init.defaults { children = toMap (env:initConfig env:initArgs) })' \ dhall text \
| dhall text \ <<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \
> $out > $out
''; '';
}; };

View File

@ -2,8 +2,8 @@ let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { test-libc = → { test-libc =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test-libc" , binary = "test-libc"
, resources = { caps = 200, ram = Genode.units.MiB 400 } , resources = { caps = 200, ram = Genode.units.MiB 400 }
, routes = [ Genode.ServiceRoute.parent "Timer" ] , routes = [ Genode.ServiceRoute.parent "Timer" ]
, config = , config =

View File

@ -1,7 +1,3 @@
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
in λ(_ : {}) in λ(_ : {}) → { test-log = Genode.Init.Start::{ binary = "test-log" } }
→ { test-log =
Genode.Init.Start.defaults ⫽ { binary = "test-log" }
: Genode.Init.Start.Type
}

View File

@ -66,11 +66,12 @@ in hostPkgs.stdenv.mkDerivation {
dontUnpack = true; dontUnpack = true;
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
inherit modulesAsm;
installPhase = '' installPhase = ''
mkdir -p boot/syslinux mkdir -p boot/syslinux
# compile the boot modules into one object file # compile the boot modules into one object file
echo '${modulesAsm}' | $CC -c -x assembler -o boot_modules.o - $CC -c -x assembler -o boot_modules.o - <<< $modulesAsm
# link final image # link final image
$LD -nostdlib \ $LD -nostdlib \

View File

@ -4,15 +4,14 @@ in λ ( _
: {} : {}
) )
→ { test-pci = → { test-pci =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test-pci" , binary = "test-pci"
, resources = { caps = 96, ram = Genode.units.MiB 2 } , resources = { caps = 96, ram = Genode.units.MiB 2 }
, routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ] , routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ]
} }
, acpi_report_rom = , acpi_report_rom =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = , binary = "report_rom"
"report_rom"
, resources = { caps = 96, ram = Genode.units.MiB 2 } , resources = { caps = 96, ram = Genode.units.MiB 2 }
, provides = [ "ROM", "Report" ] , provides = [ "ROM", "Report" ]
, config = , config =
@ -25,8 +24,8 @@ in λ ( _
'' ''
} }
, acpi_drv = , acpi_drv =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "acpi_drv" , binary = "acpi_drv"
, resources = { caps = 400, ram = Genode.units.MiB 4 } , resources = { caps = 400, ram = Genode.units.MiB 4 }
, constrainPhys = True , constrainPhys = True
, provides = [ "Platform", "Acpi" ] , provides = [ "Platform", "Acpi" ]
@ -38,8 +37,8 @@ in λ ( _
] ]
} }
, platform_drv = , platform_drv =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "platform_drv" , binary = "platform_drv"
, resources = { caps = 800, ram = Genode.units.MiB 4 } , resources = { caps = 800, ram = Genode.units.MiB 4 }
, constrainPhys = True , constrainPhys = True
, provides = [ "Platform", "Acpi" ] , provides = [ "Platform", "Acpi" ]

View File

@ -2,8 +2,8 @@ let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
in λ(_ : {}) in λ(_ : {})
→ { test-signal = → { test-signal =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test-signal" , binary = "test-signal"
, resources = { caps = 500, ram = Genode.units.MiB 10 } , resources = { caps = 500, ram = Genode.units.MiB 10 }
, routes = [ Genode.ServiceRoute.parent "Timer" ] , routes = [ Genode.ServiceRoute.parent "Timer" ]
} }

View File

@ -2,8 +2,8 @@ let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { solo5 = → { solo5 =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test" , binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 } , resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"
@ -11,8 +11,8 @@ in λ(_ : {})
] ]
} }
, block = , block =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "ram_block" , binary = "ram_block"
, provides = [ "Block" ] , provides = [ "Block" ]
, resources = { caps = 96, ram = Genode.units.MiB 9 } , resources = { caps = 96, ram = Genode.units.MiB 9 }
, config = , config =

View File

@ -2,11 +2,10 @@ let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { nic = → { nic =
Genode.Init.Start.defaults Genode.Init.Start::{ binary = "nic_loopback", provides = [ "Nic" ] }
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
, bridge = , bridge =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "nic_bridge" , binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 6 } , resources = { caps = 200, ram = Genode.units.MiB 6 }
, provides = [ "Nic" ] , provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ] , routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
@ -20,8 +19,8 @@ in λ(_ : {})
'' ''
} }
, solo5 = , solo5 =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test" , binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 } , resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"
@ -34,8 +33,8 @@ in λ(_ : {})
'' ''
} }
, ping = , ping =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "ping" , binary = "ping"
, resources = { caps = 128, ram = Genode.units.MiB 6 } , resources = { caps = 128, ram = Genode.units.MiB 6 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"

View File

@ -4,11 +4,10 @@ in λ ( _
: {} : {}
) )
→ { nic = → { nic =
Genode.Init.Start.defaults Genode.Init.Start::{ binary = "nic_loopback", provides = [ "Nic" ] }
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
, bridge = , bridge =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "nic_bridge" , binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 8 } , resources = { caps = 200, ram = Genode.units.MiB 8 }
, provides = [ "Nic" ] , provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ] , routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
@ -23,8 +22,8 @@ in λ ( _
'' ''
} }
, solo5 = , solo5 =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test" , binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 4 } , resources = { caps = 256, ram = Genode.units.MiB 4 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"
@ -37,9 +36,8 @@ in λ ( _
'' ''
} }
, clients = , clients =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = , binary = "sequence"
"sequence"
, resources = { caps = 256, ram = Genode.units.MiB 8 } , resources = { caps = 256, ram = Genode.units.MiB 8 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"

View File

@ -2,8 +2,8 @@ let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { solo5 = → { solo5 =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test" , binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 } , resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = [ Genode.ServiceRoute.parent "Timer" ] , routes = [ Genode.ServiceRoute.parent "Timer" ]
, config = , config =

View File

@ -2,8 +2,8 @@ let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { solo5 = → { solo5 =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "test" , binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 } , resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = , routes =
[ Genode.ServiceRoute.parent "Timer" [ Genode.ServiceRoute.parent "Timer"
@ -11,11 +11,9 @@ in λ(_ : {})
] ]
} }
, clock = , clock =
Genode.Init.Start.defaults Genode.Init.Start::{
⫽ { binary = "rtc_drv" , binary = "rtc_drv"
, provides = [ "Rtc" ] , provides = [ "Rtc" ]
, routes = , routes = [ Genode.ServiceRoute.parent "IO_PORT" ]
[ Genode.ServiceRoute.parent "IO_PORT"
]
} }
} }