2
0
Fork 0

nixos: lxip support in hardware.nix

llvm-11
Emery Hemingway 2 years ago
parent a7ef650679
commit f74b789840
  1. 44
      nixos-modules/hardware.nix
  2. 5
      packages/genodelabs/depot-targets.nix

@ -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)
]
]
}
}

@ -121,12 +121,13 @@ in {
vfs_block = { };
vfs_import.patches = [ ./patches/vfs_import.patch ];
vfs_jitterentropy.portInputs = [ jitterentropy libc ];
vfs_pipe = { };
vfs_ttf.portInputs = [ libc stb ];
vfs_lwip = {
patches = [ ./patches/lwip.patch ];
portInputs = [ lwip ];
};
vfs_pipe = { };
vfs_ttf.portInputs = [ libc stb ];
vfs_lxip.portInputs = [ dde_linux ];
virtdev_rom = { };

Loading…
Cancel
Save