|
|
|
@ -128,10 +128,14 @@ with lib;
|
|
|
|
|
inputs = with pkgs.genodePackages;
|
|
|
|
|
{
|
|
|
|
|
lwip = [ vfs_lwip ];
|
|
|
|
|
lxip = [ vfs_lixp ];
|
|
|
|
|
lxip = [ vfs_lxip ];
|
|
|
|
|
}.${interface.genode.stack};
|
|
|
|
|
configFile = let
|
|
|
|
|
binary = "${pkgs.genodePackages.vfs}/bin/vfs";
|
|
|
|
|
ram = {
|
|
|
|
|
lwip = 16;
|
|
|
|
|
lxip = 32;
|
|
|
|
|
}.${interface.genode.stack};
|
|
|
|
|
settings = with builtins;
|
|
|
|
|
lib.optionals (interface.ipv4.addresses != [ ])
|
|
|
|
|
(let addr = head interface.ipv4.addresses;
|
|
|
|
@ -156,8 +160,9 @@ with lib;
|
|
|
|
|
name = "dhcp";
|
|
|
|
|
value = if interface.useDHCP then "true" else "false";
|
|
|
|
|
};
|
|
|
|
|
settingsMap = map ({ name, value }:
|
|
|
|
|
''{ mapKey = "${name}", mapValue = "${value}" }'') settings;
|
|
|
|
|
settingsMap = builtins.concatStringsSep ", " (map
|
|
|
|
|
({ name, value }:
|
|
|
|
|
''{ mapKey = "${name}", mapValue = "${value}" }'') settings);
|
|
|
|
|
in pkgs.writeText "${name'}.dhall" ''
|
|
|
|
|
let Genode = env:DHALL_GENODE
|
|
|
|
|
|
|
|
|
@ -167,33 +172,26 @@ with lib;
|
|
|
|
|
Init.Child.Attributes::{
|
|
|
|
|
, binary = "${binary}"
|
|
|
|
|
, provides = [ "File_system" ]
|
|
|
|
|
, resources = Init.Resources::{ caps = 128, ram = Genode.units.MiB 16 }
|
|
|
|
|
, resources = Init.Resources::{
|
|
|
|
|
, caps = 128
|
|
|
|
|
, ram = Genode.units.MiB ${toString ram}
|
|
|
|
|
}
|
|
|
|
|
, config = Init.Config::{
|
|
|
|
|
, policies =
|
|
|
|
|
[ Init.Config.Policy::{
|
|
|
|
|
, service = "File_system"
|
|
|
|
|
, label = Init.LabelSelector.suffix "sockets"
|
|
|
|
|
, attributes = toMap { root = "/" }
|
|
|
|
|
, label = Init.LabelSelector.suffix "${name'}"
|
|
|
|
|
, attributes = toMap { root = "/", writeable="yes" }
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
, content =
|
|
|
|
|
let XML = Genode.Prelude.XML
|
|
|
|
|
|
|
|
|
|
in [ XML.element
|
|
|
|
|
{ name = "vfs"
|
|
|
|
|
, attributes = XML.emptyAttributes
|
|
|
|
|
, content =
|
|
|
|
|
[ XML.leaf
|
|
|
|
|
{ name = "lwip"
|
|
|
|
|
, attributes = [
|
|
|
|
|
${
|
|
|
|
|
builtins.concatStringsSep ", "
|
|
|
|
|
settingsMap
|
|
|
|
|
}
|
|
|
|
|
] : Genode.Prelude.Map.Type Text Text
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
let VFS = Genode.VFS
|
|
|
|
|
|
|
|
|
|
in [ VFS.vfs
|
|
|
|
|
[ VFS.leafAttrs
|
|
|
|
|
"${interface.genode.stack}"
|
|
|
|
|
([ ${settingsMap} ] : Genode.Prelude.Map.Type Text Text)
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|