nixos: lxip support in hardware.nix
This commit is contained in:
parent
a7ef650679
commit
f74b789840
|
@ -128,10 +128,14 @@ with lib;
|
||||||
inputs = with pkgs.genodePackages;
|
inputs = with pkgs.genodePackages;
|
||||||
{
|
{
|
||||||
lwip = [ vfs_lwip ];
|
lwip = [ vfs_lwip ];
|
||||||
lxip = [ vfs_lixp ];
|
lxip = [ vfs_lxip ];
|
||||||
}.${interface.genode.stack};
|
}.${interface.genode.stack};
|
||||||
configFile = let
|
configFile = let
|
||||||
binary = "${pkgs.genodePackages.vfs}/bin/vfs";
|
binary = "${pkgs.genodePackages.vfs}/bin/vfs";
|
||||||
|
ram = {
|
||||||
|
lwip = 16;
|
||||||
|
lxip = 32;
|
||||||
|
}.${interface.genode.stack};
|
||||||
settings = with builtins;
|
settings = with builtins;
|
||||||
lib.optionals (interface.ipv4.addresses != [ ])
|
lib.optionals (interface.ipv4.addresses != [ ])
|
||||||
(let addr = head interface.ipv4.addresses;
|
(let addr = head interface.ipv4.addresses;
|
||||||
|
@ -156,8 +160,9 @@ with lib;
|
||||||
name = "dhcp";
|
name = "dhcp";
|
||||||
value = if interface.useDHCP then "true" else "false";
|
value = if interface.useDHCP then "true" else "false";
|
||||||
};
|
};
|
||||||
settingsMap = map ({ name, value }:
|
settingsMap = builtins.concatStringsSep ", " (map
|
||||||
''{ mapKey = "${name}", mapValue = "${value}" }'') settings;
|
({ name, value }:
|
||||||
|
''{ mapKey = "${name}", mapValue = "${value}" }'') settings);
|
||||||
in pkgs.writeText "${name'}.dhall" ''
|
in pkgs.writeText "${name'}.dhall" ''
|
||||||
let Genode = env:DHALL_GENODE
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
@ -167,33 +172,26 @@ with lib;
|
||||||
Init.Child.Attributes::{
|
Init.Child.Attributes::{
|
||||||
, binary = "${binary}"
|
, binary = "${binary}"
|
||||||
, provides = [ "File_system" ]
|
, 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::{
|
, config = Init.Config::{
|
||||||
, policies =
|
, policies =
|
||||||
[ Init.Config.Policy::{
|
[ Init.Config.Policy::{
|
||||||
, service = "File_system"
|
, service = "File_system"
|
||||||
, label = Init.LabelSelector.suffix "sockets"
|
, label = Init.LabelSelector.suffix "${name'}"
|
||||||
, attributes = toMap { root = "/" }
|
, attributes = toMap { root = "/", writeable="yes" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
, content =
|
, content =
|
||||||
let XML = Genode.Prelude.XML
|
let VFS = Genode.VFS
|
||||||
|
|
||||||
in [ XML.element
|
in [ VFS.vfs
|
||||||
{ name = "vfs"
|
[ VFS.leafAttrs
|
||||||
, attributes = XML.emptyAttributes
|
"${interface.genode.stack}"
|
||||||
, content =
|
([ ${settingsMap} ] : Genode.Prelude.Map.Type Text Text)
|
||||||
[ XML.leaf
|
]
|
||||||
{ name = "lwip"
|
|
||||||
, attributes = [
|
|
||||||
${
|
|
||||||
builtins.concatStringsSep ", "
|
|
||||||
settingsMap
|
|
||||||
}
|
|
||||||
] : Genode.Prelude.Map.Type Text Text
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,12 +121,13 @@ in {
|
||||||
vfs_block = { };
|
vfs_block = { };
|
||||||
vfs_import.patches = [ ./patches/vfs_import.patch ];
|
vfs_import.patches = [ ./patches/vfs_import.patch ];
|
||||||
vfs_jitterentropy.portInputs = [ jitterentropy libc ];
|
vfs_jitterentropy.portInputs = [ jitterentropy libc ];
|
||||||
|
vfs_pipe = { };
|
||||||
|
vfs_ttf.portInputs = [ libc stb ];
|
||||||
vfs_lwip = {
|
vfs_lwip = {
|
||||||
patches = [ ./patches/lwip.patch ];
|
patches = [ ./patches/lwip.patch ];
|
||||||
portInputs = [ lwip ];
|
portInputs = [ lwip ];
|
||||||
};
|
};
|
||||||
vfs_pipe = { };
|
vfs_lxip.portInputs = [ dde_linux ];
|
||||||
vfs_ttf.portInputs = [ libc stb ];
|
|
||||||
|
|
||||||
virtdev_rom = { };
|
virtdev_rom = { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue