WiP! rsync: use genode.shells
This commit is contained in:
parent
ea764cf4b3
commit
29dd6cf10d
|
@ -16,64 +16,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
client = { pkgs, ... }: {
|
client = { pkgs, ... }: {
|
||||||
imports = [ ../nixos-modules/hardware.nix ];
|
imports = [ ../nixos-modules/hardware.nix ../nixos-modules/shell.nix ];
|
||||||
networking.interfaces.eth1.genode.stack = "lwip";
|
genode.shells.rsync = {
|
||||||
genode.init.children.rsync = {
|
environmentVariables.PATH = with pkgs; [ "${rsync}/bin" ];
|
||||||
inputs = with pkgs; [ rsync ];
|
nic = "eth1";
|
||||||
configFile = pkgs.writeText "rsync-client.dhall" ''
|
script = "rsync -rvvv 192.168.1.2::";
|
||||||
let Genode = env:DHALL_GENODE
|
|
||||||
|
|
||||||
let Init = Genode.Init
|
|
||||||
|
|
||||||
let Child = Init.Child
|
|
||||||
|
|
||||||
in Child.flat
|
|
||||||
Child.Attributes::{
|
|
||||||
, binary = "rsync"
|
|
||||||
, exitPropagate = True
|
|
||||||
, resources = Genode.Init.Resources::{
|
|
||||||
, caps = 500
|
|
||||||
, ram = Genode.units.MiB 16
|
|
||||||
}
|
|
||||||
, routes =
|
|
||||||
[ Init.ServiceRoute.child "File_system" "eth1.sockets" ]
|
|
||||||
, config = Init.Config::{
|
|
||||||
, content =
|
|
||||||
let XML = Genode.Prelude.XML
|
|
||||||
|
|
||||||
let VFS = Genode.VFS
|
|
||||||
|
|
||||||
in [ XML.leaf
|
|
||||||
{ name = "libc"
|
|
||||||
, attributes = toMap
|
|
||||||
{ stdin = "/dev/null"
|
|
||||||
, stdout = "/dev/log"
|
|
||||||
, stderr = "/dev/log"
|
|
||||||
, socket = "/dev/sockets"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
, VFS.vfs
|
|
||||||
[ VFS.dir
|
|
||||||
"dev"
|
|
||||||
[ VFS.leaf "log"
|
|
||||||
, VFS.leaf "null"
|
|
||||||
, VFS.dir
|
|
||||||
"sockets"
|
|
||||||
[ VFS.fs VFS.FS::{ label = "eth1.sockets" } ]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
# Genode.Prelude.List.map
|
|
||||||
Text
|
|
||||||
XML.Type
|
|
||||||
( λ(x : Text) →
|
|
||||||
XML.leaf
|
|
||||||
{ name = "arg", attributes = toMap { value = x } }
|
|
||||||
)
|
|
||||||
[ "rsync", "-rvvv", "192.168.1.2::" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,6 +30,6 @@
|
||||||
server.start()
|
server.start()
|
||||||
server.wait_until_serial_output('lwIP Nic interface up address=192.168.1.2')
|
server.wait_until_serial_output('lwIP Nic interface up address=192.168.1.2')
|
||||||
client.start()
|
client.start()
|
||||||
client.wait_until_serial_output('child "rsync" exited')
|
client.wait_until_serial_output('child "rsync.shell" exited')
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue